コード例 #1
0
        /// <summary>
        /// Performs setup using the Android resources downloaded XML file
        /// from the play console.
        /// </summary>
        /// <returns><c>true</c>, if setup was performed, <c>false</c> otherwise.</returns>
        /// <param name="clientId">The web client id.</param>
        /// <param name="classDirectory">the directory to write the constants file to.</param>
        /// <param name="className">Fully qualified class name for the resource Ids.</param>
        /// <param name="resourceXmlData">Resource xml data.</param>
        /// <param name="nearbySvcId">Nearby svc identifier.</param>
        /// <param name="requiresGooglePlus">Indicates this app requires G+</param>
        public static bool PerformSetup(
            string clientId,
            string classDirectory,
            string className,
            string resourceXmlData,
            string nearbySvcId)
        {
            if (string.IsNullOrEmpty(resourceXmlData) &&
                !string.IsNullOrEmpty(nearbySvcId))
            {
                return(PerformSetup(
                           clientId,
                           GPGSProjectSettings.Instance.Get(GPGSUtil.APPIDKEY),
                           nearbySvcId));
            }

            if (ParseResources(classDirectory, className, resourceXmlData))
            {
                GPGSProjectSettings.Instance.Set(GPGSUtil.CLASSDIRECTORYKEY, classDirectory);
                GPGSProjectSettings.Instance.Set(GPGSUtil.CLASSNAMEKEY, className);
                GPGSProjectSettings.Instance.Set(GPGSUtil.ANDROIDRESOURCEKEY, resourceXmlData);

                // check the bundle id and set it if needed.
                CheckBundleId();


                Google.VersionHandler.VerboseLoggingEnabled = true;
                Google.VersionHandler.UpdateVersionedAssets(forceUpdate: true);
                Google.VersionHandler.Enabled = true;
                AssetDatabase.Refresh();

                GPGSDependencies.RegisterDependencies();

                Google.VersionHandler.InvokeStaticMethod(
                    Google.VersionHandler.FindClass(
                        "Google.JarResolver",
                        "GooglePlayServices.PlayServicesResolver"),
                    "MenuResolve", null);

                return(PerformSetup(
                           clientId,
                           GPGSProjectSettings.Instance.Get(GPGSUtil.APPIDKEY),
                           nearbySvcId));
            }

            return(false);
        }
コード例 #2
0
        /// <summary>
        /// Performs setup using the Android resources downloaded XML file
        /// from the play console.
        /// </summary>
        /// <returns><c>true</c>, if setup was performed, <c>false</c> otherwise.</returns>
        /// <param name="clientId">The web client id.</param>
        /// <param name="classDirectory">the directory to write the constants file to.</param>
        /// <param name="className">Fully qualified class name for the resource Ids.</param>
        /// <param name="resourceXmlData">Resource xml data.</param>
        /// <param name="nearbySvcId">Nearby svc identifier.</param>
        /// <param name="requiresGooglePlus">Indicates this app requires G+</param>
        public static bool PerformSetup(
            string clientId,
            string classDirectory,
            string className,
            string resourceXmlData,
            string nearbySvcId,
            bool requiresGooglePlus)
        {
            if (string.IsNullOrEmpty(resourceXmlData) &&
                !string.IsNullOrEmpty(nearbySvcId))
            {
                return(PerformSetup(
                           clientId,
                           GPGSProjectSettings.Instance.Get(GPGSUtil.APPIDKEY),
                           nearbySvcId,
                           requiresGooglePlus));
            }

            if (ParseResources(classDirectory, className, resourceXmlData))
            {
                GPGSProjectSettings.Instance.Set(GPGSUtil.CLASSDIRECTORYKEY, classDirectory);
                GPGSProjectSettings.Instance.Set(GPGSUtil.CLASSNAMEKEY, className);
                GPGSProjectSettings.Instance.Set(GPGSUtil.ANDROIDRESOURCEKEY, resourceXmlData);

                // check the bundle id and set it if needed.
                CheckBundleId();

                GPGSDependencies.svcSupport.ClearDependencies();
                GPGSDependencies.RegisterDependencies();

                PlayServicesResolver.Resolver.DoResolution(
                    GPGSDependencies.svcSupport,
                    "Assets/Plugins/Android",
                    PlayServicesResolver.HandleOverwriteConfirmation);

                return(PerformSetup(
                           clientId,
                           GPGSProjectSettings.Instance.Get(GPGSUtil.APPIDKEY),
                           nearbySvcId,
                           requiresGooglePlus));
            }

            return(false);
        }
