예제 #1
0
    public static void BuildMiInstallPackage(bool fullPackage = true)
    {
        SetLauncherIconSetting(new string[] {
            "Assets/SDKIcon/gfan/ic_launcher144.png",
            "Assets/SDKIcon/gfan/ic_launcher72.png",
            "Assets/SDKIcon/gfan/ic_launcher48.png",
            "Assets/SDKIcon/gfan/ic_launcher48.png",
        });

        string platform = PlatformMi;
        string suffix   = GetBundleIdentifierSplitChar() + platform;

        RecordChannel2Resouces(platform);
        CleanupBundleIdentifier();
        PlayerSettings.applicationIdentifier += suffix;
#if UNITY_ANDROID
        ModifyManifestPackageName(BuildAndroid.ManifestEntryPackageName + suffix);
        if (fullPackage)
        {
            // tzz added for preprocessing for build full apk
            // change AndroidMenifest file and copy the base jar file to right folder
            BuildAndroid.PreProcessToBuildFullApk();
            BuildAndroidPackage(platform);
        }
        else
        {
            BuildAndroid.BuildSplitGame(BuildAndroid.GetCombineApkName(platform));
        }
#elif UNITY_IPHONE
#endif
    }
예제 #2
0
    public static string BuildGfanInstallPackage(bool fullPackage = true, string subChannel = "")
    {
        SetLauncherIconSetting(new string[] {
#if UNITY_ANDROID
            "Assets/SDKIcon/gfan/ic_launcher144.png",
            "Assets/SDKIcon/gfan/ic_launcher72.png",
            "Assets/SDKIcon/gfan/ic_launcher48.png",
            "Assets/SDKIcon/gfan/ic_launcher48.png",
#elif UNITY_IPHONE
            "Assets/SDKIcon/gfan/ic_launcher57.png",
            "Assets/SDKIcon/gfan/ic_launcher114.png",
            "Assets/SDKIcon/gfan/ic_launcher72.png",
            "Assets/SDKIcon/gfan/ic_launcher144.png",
#endif
        });
        string path = "";

        string platform = PlatformGfan;
        string suffix   = GetBundleIdentifierSplitChar() + platform;

        RecordChannel2Resouces(platform + subChannel);
        CleanupBundleIdentifier();
        // PlayerSettings.bundleIdentifier += suffix;
#if UNITY_ANDROID
        // modify the manifest.xml file
        ModifyManifestPackageName(BuildAndroid.ManifestEntryPackageName);
        if (fullPackage)
        {
            // tzz added for preprocessing for build full apk
            // change AndroidMenifest file and copy the base jar file to right folder
            BuildAndroid.PreProcessToBuildFullApk();
            path = BuildAndroidPackage(platform);
        }
        else
        {
            BuildAndroid.BuildSplitGame(BuildAndroid.GetCombineApkName(platform));
        }
#elif UNITY_IPHONE
        BuildXcodeProject("GfanSDK");
#endif
        return(path);
    }
예제 #3
0
    static void BuildWPayInstallPackage(string subChannnelID, bool fullPackage = true)
    {
        SetLauncherIconSetting(new string[] {
#if UNITY_ANDROID
            "Assets/SDKIcon/wpay/ic_launcher144.png",
            "Assets/SDKIcon/wpay/ic_launcher72.png",
            "Assets/SDKIcon/wpay/ic_launcher48.png",
            "Assets/SDKIcon/wpay/ic_launcher48.png",
#elif UNITY_IPHONE
            "Assets/SDKIcon/91/ic_launcher57.png",
            "Assets/SDKIcon/91/ic_launcher114.png",
            "Assets/SDKIcon/91/ic_launcher72.png",
            "Assets/SDKIcon/91/ic_launcher144.png",
#endif
        });

        string platform = PlatformWPay;
        string suffix   = GetBundleIdentifierSplitChar() + platform;

        RecordChannel2Resouces(platform);
        RecordSubChannel2Resouces(subChannnelID);
        CleanupBundleIdentifier();
        PlayerSettings.applicationIdentifier += suffix;
#if UNITY_ANDROID
        ModifyManifestPackageName(BuildAndroid.ManifestEntryPackageName + suffix);
        if (fullPackage)
        {
            // tzz added for preprocessing for build full apk
            // change AndroidMenifest file and copy the base jar file to right folder
            BuildAndroid.PreProcessToBuildFullApk();
            BuildAndroidPackage(platform, subChannnelID);
        }
        else
        {
            BuildAndroid.BuildSplitGame(BuildAndroid.GetCombineApkName(platform));
        }
#elif UNITY_IPHONE
        BuildXcodeProject("ND91SDK");
#endif
    }
예제 #4
0
    static string BuildAndroidPackage(string channelId, string subChannelId = "", string postfix = ".apk")
    {
        BuildAndroid.PreProcessDigitalSignature();
        //@{{ CAUTION!!
        //
        // delete the other SDK alipay_msp.jar to avoid conflict with the one in gfansdk_pay.jar
        //
        string alipayFile;
        string backupAlipay;

        if (channelId.StartsWith(PlatformGfan))
        {
            alipayFile   = Application.dataPath + "/Plugins/Android/libs/alipay_msp.jar";
            backupAlipay = Application.dataPath + "/alipay_msp.jar";
        }
        else
        {
            alipayFile   = Application.dataPath + "/Plugins/Android/libs/gfansdk_pay.jar";
            backupAlipay = Application.dataPath + "/gfansdk_pay.jar";
        }

        if (File.Exists(alipayFile))
        {
            if (File.Exists(backupAlipay))
            {
                File.Delete(backupAlipay);
            }

            File.Move(alipayFile, backupAlipay);
        }
        else
        {
            throw new System.Exception("Failed!! Please Update SVN to restore : " + alipayFile);
        }
        //@}}


        // Prepare all levels
        List <string>            levels = new List <string>();
        EditorBuildSettingsScene scene  = null;

        for (int i = 0; i < EditorBuildSettings.scenes.Length; i++)
        {
            scene = EditorBuildSettings.scenes[i];
            if (scene.enabled)
            {
                levels.Add(scene.path);
            }
        }

        string path = BuildAndroid.GetCombineApkName(channelId, subChannelId, postfix);

        BuildPipeline.BuildPlayer(levels.ToArray(), path, BuildTarget.Android, BuildOptions.None);

        //@{{ CAUTION!!
        //
        // copy back
        //
        if (!File.Exists(alipayFile))
        {
            if (File.Exists(backupAlipay))
            {
                File.Move(backupAlipay, alipayFile);
            }
            else
            {
                throw new System.Exception("Failed!! Please Update SVN to restore : " + alipayFile);
            }
        }
        //@}}

        return(path);
    }