protected override void ModifyAndroidManifests(string basePath)
        {
            var appManifestPath = Path.Combine(basePath, "src", "main", "AndroidManifest.xml");

            Debug.Log(string.Format(Constants.LogFormat, $"Writing Skillz specific data to '{appManifestPath}'"));

            var manifest = new AndroidManifest(appManifestPath);

            manifest.SetSupportsScreens(small: true, normal: true, large: true, xLarge: true, anyDensity: true);
            manifest.SetApplicationTheme("@android:style/Theme.NoTitleBar.Fullscreen");
            manifest.SetStartingActivityName(SkillzActivityName);
            manifest.SetLaunchMode("singleTop");
            manifest.SetClearTaskOnLaunch("false");
            manifest.SetAlwaysRetainTaskState("true");

            manifest.AddMetadataElement("skillz_allow_exit", SkillzSettings.Instance.AllowSkillzExit.ToString().ToLowerInvariant());
            manifest.AddMetadataElement("skillz_game_id", SkillzSettings.Instance.GameID.ToString());
            manifest.AddMetadataElement("skillz_production", (SkillzSettings.Instance.Environment == Environment.Production).ToString().ToLowerInvariant());
            manifest.AddMetadataElement("skillz_game_activity", SkillzActivityName);
            manifest.AddMetadataElement("skillz_orientation", SkillzSettings.Instance.Orientation.ToString().ToLowerInvariant());
            manifest.AddMetadataElement("skillz_is_unity", "true");

            manifest.AddUsesFeature("glEsVersion", "0x00020000");

            // See: https://developer.android.com/about/versions/pie/android-9.0-changes-28#apache-p
            manifest.AddUsesLibrary("org.apache.http.legacy", false);

            manifest.Save();
        }
예제 #2
0
        private void ModifyUnityLibraryManifest(string manifestPath)
        {
            Debug.Log(string.Format(Constants.LogFormat, $"Writing Skillz specific data to '{manifestPath}'"));

            const string skillzActivityName = "com.skillz.activity.UnityGameActivity";

            var manifest = new AndroidManifest(manifestPath);

            manifest.SetStartingActivityName(skillzActivityName);
            manifest.SetLaunchMode("singleTop");
            manifest.SetClearTaskOnLaunch("false");
            manifest.SetAlwaysRetainTaskState("true");

            manifest.AddMetadataElement("skillz_allow_exit", SkillzSettings.Instance.AllowSkillzExit.ToString().ToLowerInvariant());
            manifest.AddMetadataElement("skillz_game_id", SkillzSettings.Instance.GameID.ToString());
            manifest.AddMetadataElement("skillz_production", (SkillzSettings.Instance.Environment == Environment.Production).ToString().ToLowerInvariant());
            manifest.AddMetadataElement("skillz_game_activity", skillzActivityName);
            manifest.AddMetadataElement("skillz_orientation", SkillzSettings.Instance.Orientation.ToString().ToLowerInvariant());
            manifest.AddMetadataElement("skillz_is_unity", "true");

            manifest.AddUsesFeature("glEsVersion", "0x00020000");

            manifest.Save();
        }