Updated to the latest Sparkle version. It now should work on Java1.6. Updates are now signed.

Work done by Egidijus Jankauska.
cusax-fix
Romain Kuntz 17 years ago
parent ae5d54d7b9
commit 916e9d1709

@ -780,15 +780,23 @@
<copy file="lib/native/mac/libsparkle_init.dylib"
todir="${macosx.app.dir}/${application.name}.app/Contents/Resources/Java/lib/native/mac/"/>
<!-- Add public key file to the application bundle -->
<copy file="${macosx.resrc.dir}/sparkle_dsa_pub.pem"
todir="${macosx.app.dir}/${application.name}.app/Contents/Resources/"/>
<!-- Add the Sparkle properties in the Info.plist file -->
<replace file="${macosx.app.dir}/${application.name}.app/Contents/Info.plist">
<replacetoken><![CDATA[<key>CFBundleName</key>]]></replacetoken>
<replacevalue><![CDATA[<key>SUCheckAtStartup</key>
<string>false</string>
<string>YES</string>
<key>SUScheduledCheckInterval</key>
<string>86400</string>
<key>SUPublicDSAKeyFile</key>
<string>sparkle_dsa_pub.pem</string>
<key>SUFeedURL</key>
<string>http://download.sip-communicator.org/nightly/macosx/sparkle/updates.xml</string>
<key>SUShowReleaseNotes</key>
<string>true</string>
<string>YES</string>
<key>CFBundleName</key>]]></replacevalue>
</replace>
@ -805,6 +813,8 @@
resource="./Versions/Current/Resources"/>
<symlink link="${macosx.app.dir}/${application.name}.app/Contents/Frameworks/Sparkle.framework/Sparkle"
resource="./Versions/Current/Sparkle"/>
<symlink link="${macosx.app.dir}/${application.name}.app/Contents/Frameworks/Sparkle.framework/Resources/fr_CA.lproj"
resource="./fr.lproj"/>
</target>
<!-- Create the DMG - This only works on MacOSX (need hdiutil) -->

@ -0,0 +1,20 @@
-----BEGIN PUBLIC KEY-----
MIIDOjCCAi0GByqGSM44BAEwggIgAoIBAQCliK5bSAbldKUZOu+8lmwnxUla2dsi
FwhjqPBb6kf1fqLKTftCQgNZ/xTlFJwT30nOVCRc/2uCtwDpTKE2U7fJTnhJHX/K
AbN2oHlE61giV5msdW0K5LvxCVv0EJIWKj5taltE3aYXxkXZG9/reNkuZn3lw1CD
utP1KVkDYFlxmKV7YYTDnoFt5Kt8+cfwksLFRyhUd9L9Ywdfs/O0YzEQqkvAhUI2
QkzFjS51IM3aq0Q2ukttFEe26xxoNktd6VGdlECmTsBMG/8Jd2p9WKTAl/0e7A1O
EpFb/00ElYmuaL4CPIdcWR3zgNjZ/igy9ICCK01EjMJjXpIMkM/5wcOxAhUA2DPC
gfj6cc5VBPXb56De+QJuECcCggEALOGNHRe9YuIMGBRdNyB7R9s7ASF+4Kj5meRZ
f3o87iYFeAAWnM35sXpRznwoKedQlj432PWm/cZf85tt1/iImIpOlk/VpbIq9SGG
V8GxJwqmIvlRXAskTcXBOcDYmhZPIYmIBCDC1EB6iVg91x5kCyvoHwwo2H1qmr+l
+evNkNcOaHu+ONrMWVLfTdPXzYcOcRdm9oRl0yZNO1+r+6IKl9quqTTbENUscVFu
Td56iHu0DPGxHDGh+26VDAOaer5PRwW77javx76udzwe27H2+xgKWlbX66q/WVr1
OHwejOnrzGllfJEVh8sk7bSniAmoD6NVcKyfwuSMspzRKJ2WSAOCAQUAAoIBADWS
v8GWGXZmTFF/Av4DCxODgMlSS0zrJywURL9pa87OQMnPVUz/V+1u0ZSSUHHNnyZt
AuWn3HjQhQgfP80ekjdLgxK+3Wgf+OzwqNoKwCdXAS9OfqtnhxtcfIj/6Epjszck
GUfMrt1k4CPR1hbt2VYGZdhLnj4Vn90y+/OM5qp2Ob2cEFzDgNkymXfehX5lJ4Cn
FVpmZfLCUhCdTaRstHEJhag1La67ZqjUdTBu6QI0axeh1E7JX2FLly51ClAD1esg
ikBzljrtjkRTsDrydHkebD2z6u485X9bQblZKL6ytEtu2paalvDfRIzdIUZ2L6iT
FE5/nJ5H+H9zRj1QfgY=
-----END PUBLIC KEY-----

