public static void IOS_Install_SocialPart() { //IOS Native + MSP FileStaticAPI.CopyFile(PluginsInstalationUtil.IOS_SOURCE_PATH + "ISN_SocialGate.mm.txt", PluginsInstalationUtil.IOS_DESTANATION_PATH + "ISN_SocialGate.mm"); FileStaticAPI.CopyFile(PluginsInstalationUtil.IOS_SOURCE_PATH + "ISN_NativeCore.h.txt", PluginsInstalationUtil.IOS_DESTANATION_PATH + "ISN_NativeCore.h"); FileStaticAPI.CopyFile(PluginsInstalationUtil.IOS_SOURCE_PATH + "ISN_NativeCore.mm.txt", PluginsInstalationUtil.IOS_DESTANATION_PATH + "ISN_NativeCore.mm"); }
public static void InstallGMAPart() { //GMA FileStaticAPI.CopyFile(PluginsInstalationUtil.IOS_SOURCE_PATH + "GMA_SA_Lib_Proxy.mm.txt", PluginsInstalationUtil.IOS_DESTANATION_PATH + "GMA_SA_Lib_Proxy.mm"); FileStaticAPI.CopyFile(PluginsInstalationUtil.IOS_SOURCE_PATH + "GMA_SA_Lib.h.txt", PluginsInstalationUtil.IOS_DESTANATION_PATH + "GMA_SA_Lib.h"); FileStaticAPI.CopyFile(PluginsInstalationUtil.IOS_SOURCE_PATH + "GMA_SA_Lib.m.txt", PluginsInstalationUtil.IOS_DESTANATION_PATH + "GMA_SA_Lib.m"); }
public static void IOS_InstallPlugin(bool IsFirstInstall = true) { IOS_CleanUp(); //IOS Native FileStaticAPI.CopyFile(PluginsInstalationUtil.IOS_SOURCE_PATH + "ISN_Camera.mm.txt", PluginsInstalationUtil.IOS_DESTANATION_PATH + "ISN_Camera.mm"); FileStaticAPI.CopyFile(PluginsInstalationUtil.IOS_SOURCE_PATH + "ISN_GameCenter.mm.txt", PluginsInstalationUtil.IOS_DESTANATION_PATH + "ISN_GameCenter.mm"); FileStaticAPI.CopyFile(PluginsInstalationUtil.IOS_SOURCE_PATH + "ISN_iAd.mm.txt", PluginsInstalationUtil.IOS_DESTANATION_PATH + "ISN_iAd.mm"); FileStaticAPI.CopyFile(PluginsInstalationUtil.IOS_SOURCE_PATH + "ISN_InApp.mm.txt", PluginsInstalationUtil.IOS_DESTANATION_PATH + "ISN_InApp.mm"); FileStaticAPI.CopyFile(PluginsInstalationUtil.IOS_SOURCE_PATH + "ISN_Media.mm.txt", PluginsInstalationUtil.IOS_DESTANATION_PATH + "ISN_Media.mm"); FileStaticAPI.CopyFile(PluginsInstalationUtil.IOS_SOURCE_PATH + "ISN_ReplayKit.mm.txt", PluginsInstalationUtil.IOS_DESTANATION_PATH + "ISN_ReplayKit.mm"); FileStaticAPI.CopyFile(PluginsInstalationUtil.IOS_SOURCE_PATH + "ISN_NSData+Base64.h.txt", PluginsInstalationUtil.IOS_DESTANATION_PATH + "ISN_NSData+Base64.h"); FileStaticAPI.CopyFile(PluginsInstalationUtil.IOS_SOURCE_PATH + "ISN_NSData+Base64.m.txt", PluginsInstalationUtil.IOS_DESTANATION_PATH + "ISN_NSData+Base64.m"); IOS_Install_SocialPart(); }
public static void Android_InstallPlugin(bool IsFirstInstall = true) { //Unity 5 upgdare: FileStaticAPI.DeleteFile(ANDROID_SOURCE_PATH + "libs/httpclient-4.3.1.jar"); FileStaticAPI.DeleteFile(ANDROID_SOURCE_PATH + "libs/signpost-commonshttp4-1.2.1.2.jar"); FileStaticAPI.DeleteFile(ANDROID_SOURCE_PATH + "libs/signpost-core-1.2.1.2.jar"); FileStaticAPI.DeleteFile(ANDROID_SOURCE_PATH + "libs/libGoogleAnalyticsServices.jar"); FileStaticAPI.DeleteFile(ANDROID_SOURCE_PATH + "libs/android-support-v4.jar"); FileStaticAPI.DeleteFile(ANDROID_SOURCE_PATH + "libs/image-chooser-library-1.3.0.jar"); FileStaticAPI.DeleteFile(ANDROID_SOURCE_PATH + "libs/twitter4j-core-3.0.5.jar"); FileStaticAPI.DeleteFile(ANDROID_SOURCE_PATH + "libs/google-play-services.jar"); FileStaticAPI.DeleteFile(ANDROID_SOURCE_PATH + "social/an_social.jar"); FileStaticAPI.DeleteFile(ANDROID_SOURCE_PATH + "social/twitter4j-core-3.0.5.jar"); FileStaticAPI.DeleteFile(ANDROID_SOURCE_PATH + "google_play/an_googleplay.jar"); FileStaticAPI.DeleteFile(ANDROID_SOURCE_PATH + "google_play/google-play-services.jar"); FileStaticAPI.DeleteFile(ANDROID_SOURCE_PATH + "billing/an_billing.jar"); FileStaticAPI.CopyFile(ANDROID_SOURCE_PATH + "libs/android-support-v4.txt", ANDROID_DESTANATION_PATH + "libs/android-support-v4.jar"); FileStaticAPI.CopyFile(ANDROID_SOURCE_PATH + "androidnative.txt", ANDROID_DESTANATION_PATH + "androidnative.jar"); FileStaticAPI.CopyFile(ANDROID_SOURCE_PATH + "mobilenativepopups.txt", ANDROID_DESTANATION_PATH + "mobilenativepopups.jar"); FileStaticAPI.CopyFolder(ANDROID_SOURCE_PATH + "facebook", ANDROID_DESTANATION_PATH + "facebook"); #if UNITY_3_5 || UNITY_4_0 || UNITY_4_1 || UNITY_4_2 || UNITY_4_3 || UNITY_4_5 || UNITY_4_6 #else FileStaticAPI.DeleteFolder(ANDROID_SOURCE_PATH + "facebook"); #endif if (IsFirstInstall) { EnableBillingAPI(); EnableGooglePlayAPI(); EnableSocialAPI(); EnableCameraAPI(); EnableAppLicensingAPI(); } string file; file = "AN_Res/res/values/analytics.xml"; if (!FileStaticAPI.IsFileExists(ANDROID_DESTANATION_PATH + file)) { FileStaticAPI.CopyFile(ANDROID_SOURCE_PATH + file, ANDROID_DESTANATION_PATH + file); } file = "AN_Res/res/values/ids.xml"; if (!FileStaticAPI.IsFileExists(ANDROID_DESTANATION_PATH + file)) { FileStaticAPI.CopyFile(ANDROID_SOURCE_PATH + file, ANDROID_DESTANATION_PATH + file); } file = "AN_Res/res/xml/file_paths.xml"; if (!FileStaticAPI.IsFileExists(ANDROID_DESTANATION_PATH + file)) { FileStaticAPI.CopyFile(ANDROID_SOURCE_PATH + file, ANDROID_DESTANATION_PATH + file); } file = "AN_Res/res/values/version.xml"; FileStaticAPI.CopyFile(ANDROID_SOURCE_PATH + file, ANDROID_DESTANATION_PATH + file); file = "AN_Res/project.properties"; FileStaticAPI.CopyFile(ANDROID_SOURCE_PATH + file, ANDROID_DESTANATION_PATH + file); file = "AN_Res/AndroidManifest.xml"; FileStaticAPI.CopyFile(ANDROID_SOURCE_PATH + file, ANDROID_DESTANATION_PATH + file); //First install dependense file = "AndroidManifest.xml"; if (!FileStaticAPI.IsFileExists(ANDROID_DESTANATION_PATH + file)) { FileStaticAPI.CopyFile(ANDROID_SOURCE_PATH + file, ANDROID_DESTANATION_PATH + file); } AssetDatabase.Refresh(); }
public static void EnableCameraAPI() { //Unity 5 upgdare: FileStaticAPI.CopyFile(ANDROID_SOURCE_PATH + "libs/image-chooser-library-1.3.0.txt", ANDROID_DESTANATION_PATH + "libs/image-chooser-library-1.3.0.jar"); }
public static void EnableSocialAPI() { FileStaticAPI.CopyFile(ANDROID_SOURCE_PATH + "social/an_social.txt", ANDROID_DESTANATION_PATH + "libs/an_social.jar"); FileStaticAPI.CopyFile(ANDROID_SOURCE_PATH + "social/twitter4j-core-3.0.5.txt", ANDROID_DESTANATION_PATH + "libs/twitter4j-core-3.0.5.jar"); }
public static void EnableBillingAPI() { FileStaticAPI.CopyFile(ANDROID_SOURCE_PATH + "billing/an_billing.txt", ANDROID_DESTANATION_PATH + "libs/an_billing.jar"); }
public static void EnableSoomlaAPI() { FileStaticAPI.CopyFile(ANDROID_SOURCE_PATH + "libs/an_sa_soomla.txt", ANDROID_DESTANATION_PATH + "libs/an_sa_soomla.jar"); }
public static void EnableAppLicensingAPI() { FileStaticAPI.CopyFile(ANDROID_SOURCE_PATH + "app_licensing/an_licensing_library.txt", ANDROID_DESTANATION_PATH + "libs/an_licensing_library.jar"); }
public static void EnableGooglePlayAPI() { FileStaticAPI.CopyFile(ANDROID_SOURCE_PATH + "google_play/an_googleplay.txt", ANDROID_DESTANATION_PATH + "libs/an_googleplay.jar"); FileStaticAPI.CopyFile(ANDROID_SOURCE_PATH + "google_play/google-play-services.txt", ANDROID_DESTANATION_PATH + "libs/google-play-services.jar"); }
private void Actions() { EditorGUILayout.Space(); EditorGUILayout.BeginHorizontal(); EditorGUILayout.LabelField("Keep Android Mnifest Clean"); EditorGUI.BeginChangeCheck(); SocialPlatfromSettings.Instance.KeepManifestClean = EditorGUILayout.Toggle(SocialPlatfromSettings.Instance.KeepManifestClean); if (EditorGUI.EndChangeCheck()) { UpdateManifest(); } if (GUILayout.Button("[?]", GUILayout.Width(25))) { Application.OpenURL("http://goo.gl/018lnQ"); } EditorGUILayout.Space(); EditorGUILayout.Space(); EditorGUILayout.EndHorizontal(); SocialPlatfromSettings.Instance.ShowAPIS = EditorGUILayout.Foldout(SocialPlatfromSettings.Instance.ShowAPIS, "Mobile Social Plugin APIs"); if (SocialPlatfromSettings.Instance.ShowAPIS) { EditorGUI.indentLevel++; EditorGUI.BeginChangeCheck(); DrawAPIsList(); if (EditorGUI.EndChangeCheck()) { UpdateManifest(); } EditorGUI.indentLevel--; EditorGUILayout.Space(); } SocialPlatfromSettings.Instance.ShowActions = EditorGUILayout.Foldout(SocialPlatfromSettings.Instance.ShowActions, "More Actions"); if (SocialPlatfromSettings.Instance.ShowActions) { if (!IsFacebookInstalled) { GUI.enabled = false; } EditorGUILayout.BeginHorizontal(); EditorGUILayout.Space(); if (GUILayout.Button("Remove Facebook SDK", GUILayout.Width(160))) { bool result = EditorUtility.DisplayDialog( "Removing Facebook SDK", "Warning action can not be undone without reimporting the plugin", "Remove", "Cansel"); if (result) { FileStaticAPI.DeleteFolder(PluginsInstalationUtil.ANDROID_DESTANATION_PATH + "facebook"); FileStaticAPI.DeleteFolder("Facebook"); FileStaticAPI.DeleteFolder("Extensions/GooglePlayCommon/Social/Facebook"); FileStaticAPI.DeleteFile("Extensions/MobileSocialPlugin/Example/Scripts/MSPFacebookUseExample.cs"); FileStaticAPI.DeleteFile("Extensions/MobileSocialPlugin/Example/Scripts/MSP_FacebookAnalyticsExample.cs"); FileStaticAPI.DeleteFile("Extensions/MobileSocialPlugin/Example/Scripts/MSP_FacebookAndroidTurnBasedAndGiftsExample.cs"); FileStaticAPI.CopyFile("Extensions/StansAssetsCommon/SA_FB_PlaceHolder.txt", "Extensions/StansAssetsCommon/SA_FB_PlaceHolder.cs"); } } if (GUILayout.Button("Reset Settings", GUILayout.Width(160))) { ResetSettings(); } GUI.enabled = true; EditorGUILayout.EndHorizontal(); EditorGUILayout.Space(); EditorGUILayout.BeginHorizontal(); EditorGUILayout.Space(); if (GUILayout.Button("Load Example Settings", GUILayout.Width(160))) { LoadExampleSettings(); } if (GUILayout.Button("Reinstall", GUILayout.Width(160))) { PluginsInstalationUtil.Android_UpdatePlugin(); PluginsInstalationUtil.IOS_UpdatePlugin(); UpdateVersionInfo(); } EditorGUILayout.EndHorizontal(); } }
public static void UpdatePluginSettings() { if (!IsInstalled || !IsUpToDate) { return; } ChnageDefineState(IOSNotificationController_Path, "PUSH_ENABLED", IOSNativeSettings.Instance.EnablePushNotificationsAPI); ChnageDefineState(DeviceTokenListener_Path, "PUSH_ENABLED", IOSNativeSettings.Instance.EnablePushNotificationsAPI); ChnageDefineState(GameCenterManager_Path, "GAME_CENTER_ENABLED", IOSNativeSettings.Instance.EnableGameCenterAPI); ChnageDefineState(GameCenter_TBM_Path, "GAME_CENTER_ENABLED", IOSNativeSettings.Instance.EnableGameCenterAPI); ChnageDefineState(GameCenter_RTM_Path, "GAME_CENTER_ENABLED", IOSNativeSettings.Instance.EnableGameCenterAPI); ChnageDefineState(IOSNativeMarketBridge_Path, "INAPP_API_ENABLED", IOSNativeSettings.Instance.EnableInAppsAPI); ChnageDefineState(IOSStoreProductView_Path, "INAPP_API_ENABLED", IOSNativeSettings.Instance.EnableInAppsAPI); ChnageDefineState(ISN_Security_Path, "INAPP_API_ENABLED", IOSNativeSettings.Instance.EnableInAppsAPI); ChnageDefineState(iAdBannerControllerr_Path, "IAD_API", IOSNativeSettings.Instance.EnableiAdAPI); ChnageDefineState(iAdBanner_Path, "IAD_API", IOSNativeSettings.Instance.EnableiAdAPI); ChnageDefineState(IOSSocialManager_Path, "SOCIAL_API", IOSNativeSettings.Instance.EnableSocialSharingAPI); ChnageDefineState(IOSCamera_Path, "CAMERA_API", IOSNativeSettings.Instance.EnableCameraAPI); ChnageDefineState(IOSVideoManager_Path, "VIDEO_API", IOSNativeSettings.Instance.EnableMediaPlayerAPI); ChnageDefineState(ISN_MediaController_Path, "VIDEO_API", IOSNativeSettings.Instance.EnableMediaPlayerAPI); ChnageDefineState(ISN_ReplayKit_Path, "REPLAY_KIT", IOSNativeSettings.Instance.EnableReplayKit); if (!IOSNativeSettings.Instance.EnableGameCenterAPI) { PluginsInstalationUtil.RemoveIOSFile("ISN_GameCenter"); } else { FileStaticAPI.CopyFile(PluginsInstalationUtil.IOS_SOURCE_PATH + "ISN_GameCenter.mm.txt", PluginsInstalationUtil.IOS_DESTANATION_PATH + "ISN_GameCenter.mm"); } if (!IOSNativeSettings.Instance.EnableInAppsAPI) { PluginsInstalationUtil.RemoveIOSFile("ISN_InApp"); } else { FileStaticAPI.CopyFile(PluginsInstalationUtil.IOS_SOURCE_PATH + "ISN_InApp.mm.txt", PluginsInstalationUtil.IOS_DESTANATION_PATH + "ISN_InApp.mm"); } if (!IOSNativeSettings.Instance.EnableiAdAPI) { PluginsInstalationUtil.RemoveIOSFile("ISN_iAd"); } else { FileStaticAPI.CopyFile(PluginsInstalationUtil.IOS_SOURCE_PATH + "ISN_iAd.mm.txt", PluginsInstalationUtil.IOS_DESTANATION_PATH + "ISN_iAd.mm"); } if (!IOSNativeSettings.Instance.EnableCameraAPI) { PluginsInstalationUtil.RemoveIOSFile("ISN_Camera"); } else { FileStaticAPI.CopyFile(PluginsInstalationUtil.IOS_SOURCE_PATH + "ISN_Camera.mm.txt", PluginsInstalationUtil.IOS_DESTANATION_PATH + "ISN_Camera.mm"); } if (!IOSNativeSettings.Instance.EnableSocialSharingAPI) { PluginsInstalationUtil.RemoveIOSFile("ISN_SocialGate"); } else { FileStaticAPI.CopyFile(PluginsInstalationUtil.IOS_SOURCE_PATH + "ISN_SocialGate.mm.txt", PluginsInstalationUtil.IOS_DESTANATION_PATH + "ISN_SocialGate.mm"); } if (!IOSNativeSettings.Instance.EnableMediaPlayerAPI) { PluginsInstalationUtil.RemoveIOSFile("ISN_Media"); } else { FileStaticAPI.CopyFile(PluginsInstalationUtil.IOS_SOURCE_PATH + "ISN_Media.mm.txt", PluginsInstalationUtil.IOS_DESTANATION_PATH + "ISN_Media.mm"); } if (!IOSNativeSettings.Instance.EnableReplayKit) { PluginsInstalationUtil.RemoveIOSFile("ISN_ReplayKit"); } else { FileStaticAPI.CopyFile(PluginsInstalationUtil.IOS_SOURCE_PATH + "ISN_ReplayKit.mm.txt", PluginsInstalationUtil.IOS_DESTANATION_PATH + "ISN_ReplayKit.mm"); } if (!IOSNativeSettings.Instance.EnableSoomla) { ChnageDefineState(ISN_Soomla_Path, "SOOMLA", IOSNativeSettings.Instance.EnableSoomla); PluginsInstalationUtil.RemoveIOSFile("ISN_Soomla"); } else { if (FileStaticAPI.IsFileExists("Plugins/IOS/libSoomlaGrowLite.a")) { ChnageDefineState(ISN_Soomla_Path, "SOOMLA", IOSNativeSettings.Instance.EnableSoomla); FileStaticAPI.CopyFile(PluginsInstalationUtil.IOS_SOURCE_PATH + "ISN_Soomla.mm.txt", PluginsInstalationUtil.IOS_DESTANATION_PATH + "ISN_Soomla.mm"); } else { bool res = EditorUtility.DisplayDialog("Soomla Grow not found", "IOS Native wasn't able to find Soomla Grow libraryes in your project. Would you like to donwload and install it?", "Download", "No Thanks"); if (res) { Application.OpenURL(IOSNativeSettings.Instance.SoomlaDownloadLink); } IOSNativeSettings.Instance.EnableSoomla = false; UpdatePluginSettings(); } } }
public static void UpdatePluginSettings() { if (!IsInstalled || !IsUpToDate) { return; } ChnageDefineState(IOSNotificationController_Path, "PUSH_ENABLED", IOSNativeSettings.Instance.EnablePushNotificationsAPI); ChnageDefineState(DeviceTokenListener_Path, "PUSH_ENABLED", IOSNativeSettings.Instance.EnablePushNotificationsAPI); ChnageDefineState(GameCenterManager_Path, "GAME_CENTER_ENABLED", IOSNativeSettings.Instance.EnableGameCenterAPI); ChnageDefineState(GameCenter_TBM_Path, "GAME_CENTER_ENABLED", IOSNativeSettings.Instance.EnableGameCenterAPI); ChnageDefineState(GameCenter_RTM_Path, "GAME_CENTER_ENABLED", IOSNativeSettings.Instance.EnableGameCenterAPI); ChnageDefineState(IOSNativeMarketBridge_Path, "INAPP_API_ENABLED", IOSNativeSettings.Instance.EnableInAppsAPI); ChnageDefineState(IOSStoreProductView_Path, "INAPP_API_ENABLED", IOSNativeSettings.Instance.EnableInAppsAPI); ChnageDefineState(ISN_Security_Path, "INAPP_API_ENABLED", IOSNativeSettings.Instance.EnableInAppsAPI); ChnageDefineState(iAdBannerControllerr_Path, "IAD_API", IOSNativeSettings.Instance.EnableiAdAPI); ChnageDefineState(iAdBanner_Path, "IAD_API", IOSNativeSettings.Instance.EnableiAdAPI); ChnageDefineState(IOSSocialManager_Path, "SOCIAL_API", IOSNativeSettings.Instance.EnableSocialSharingAPI); ChnageDefineState(IOSCamera_Path, "CAMERA_API", IOSNativeSettings.Instance.EnableCameraAPI); ChnageDefineState(IOSVideoManager_Path, "VIDEO_API", IOSNativeSettings.Instance.EnableMediaPlayerAPI); ChnageDefineState(ISN_MediaController_Path, "VIDEO_API", IOSNativeSettings.Instance.EnableMediaPlayerAPI); ChnageDefineState(ISN_ReplayKit, "REPLAY_KIT", IOSNativeSettings.Instance.EnableReplayKit); if (!IOSNativeSettings.Instance.EnableGameCenterAPI) { PluginsInstalationUtil.RemoveIOSFile("ISN_GameCenter"); } else { FileStaticAPI.CopyFile(PluginsInstalationUtil.IOS_SOURCE_PATH + "ISN_GameCenter.mm.txt", PluginsInstalationUtil.IOS_DESTANATION_PATH + "ISN_GameCenter.mm"); } if (!IOSNativeSettings.Instance.EnableInAppsAPI) { PluginsInstalationUtil.RemoveIOSFile("ISN_InApp"); } else { FileStaticAPI.CopyFile(PluginsInstalationUtil.IOS_SOURCE_PATH + "ISN_InApp.mm.txt", PluginsInstalationUtil.IOS_DESTANATION_PATH + "ISN_InApp.mm"); } if (!IOSNativeSettings.Instance.EnableiAdAPI) { PluginsInstalationUtil.RemoveIOSFile("ISN_iAd"); } else { FileStaticAPI.CopyFile(PluginsInstalationUtil.IOS_SOURCE_PATH + "ISN_iAd.mm.txt", PluginsInstalationUtil.IOS_DESTANATION_PATH + "ISN_iAd.mm"); } if (!IOSNativeSettings.Instance.EnableCameraAPI) { PluginsInstalationUtil.RemoveIOSFile("ISN_Camera"); } else { FileStaticAPI.CopyFile(PluginsInstalationUtil.IOS_SOURCE_PATH + "ISN_Camera.mm.txt", PluginsInstalationUtil.IOS_DESTANATION_PATH + "ISN_Camera.mm"); } if (!IOSNativeSettings.Instance.EnableSocialSharingAPI) { PluginsInstalationUtil.RemoveIOSFile("ISN_SocialGate"); } else { FileStaticAPI.CopyFile(PluginsInstalationUtil.IOS_SOURCE_PATH + "ISN_SocialGate.mm.txt", PluginsInstalationUtil.IOS_DESTANATION_PATH + "ISN_SocialGate.mm"); } if (!IOSNativeSettings.Instance.EnableMediaPlayerAPI) { PluginsInstalationUtil.RemoveIOSFile("ISN_Media"); } else { FileStaticAPI.CopyFile(PluginsInstalationUtil.IOS_SOURCE_PATH + "ISN_Media.mm.txt", PluginsInstalationUtil.IOS_DESTANATION_PATH + "ISN_Media.mm"); } if (!IOSNativeSettings.Instance.EnableReplayKit) { PluginsInstalationUtil.RemoveIOSFile("ISN_ReplayKit"); } else { FileStaticAPI.CopyFile(PluginsInstalationUtil.IOS_SOURCE_PATH + "ISN_ReplayKit.mm.txt", PluginsInstalationUtil.IOS_DESTANATION_PATH + "ISN_ReplayKit.mm"); } }
public static void Android_InstallPlugin(bool IsFirstInstall = true) { FileStaticAPI.CopyAsset(ANDROID_SOURCE_PATH + "libs/android-support-v4.jar", ANDROID_DESTANATION_PATH + "libs/android-support-v4.jar"); FileStaticAPI.CopyAsset(ANDROID_SOURCE_PATH + "libs/android-support-v4.jar", ANDROID_DESTANATION_PATH + "libs/android-support-v4.jar"); FileStaticAPI.CopyAsset(ANDROID_SOURCE_PATH + "libs/google-play-services.jar", ANDROID_DESTANATION_PATH + "libs/google-play-services.jar"); FileStaticAPI.CopyAsset(ANDROID_SOURCE_PATH + "libs/httpclient-4.3.1.jar", ANDROID_DESTANATION_PATH + "libs/httpclient-4.3.1.jar"); FileStaticAPI.CopyAsset(ANDROID_SOURCE_PATH + "libs/libGoogleAnalyticsServices.jar", ANDROID_DESTANATION_PATH + "libs/libGoogleAnalyticsServices.jar"); FileStaticAPI.CopyAsset(ANDROID_SOURCE_PATH + "libs/signpost-commonshttp4-1.2.1.2.jar", ANDROID_DESTANATION_PATH + "libs/signpost-commonshttp4-1.2.1.2.jar"); FileStaticAPI.CopyAsset(ANDROID_SOURCE_PATH + "libs/signpost-core-1.2.1.2.jar", ANDROID_DESTANATION_PATH + "libs/signpost-core-1.2.1.2.jar"); FileStaticAPI.CopyAsset(ANDROID_SOURCE_PATH + "libs/twitter4j-core-3.0.5.jar", ANDROID_DESTANATION_PATH + "libs/twitter4j-core-3.0.5.jar"); FileStaticAPI.CopyAsset(ANDROID_SOURCE_PATH + "libs/image-chooser-library-1.3.0.jar", ANDROID_DESTANATION_PATH + "libs/image-chooser-library-1.3.0.jar"); FileStaticAPI.CopyFolder(ANDROID_SOURCE_PATH + "facebook", ANDROID_DESTANATION_PATH + "facebook"); string file; file = "res/values/" + "analytics.xml"; if (!FileStaticAPI.IsFileExists(ANDROID_DESTANATION_PATH + file)) { FileStaticAPI.CopyAsset(ANDROID_SOURCE_PATH + file, ANDROID_DESTANATION_PATH + file); } file = "res/values/" + "ids.xml"; if (!FileStaticAPI.IsFileExists(ANDROID_DESTANATION_PATH + file)) { FileStaticAPI.CopyAsset(ANDROID_SOURCE_PATH + file, ANDROID_DESTANATION_PATH + file); } file = "res/values/" + "version.xml"; FileStaticAPI.CopyFile(ANDROID_SOURCE_PATH + file, ANDROID_DESTANATION_PATH + file); file = "androidnative.jar"; FileStaticAPI.CopyAsset(ANDROID_SOURCE_PATH + file, ANDROID_DESTANATION_PATH + file); //First install dependense file = "AndroidManifest.xml"; if (!FileStaticAPI.IsFileExists(ANDROID_DESTANATION_PATH + file)) { FileStaticAPI.CopyAsset(ANDROID_SOURCE_PATH + file, ANDROID_DESTANATION_PATH + file); } else { if (IsFirstInstall) { int options = EditorUtility.DisplayDialogComplex( "AndroidManifest.xml detected", "Looks like you already have AndroidManifest.xml in your project, probably it's part of another android plugin. AndroidManifest.xml is reuired for Androud Native plugin. You can merge or replace Manifest, please choose from options bellow.", "Replace", "Learn more", "Do nothing"); switch (options) { case 0: FileStaticAPI.CopyFile(ANDROID_SOURCE_PATH + file, ANDROID_DESTANATION_PATH + file); break; case 1: Application.OpenURL("http://goo.gl/UX30B3"); break; } } } AssetDatabase.Refresh(); }
public static void UpdateGoogleAdIOSAPI(bool forseDisable = false) { bool IsEnabled = false; if (!forseDisable) { if (UltimateMobileSettings.Instance.IOSAdEdngine == UM_IOSAdEngineOprions.GoogleMobileAd) { IsEnabled = true; } } string IOSADBannerContent = FileStaticAPI.Read("Extensions/GoogleMobileAd/Scripts/IOS/IOSADBanner.cs"); string IOSAdMobControllerContent = FileStaticAPI.Read("Extensions/GoogleMobileAd/Scripts/IOS/IOSAdMobController.cs"); string GoogleMobileAdPostProcessContent = FileStaticAPI.Read("Extensions/GoogleMobileAd/Scripts/Editor/GoogleMobileAdPostProcess.cs"); if (IsEnabled) { IOSADBannerContent = IOSADBannerContent.Replace("#define CODE_DISABLED", "//#define CODE_DISABLED"); IOSAdMobControllerContent = IOSAdMobControllerContent.Replace("#define CODE_DISABLED", "//#define CODE_DISABLED"); GoogleMobileAdPostProcessContent = GoogleMobileAdPostProcessContent.Replace("#define CODE_DISABLED", "//#define CODE_DISABLED"); } else { IOSADBannerContent = IOSADBannerContent.Replace("//#define CODE_DISABLED", "#define CODE_DISABLED"); IOSAdMobControllerContent = IOSAdMobControllerContent.Replace("//#define CODE_DISABLED", "#define CODE_DISABLED"); GoogleMobileAdPostProcessContent = GoogleMobileAdPostProcessContent.Replace("//#define CODE_DISABLED", "#define CODE_DISABLED"); } FileStaticAPI.Write("Extensions/GoogleMobileAd/Scripts/IOS/IOSADBanner.cs", IOSADBannerContent); FileStaticAPI.Write("Extensions/GoogleMobileAd/Scripts/IOS/IOSAdMobController.cs", IOSAdMobControllerContent); FileStaticAPI.Write("Extensions/GoogleMobileAd/Scripts/Editor/GoogleMobileAdPostProcess.cs", GoogleMobileAdPostProcessContent); FileStaticAPI.DeleteFile(PluginsInstalationUtil.IOS_DESTANATION_PATH + "GoogleMobileAdController.h.txt"); FileStaticAPI.DeleteFile(PluginsInstalationUtil.IOS_DESTANATION_PATH + "GoogleMobileAdController.mm.txt"); FileStaticAPI.DeleteFile(PluginsInstalationUtil.IOS_DESTANATION_PATH + "GoogleMobileAdBanner.h.txt"); FileStaticAPI.DeleteFile(PluginsInstalationUtil.IOS_DESTANATION_PATH + "GoogleMobileAdBanner.mm.txt"); if (IsEnabled) { #if UNITY_3_5 || UNITY_4_0 || UNITY_4_1 || UNITY_4_2 || UNITY_4_3 || UNITY_4_5 || UNITY_4_6 FileStaticAPI.CopyFile(PluginsInstalationUtil.IOS_SOURCE_PATH + "GoogleMobileAdController.h.txt", PluginsInstalationUtil.IOS_DESTANATION_PATH + "GoogleMobileAdController.h"); FileStaticAPI.CopyFile(PluginsInstalationUtil.IOS_SOURCE_PATH + "GoogleMobileAdController.mm.txt", PluginsInstalationUtil.IOS_DESTANATION_PATH + "GoogleMobileAdController.mm"); FileStaticAPI.CopyFile(PluginsInstalationUtil.IOS_SOURCE_PATH + "GoogleMobileAdBanner.h.txt", PluginsInstalationUtil.IOS_DESTANATION_PATH + "GoogleMobileAdBanner.h"); FileStaticAPI.CopyFile(PluginsInstalationUtil.IOS_SOURCE_PATH + "GoogleMobileAdBanner.mm.txt", PluginsInstalationUtil.IOS_DESTANATION_PATH + "GoogleMobileAdBanner.mm"); #else FileStaticAPI.CopyFile(PluginsInstalationUtil.IOS_SOURCE_PATH + "GoogleMobileAdController.h.txt", PluginsInstalationUtil.IOS_SOURCE_PATH + "GoogleMobileAdController.h"); FileStaticAPI.CopyFile(PluginsInstalationUtil.IOS_SOURCE_PATH + "GoogleMobileAdController.mm.txt", PluginsInstalationUtil.IOS_SOURCE_PATH + "GoogleMobileAdController.mm"); FileStaticAPI.CopyFile(PluginsInstalationUtil.IOS_SOURCE_PATH + "GoogleMobileAdBanner.h.txt", PluginsInstalationUtil.IOS_SOURCE_PATH + "GoogleMobileAdBanner.h"); FileStaticAPI.CopyFile(PluginsInstalationUtil.IOS_SOURCE_PATH + "GoogleMobileAdBanner.mm.txt", PluginsInstalationUtil.IOS_SOURCE_PATH + "GoogleMobileAdBanner.mm"); #endif } else { #if UNITY_3_5 || UNITY_4_0 || UNITY_4_1 || UNITY_4_2 || UNITY_4_3 || UNITY_4_5 || UNITY_4_6 FileStaticAPI.DeleteFile(PluginsInstalationUtil.IOS_DESTANATION_PATH + "GoogleMobileAdBanner.h"); FileStaticAPI.DeleteFile(PluginsInstalationUtil.IOS_DESTANATION_PATH + "GoogleMobileAdController.h"); FileStaticAPI.DeleteFile(PluginsInstalationUtil.IOS_DESTANATION_PATH + "GoogleMobileAdBanner.mm"); FileStaticAPI.DeleteFile(PluginsInstalationUtil.IOS_DESTANATION_PATH + "GoogleMobileAdController.mm"); #else FileStaticAPI.DeleteFile(PluginsInstalationUtil.IOS_SOURCE_PATH + "GoogleMobileAdBanner.h"); FileStaticAPI.DeleteFile(PluginsInstalationUtil.IOS_SOURCE_PATH + "GoogleMobileAdController.h"); FileStaticAPI.DeleteFile(PluginsInstalationUtil.IOS_SOURCE_PATH + "GoogleMobileAdBanner.mm"); FileStaticAPI.DeleteFile(PluginsInstalationUtil.IOS_SOURCE_PATH + "GoogleMobileAdController.mm"); #endif } /* * if(IsEnabled) { * Debug.Log("Google Ad for IOS is enabled"); * } else { * Debug.Log("Google Ad for IOS is disabled"); * } */ }
private void Actions() { EditorGUILayout.Space(); AndroidNativeSettings.Instance.ShowActions = EditorGUILayout.Foldout(AndroidNativeSettings.Instance.ShowActions, "More Actions"); if (AndroidNativeSettings.Instance.ShowActions) { if (!FileStaticAPI.IsFolderExists("Facebook")) { GUI.enabled = false; } EditorGUILayout.BeginHorizontal(); EditorGUILayout.Space(); if (GUILayout.Button("Remove Facebook SDK", GUILayout.Width(160))) { bool result = EditorUtility.DisplayDialog( "Removing Facebook SDK", "Warning action can not be undone without reimporting the plugin", "Remove", "Cansel"); if (result) { FileStaticAPI.DeleteFolder(PluginsInstalationUtil.ANDROID_DESTANATION_PATH + "facebook"); FileStaticAPI.DeleteFolder("Facebook"); FileStaticAPI.DeleteFolder("Extensions/GooglePlayCommon/Social/Facebook"); FileStaticAPI.DeleteFile("Extensions/AndroidNative/xExample/Scripts/Social/FacebookAndroidUseExample.cs"); FileStaticAPI.DeleteFile("Extensions/AndroidNative/xExample/Scripts/Social/FacebookAnalyticsExample.cs"); } } GUI.enabled = true; EditorGUILayout.EndHorizontal(); EditorGUILayout.Space(); EditorGUILayout.BeginHorizontal(); EditorGUILayout.Space(); if (GUILayout.Button("Reset Settings", GUILayout.Width(160))) { SocialPlatfromSettingsEditor.ResetSettings(); FileStaticAPI.DeleteFile("Extensions/AndroidNative/Resources/AndroidNativeSettings.asset"); AndroidNativeSettings.Instance.ShowActions = true; Selection.activeObject = AndroidNativeSettings.Instance; return; } if (GUILayout.Button("Load Example Settings", GUILayout.Width(160))) { SocialPlatfromSettingsEditor.LoadExampleSettings(); FileStaticAPI.DeleteFile("Extensions/AndroidNative/Resources/AndroidNativeSettings.asset"); FileStaticAPI.CopyFile("Extensions/AndroidNative/Resources/AndroidNativeSettings_example.asset", "Extensions/AndroidNative/Resources/AndroidNativeSettings.asset"); } EditorGUILayout.EndHorizontal(); } }