コード例 #3
0
        /// <summary>
        /// Performs setup using the Android resources downloaded XML file
        /// from the play console.
        /// </summary>
        /// <returns><c>true</c>, if setup was performed, <c>false</c> otherwise.</returns>
        /// <param name="clientId">The web client id.</param>
        /// <param name="classDirectory">the directory to write the constants file to.</param>
        /// <param name="className">Fully qualified class name for the resource Ids.</param>
        /// <param name="resourceXmlData">Resource xml data.</param>
        /// <param name="nearbySvcId">Nearby svc identifier.</param>
        /// <param name="requiresGooglePlus">Indicates this app requires G+</param>
        public static bool PerformSetup(
            string clientId,
            string classDirectory,
            string className,
            string resourceXmlData,
            string nearbySvcId,
            bool requiresGooglePlus)
        {
            if (string.IsNullOrEmpty(resourceXmlData) &&
                !string.IsNullOrEmpty(nearbySvcId))
            {
                return(PerformSetup(
                           clientId,
                           GPGSProjectSettings.Instance.Get(GPGSUtil.APPIDKEY),
                           nearbySvcId,
                           requiresGooglePlus));
            }

            if (ParseResources(classDirectory, className, resourceXmlData))
            {
                GPGSProjectSettings.Instance.Set(GPGSUtil.CLASSDIRECTORYKEY, classDirectory);
                GPGSProjectSettings.Instance.Set(GPGSUtil.CLASSNAMEKEY, className);
                GPGSProjectSettings.Instance.Set(GPGSUtil.ANDROIDRESOURCEKEY, resourceXmlData);

                // check the bundle id and set it if needed.
                CheckBundleId();

                Google.VersionHandler.InvokeInstanceMethod(
                    GPGSDependencies.svcSupport, "ClearDependencies", null);
                GPGSDependencies.RegisterDependencies();
                Google.VersionHandler.InvokeStaticMethod(
                    Google.VersionHandler.FindClass(
                        "Google.JarResolver", "GooglePlayServices.PlayServicesResolver"),
                    "MenuResolve", null);

                return(PerformSetup(
                           clientId,
                           GPGSProjectSettings.Instance.Get(GPGSUtil.APPIDKEY),
                           nearbySvcId,
                           requiresGooglePlus));
            }

            return(false);
        }
コード例 #4
0
        /// Provide static access to setup for facilitating automated builds.
        /// <param name="nearbyServiceId">The nearby connections service Id</param>
        /// <param name="androidBuild">true if building android</param>
        public static bool PerformSetup(string nearbyServiceId, bool androidBuild)
        {
            // check for valid app id
            if (!GPGSUtil.LooksLikeValidServiceId(nearbyServiceId))
            {
                GPGSUtil.Alert(GPGSStrings.Setup.ServiceIdError);
                return(false);
            }

            GPGSProjectSettings.Instance.Set(GPGSUtil.SERVICEIDKEY, nearbyServiceId);
            GPGSProjectSettings.Instance.Save();

            if (androidBuild)
            {
                // create needed directories
                GPGSUtil.EnsureDirExists("Assets/Plugins");
                GPGSUtil.EnsureDirExists("Assets/Plugins/Android");

                // Generate AndroidManifest.xml
                GPGSUtil.GenerateAndroidManifest();

                GPGSProjectSettings.Instance.Set(GPGSUtil.NEARBYSETUPDONEKEY, true);
                GPGSProjectSettings.Instance.Save();

                // Resolve the dependencies
                Google.VersionHandler.VerboseLoggingEnabled = true;
                Google.VersionHandler.UpdateVersionedAssets(forceUpdate: true);
                Google.VersionHandler.Enabled = true;
                AssetDatabase.Refresh();

                GPGSDependencies.RegisterDependencies();

                Google.VersionHandler.InvokeStaticMethod(
                    Google.VersionHandler.FindClass(
                        "Google.JarResolver",
                        "GooglePlayServices.PlayServicesResolver"),
                    "MenuResolve", null);
            }
            return(true);
        }