@ -2,7 +2,7 @@
# Requires the Sparkle.framework installed in /Library/Frameworks
# The Framework is available at http://sparkle.andymatuschak.org/
CC=gcc
CC=gcc -arch x86_64 -arch i386
TARGET=libsparkle_init.dylib
JNI_INCLUDE_PATH=/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Headers/
CFLAGS=-I$(JNI_INCLUDE_PATH)

@ -16,11 +16,12 @@
* installed in /Library/Frameworks/. This Framework is
* available at http://sparkle.andymatuschak.org/
*
* @author Romain Kuntz
* @author Romain Kuntz
* @author Egidijus Jankauskas
*/
#include <Cocoa/Cocoa.h>
#include <Sparkle/SUUpdater.h>
#include <Sparkle/Sparkle.h>
#include "net_java_sip_communicator_impl_sparkle_SparkleActivator.h"
/*
@ -33,39 +34,45 @@ Java_net_java_sip_communicator_impl_sparkle_SparkleActivator_initSparkle
(JNIEnv *env, jclass obj, jstring pathToSparkleFramework,
jboolean updateAtStartup, jint checkInterval)
{
bool haveBundle = ([[NSBundle mainBundle]
objectForInfoDictionaryKey:@"CFBundleName"] != nil);
const char *path = (*env)->GetStringUTFChars(env, pathToSparkleFramework, 0);
BOOL hasLaunchedBefore = [[NSUserDefaults standardUserDefaults] boolForKey:@"SCHasLaunchedBefore"];
if(!hasLaunchedBefore)
{
[[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"SCHasLaunchedBefore"];
[[NSUserDefaults standardUserDefaults] synchronize];
}
// The below code was used to avoid to link the Sparkle framework
// at comilation time.
//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];
SUUpdater *suUpdater = [SUUpdater alloc];
(*env)->ReleaseStringUTFChars(env, pathToSparkleFramework, path);
//(*env)->ReleaseStringUTFChars(env, pathToSparkleFramework, path);
SUUpdater *suUpdater = [SUUpdater updaterForBundle:[NSBundle mainBundle]];
NSMenu* menu = [[NSApplication sharedApplication] mainMenu];
NSMenu* applicationMenu = [[menu itemAtIndex:0] submenu];
NSMenuItem* checkForUpdatesMenuItem = [[NSMenuItem alloc]
initWithTitle:@"Check for Updates"
initWithTitle:@"Check for Updates..."
action:@selector(checkForUpdates:)
keyEquivalent:@""];
if (haveBundle) {
[checkForUpdatesMenuItem setEnabled:YES];
[checkForUpdatesMenuItem setTarget:suUpdater];
}
[checkForUpdatesMenuItem setEnabled:YES];
[checkForUpdatesMenuItem setTarget:suUpdater];
// 0 => top, 1 => after "About..."
[applicationMenu insertItem:checkForUpdatesMenuItem atIndex:1];
// Check at Startup (SUCheckAtStartup and SUScheduledCheckInterval
// specified in the Info.plist does not seem to work)
if (updateAtStartup == JNI_TRUE)
[suUpdater checkForUpdatesInBackground];
[suUpdater scheduleCheckWithInterval:checkInterval];
// Update is launched only at the second startup
if (hasLaunchedBefore && updateAtStartup == JNI_TRUE)
{
// This method needs to be executed on the main thread because it may result
// in GUI showing up. Besides, Sparkle uses asynchronous URLConnection which
// requires to be called from a thread which runs in a default run loop mode.
[suUpdater performSelectorOnMainThread:@selector(checkForUpdatesInBackground)
withObject:nil
waitUntilDone:NO];
}
}

Loading…
Cancel
Save