Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: weird problem w/ Runtime.exec and application bundle (10.5)




On Dec 20, 2007, at 11:49 AM, Scott Kovatch wrote:

Bundled applications that were built on certain earlier versions of the OS had a flaw in the stub that keeps them from executing in Leopard. The fix is to re-bundle the application in Leopard.


Is there any way some versioning or timestamp could be determined from the JavaApplicationStub to help in determining if problems like this might apply. I tried writing a application verifier a while back that tried to address a similar problem that had come up some time back. I ended up trying to make a best guess on dates to determine if the bug might apply for a given JavaApplicationStub

private static final Date MODERN_STUB = new Date(102,3,8);

Date stubdate = new Date(execfile.lastModified());
if (stubdate.before(MODERN_STUB)) {
out.println("apparent native executable " + execfile + " appears out of date");
errors |= OLD_EXECUTABLE;


If some version API could be added to the stubs or some timestamp embedded it might eliminate some guess work on similar problems?

Speaking of embedding. I'm curious, for applications that change the executable with a shell script or otherwise I had code that tried to guess if a file was the correct stub based on a magic check.

	private static final int STUB_MAGIC = 0xfeedface;


I recently starting using this code somewhere else and the magic wasn't matching. Actually now showing the java class file magic?


private static final int STUB_MAGIC = 0xfeedface;
private static final int JAVA_MAGIC = 0xcafebabe; // Seeing file witht this? Hopefully not something I did


checked for, now, with something like...

					if (magic == STUB_MAGIC || magic == JAVA_MAGIC) {

Why I check for it I'm not entirely sure but I do and had to change the check this last week. Is using the same thing as java class files really a good idea? There is some value I think that should be set in the plist that would match a renamed JavaApplicationStub but I apparently stumbled on this and started checking it as insurance or something.
Assuming, for CAFEBABE that I didn't in fact clobber it myself somehow but I'd guess not.



Mike Hall hallmike at att dot net http://www.geocities.com/mik3hall http://sourceforge.net/projects/macnative



_______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden

This email sent to email@hidden
References: 
 >weird problem w/ Runtime.exec and application bundle (10.5) (From: "Janni Kovacs" <email@hidden>)
 >Re: weird problem w/ Runtime.exec and application bundle (10.5) (From: Scott Kovatch <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.