public virtual void CopyLauncherToProjectPath(BuildTarget TargetTestPlatform, string TempPath, string LocalPath) { if (TargetTestPlatform == BuildTarget.StandaloneOSXIntel64) { string ZipPath = Path.Combine(TempPath, "MonsterLauncherOSX.zip"); List <string> ZipFileList = new List <string>(); foreach (string FilePath in IgorRuntimeUtils.GetListOfFilesAndDirectoriesInDirectory(Path.Combine(TempPath, "MonsterLauncher.app"), true, false, true)) { ZipFileList.Add("MonsterLauncher.app/" + FilePath); } IgorZip.ZipFilesCrossPlatform(this, ZipFileList, ZipPath, false, TempPath); string ZipLocalPath = Path.Combine(LocalPath, "MonsterLauncherOSX.zip"); if (File.Exists(ZipLocalPath)) { IgorRuntimeUtils.DeleteFile(ZipLocalPath); } IgorRuntimeUtils.CopyFile(ZipPath, ZipLocalPath); } else if (TargetTestPlatform == BuildTarget.StandaloneWindows64) { string ZipPath = Path.Combine(TempPath, "MonsterLauncherWindows.zip"); List <string> ZipFileList = new List <string>(); foreach (string FilePath in IgorRuntimeUtils.GetListOfFilesAndDirectoriesInDirectory(Path.Combine(TempPath, "MonsterLauncher_Data"), true, false, true)) { ZipFileList.Add("MonsterLauncher_Data/" + FilePath); } ZipFileList.Add("MonsterLauncher.exe"); IgorZip.ZipFilesCrossPlatform(this, ZipFileList, ZipPath, false, TempPath); string ZipLocalPath = Path.Combine(LocalPath, "MonsterLauncherWindows.zip"); if (File.Exists(ZipLocalPath)) { IgorRuntimeUtils.DeleteFile(ZipLocalPath); } IgorRuntimeUtils.CopyFile(ZipPath, ZipLocalPath); } }
public static bool ResignAPK(IIgorModule ModuleInst, string SourceAPK, string RepackagingDirectory, ref string FinalFilename, string KeystoreFilename, string KeystorePassword, string KeyAlias, string KeyAliasPassword) { if (Directory.Exists(RepackagingDirectory)) { IgorRuntimeUtils.DeleteDirectory(RepackagingDirectory); } Directory.CreateDirectory(RepackagingDirectory); IgorZip.UnzipArchiveCrossPlatform(ModuleInst, SourceAPK, RepackagingDirectory); IgorRuntimeUtils.DeleteDirectory(Path.Combine(RepackagingDirectory, "META-INF")); string UnsignedAPK = Path.Combine(RepackagingDirectory, "Repackaged.unsigned.apk"); List <string> APKContents = IgorRuntimeUtils.GetListOfFilesAndDirectoriesInDirectory(RepackagingDirectory); IgorZip.ZipFilesCrossPlatform(ModuleInst, APKContents, UnsignedAPK, false, RepackagingDirectory); string SignedAPK = Path.Combine(RepackagingDirectory, "Repackaged.signed.apk"); // IgorCore.LogError(ModuleInst, "jarsigner command running from " + Path.GetFullPath(".") + " is\n" + "-verbose -keystore \"" + KeystoreFilename + "\" -storepass " + KeystorePassword + // " -keypass " + KeyAliasPassword + " -signedjar \"" + SignedAPK + "\" \"" + UnsignedAPK + "\" " + KeyAlias); if (IgorRuntimeUtils.RunProcessCrossPlatform(ModuleInst, "jarsigner", "jarsigner", "-verbose -sigalg SHA1withDSA -digestalg SHA1 -keystore \"" + KeystoreFilename + "\" -storepass " + KeystorePassword + " -keypass " + KeyAliasPassword + " -signedjar \"" + SignedAPK + "\" \"" + UnsignedAPK + "\" " + KeyAlias, Path.GetFullPath("."), "Running jarsigner", true) != 0) { return(false); } string ZipAlignPath = GetZipAlignPath(ModuleInst); string AlignedAPK = Path.Combine(RepackagingDirectory, "Repackaged.aligned.apk"); if (IgorRuntimeUtils.RunProcessCrossPlatform(ModuleInst, ZipAlignPath, ZipAlignPath, "-v 4 \"" + SignedAPK + "\" \"" + AlignedAPK + "\"", Path.GetFullPath("."), "Running zipalign") != 0) { return(false); } FinalFilename = AlignedAPK; return(true); }
public virtual bool UpdateXCodeProj() { string FacebookID = GetParamOrConfigString(FacebookIDFlag, "Your Facebook ID hasn't been set! Facebook functionality will probably not work correctly."); string FacebookDisplayName = GetParamOrConfigString(FacebookDisplayNameFlag, "Your Facebook Display Name hasn't been set! Facebook functionality will probably not work correctly."); List <string> BuildProducts = IgorCore.GetModuleProducts(); if (IgorAssert.EnsureTrue(this, BuildProducts.Count > 0, "Attempting to update the XCode project, but one was not generated in the build phase!")) { string ProjectPath = Path.Combine(BuildProducts[0], "Unity-IPhone.xcodeproj"); string FacebookIntegrationGUID = IgorXCodeProjUtils.AddNewFileReference(this, ProjectPath, "FacebookIntegration.h", TreeEnum.GROUP); IgorXCodeProjUtils.SortGUIDIntoGroup(this, ProjectPath, FacebookIntegrationGUID, "Libraries"); IgorXCodeProjUtils.AddFramework(this, ProjectPath, "FacebookSDK.framework", TreeEnum.GROUP, "Libraries/FacebookSDK.framework", -1, "wrapper.framework", "FacebookSDK.framework"); IgorXCodeProjUtils.AddFrameworkSearchPath(this, ProjectPath, "$(SRCROOT)/Libraries"); string PlistPath = Path.Combine(BuildProducts[0], "Info.plist"); IgorPlistUtils.SetStringValue(this, PlistPath, "FacebookAppID", FacebookID); IgorPlistUtils.SetStringValue(this, PlistPath, "FacebookDisplayName", FacebookDisplayName); IgorPlistUtils.AddBundleURLType(this, PlistPath, "fb" + FacebookID); IgorZip.UnzipArchiveCrossPlatform(this, Path.Combine(Path.GetFullPath("."), Path.Combine("Assets", Path.Combine("Plugins", Path.Combine("iOS", Path.Combine("FacebookSDK", "FacebookSDK.framework.zip"))))), Path.Combine(BuildProducts[0], "Libraries")); IgoriOSSourceUtils.AddHeaderToAppControllerSource(this, BuildProducts[0], "../Libraries/FacebookIntegration.h"); IgoriOSSourceUtils.AddFunctionToAppControllerSource(this, BuildProducts[0], "/* Pre iOS 4.2 support */\n- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url\n{\n\treturn [FBSession.activeSession handleOpenURL:url];\n}\n"); IgorUtils.ReplaceStringsInFile(this, Path.Combine(BuildProducts[0], Path.Combine("Classes", "UnityAppController.mm")), "AppController_SendNotificationWithArg(kUnityOnOpenURL, notifData);\n\treturn YES;", "AppController_SendNotificationWithArg(kUnityOnOpenURL, notifData); return [FBSession.activeSession handleOpenURL:url];"); IgoriOSSourceUtils.AddSourceToApplicationDidBecomeActive(this, BuildProducts[0], "[FBSession.activeSession handleDidBecomeActive];"); } return(true); }