diff --git a/platform/mac/AndroidAppBuildController.mm b/platform/mac/AndroidAppBuildController.mm index 19595c12d..ac67f13d2 100644 --- a/platform/mac/AndroidAppBuildController.mm +++ b/platform/mac/AndroidAppBuildController.mm @@ -895,54 +895,6 @@ -(BOOL)areKeystoreAndAliasPasswordsValid:(const char *)keyStore keyPW:(const cha platformServices->Platform().PathForFile( NULL, Rtt::MPlatform::kResourceDir, Rtt::MPlatform::kDefaultPathFlags, resourcesDir ); return listKeyStore.AreKeyStoreAndAliasPasswordsValid(keyStore, keyPW, alias, aliasPW, resourcesDir.GetString()); - -#if 0 - Rtt::String resourcesDir; - - self.authorizer->GetServices().Platform().PathForFile( NULL, Rtt::MPlatform::kResourceDir, Rtt::MPlatform::kDefaultPathFlags, resourcesDir ); - - NSString *resourceDir = [NSString stringWithExternalString:resourcesDir.GetString()]; -// NSString *buildFilePath = [resourceDir stringByAppendingPathComponent:@"build.xml"]; - NSString *tmpDir = NSTemporaryDirectory(); - NSString *srcTestJar = [resourceDir stringByAppendingPathComponent:@"_coronatest.jar"]; - NSString *dstTestJar = [tmpDir stringByAppendingPathComponent:@"_coronatest.jar"]; - -// Escape quotes in the strings by replacing single quotes with "'\''" and then enclosing in single quotes when we build the command - NSString *keyStoreStr = [[NSString stringWithExternalString:keyStore] stringByReplacingOccurrencesOfString:@"'" withString:@"'\''"]; - NSString *keyPWStr = [[NSString stringWithExternalString:keyPW] stringByReplacingOccurrencesOfString:@"'" withString:@"'\''"]; - NSString *aliasStr = [[NSString stringWithExternalString:alias] stringByReplacingOccurrencesOfString:@"'" withString:@"'\''"]; - NSString *aliasPWStr = [[NSString stringWithExternalString:aliasPW] stringByReplacingOccurrencesOfString:@"'" withString:@"'\''"]; - - NSString *script = [[NSString alloc] initWithFormat: - @"cp -f '%@' '%@'; JAVA_TOOL_OPTIONS='-Duser.language=en' jarsigner -tsa http://timestamp.digicert.com -keystore '%@' -storepass '%@' -keypass '%@' '%@' '%@'; exit $?", - srcTestJar, tmpDir, keyStoreStr, keyPWStr, aliasPWStr, dstTestJar, aliasStr]; - -// NSLog( @"tmp dir(%@)", tmpDir ); -// NSLog( @"", script ); - - // The command we run to test the password emits the string "jar signed", this makes that look sensible - printf("Testing credentials for '%s': ", keyStore); - - NSArray *arguments = [[NSArray alloc] initWithObjects:@"-c", script, nil]; - [script release]; - - NSTask* task = [[NSTask alloc] init]; - [task setLaunchPath:@"/bin/sh"]; - [task setArguments:arguments]; - [arguments release]; -// NSFileHandle* devNull = [NSFileHandle fileHandleWithNullDevice]; -// [task setStandardOutput:devNull]; -// [task setStandardError:devNull]; - [task launch]; - [task waitUntilExit]; - int exitCode = [task terminationStatus]; -// [task setStandardOutput:[NSFileHandle fileHandleWithStandardOutput]]; -// [task setStandardError:[NSFileHandle fileHandleWithStandardOutput]]; - [task release]; -// Rtt_TRACE_SIM( ( "ERROR: Failed to verify alias password. Error code(%d)\n", exitCode ) ); -// NSLog( @"alias password. exit code(%d)\n", exitCode ); - return ( 0 == exitCode ); -#endif } - (NSString*)appExtension diff --git a/platform/shared/ListKeyStore.cpp b/platform/shared/ListKeyStore.cpp index 0b7cd849f..506e0c289 100644 --- a/platform/shared/ListKeyStore.cpp +++ b/platform/shared/ListKeyStore.cpp @@ -353,7 +353,7 @@ ListKeyStore::AreKeyStoreAndAliasPasswordsValid( const char *keyStore, const cha #if defined(Rtt_MAC_ENV) || defined(Rtt_LINUX_ENV) - const char kCmdFormat[] = "JAVA_TOOL_OPTIONS='-Duser.language=en' /usr/bin/jarsigner -tsa http://timestamp.digicert.com -keystore %s -storepass %s -keypass %s %s %s; exit $?"; + const char kCmdFormat[] = "JAVA_TOOL_OPTIONS='-Duser.language=en' /usr/bin/jarsigner -keystore %s -storepass %s -keypass %s %s %s; exit $?"; snprintf(cmdBuf, sizeof(cmdBuf), kCmdFormat, keyStoreStr.c_str(), keyPWStr.c_str(), aliasPWStr.c_str(), dstTestJarStr.c_str(), aliasStr.c_str() ); @@ -367,7 +367,7 @@ ListKeyStore::AreKeyStoreAndAliasPasswordsValid( const char *keyStore, const cha keytoolPath = jdkPath + "\\bin\\jarsigner.exe"; _putenv_s("JAVA_TOOL_OPTIONS", "-Duser.language=en"); - const char kCmdFormat[] = "\"%s\" -tsa http://timestamp.digicert.com -keystore %s -storepass %s -keypass %s %s %s"; + const char kCmdFormat[] = "\"%s\" -keystore %s -storepass %s -keypass %s %s %s"; snprintf(cmdBuf, sizeof(cmdBuf), kCmdFormat, keytoolPath.c_str(), keyStoreStr.c_str(), keyPWStr.c_str(), aliasPWStr.c_str(), dstTestJarStr.c_str(), aliasStr.c_str() );