Updated the sparkle dynamic library and the SparkleActivator.

SparkleActivator can now gives the path to the Sparkle framework to 
the JNI.
cusax-fix
Romain Kuntz 19 years ago
parent ba5b733b6f
commit 04b95ac30f

@ -10,10 +10,10 @@ extern "C" {
/*
* Class: net_java_sip_communicator_impl_sparkle_SparkleActivator
* Method: initSparkle
* Signature: ()V
* Signature: (Ljava/lang/String;)V
*/
JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_sparkle_SparkleActivator_initSparkle
(JNIEnv *, jclass);
(JNIEnv *, jclass, jstring);
#ifdef __cplusplus
}

@ -16,21 +16,22 @@
/*
* Class: net_java_sip_communicator_impl_sparkle_SparkleActivator
* Method: initSparkle
* Signature: ()V
* Signature: (Ljava/lang/String;)V
*/
JNIEXPORT void JNICALL
Java_net_java_sip_communicator_impl_sparkle_SparkleActivator_initSparkle
(JNIEnv *env, jclass obj)
(JNIEnv *env, jclass obj, jstring pathToSparkleFramework)
{
bool haveBundle = ([[NSBundle mainBundle]
objectForInfoDictionaryKey:@"CFBundleName"] != nil);
NSString* path = [[NSString alloc]
initWithUTF8String:"Contents/Frameworks/Sparkle.framework"];
NSBundle* bundle = [NSBundle bundleWithPath:path];
const char *path = (*env)->GetStringUTFChars(env, pathToSparkleFramework, 0);
NSBundle* bundle = [NSBundle bundleWithPath:[NSString stringWithCString: path]];
Class suUpdaterClass = [bundle classNamed:@"SUUpdater"];
id suUpdater = [[suUpdaterClass alloc] init];
(*env)->ReleaseStringUTFChars(env, pathToSparkleFramework, path);
NSMenu* menu = [[NSApplication sharedApplication] mainMenu];
NSMenu* applicationMenu = [[menu itemAtIndex:0] submenu];
NSMenuItem* checkForUpdatesMenuItem = [[NSMenuItem alloc]

@ -20,7 +20,7 @@ public class SparkleActivator
private static Logger logger = Logger.getLogger(SparkleActivator.class);
// Native method declaration
public native static void initSparkle();
public native static void initSparkle(String pathToSparkleFramework);
/**
* Dynamically loads JNI object. Will fail if non-MacOSX
@ -38,7 +38,8 @@ public class SparkleActivator
*/
public void start(BundleContext bundleContext) throws Exception
{
initSparkle();
// TODO: better way to get the Sparkle Framework path?
initSparkle(System.getProperty("user.dir") + "/../../Frameworks/Sparkle.framework");
logger.info("Sparkle Plugin ...[Started]");
}

Loading…
Cancel
Save