chunk 2: remaining non-audio non-NewImport assets
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ac1bedf82988a4d5c8268ea1c30ff8c0
|
||||
timeCreated: 1581039935
|
||||
licenseType: Pro
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bef99cf86b0874c9c88499eb1630ebf2
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,6 @@
|
||||
<dependencies>
|
||||
<androidPackages>
|
||||
<androidPackage spec="com.google.android.play:core-common:2.0.4"/>
|
||||
</androidPackages>
|
||||
</dependencies>
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 358959da479d4911a369fa0a55db666c
|
||||
timeCreated: 1632173877
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bbf238c6951964b08ae437c67f5c96a8
|
||||
timeCreated: 1583983813
|
||||
licenseType: Pro
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 17ca008958db44a7eac7d11b53d28bb1
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,68 @@
|
||||
# Copyright 2018 Google LLC
|
||||
#
|
||||
# The Google Play Core Library is licensed to you under the Play Core Software
|
||||
# Development Kit Terms of Service
|
||||
# (https://developer.android.com/guide/playcore/license.html).
|
||||
# By using the Google Play Core Library, you agree to the Play Core Software
|
||||
# Development Kit Terms of Service.
|
||||
|
||||
# Play Core Proguard Rules: Play Core Common (always include this config)
|
||||
|
||||
-keep class com.google.android.play.core.common.IntentSenderForResultStarter {
|
||||
public void startIntentSenderForResult(android.content.IntentSender, int, android.content.Intent, int, int, int, android.os.Bundle);
|
||||
}
|
||||
|
||||
-keep class com.google.android.play.core.common.LocalTestingException {
|
||||
}
|
||||
|
||||
-keep class com.google.android.play.core.listener.StateUpdatedListener {
|
||||
public abstract void onStateUpdate(java.lang.Object);
|
||||
}
|
||||
|
||||
-keep @interface android.support.annotation.NonNull
|
||||
-keep @interface android.support.annotation.Nullable
|
||||
|
||||
-keep class com.google.android.gms.tasks.OnCompleteListener {
|
||||
public abstract void onComplete(com.google.android.gms.tasks.Task);
|
||||
}
|
||||
|
||||
-keep class com.google.android.gms.tasks.OnFailureListener {
|
||||
public abstract void onFailure(java.lang.Exception);
|
||||
}
|
||||
|
||||
-keep class com.google.android.gms.tasks.OnSuccessListener {
|
||||
public abstract void onSuccess(java.lang.Object);
|
||||
}
|
||||
|
||||
-keep class com.google.android.gms.tasks.RuntimeExecutionException {
|
||||
}
|
||||
|
||||
-keep class com.google.android.gms.tasks.Task {
|
||||
<init>();
|
||||
|
||||
public com.google.android.gms.tasks.Task addOnCompleteListener(com.google.android.gms.tasks.OnCompleteListener);
|
||||
public com.google.android.gms.tasks.Task addOnCompleteListener(java.util.concurrent.Executor, com.google.android.gms.tasks.OnCompleteListener);
|
||||
public abstract com.google.android.gms.tasks.Task addOnFailureListener(com.google.android.gms.tasks.OnFailureListener);
|
||||
public abstract com.google.android.gms.tasks.Task addOnFailureListener(java.util.concurrent.Executor, com.google.android.gms.tasks.OnFailureListener);
|
||||
public abstract com.google.android.gms.tasks.Task addOnSuccessListener(com.google.android.gms.tasks.OnSuccessListener);
|
||||
public abstract com.google.android.gms.tasks.Task addOnSuccessListener(java.util.concurrent.Executor, com.google.android.gms.tasks.OnSuccessListener);
|
||||
public abstract java.lang.Exception getException();
|
||||
public abstract java.lang.Object getResult();
|
||||
public abstract java.lang.Object getResult(java.lang.Class);
|
||||
public abstract boolean isComplete();
|
||||
public abstract boolean isSuccessful();
|
||||
}
|
||||
|
||||
-keep class com.google.android.gms.tasks.TaskExecutors {
|
||||
public static java.util.concurrent.Executor MAIN_THREAD;
|
||||
}
|
||||
|
||||
-keep class com.google.android.gms.tasks.Tasks {
|
||||
public static java.lang.Object await(com.google.android.gms.tasks.Task);
|
||||
public static java.lang.Object await(com.google.android.gms.tasks.Task, long, java.util.concurrent.TimeUnit);
|
||||
public static com.google.android.gms.tasks.Task whenAll(java.util.Collection);
|
||||
}
|
||||
|
||||
-keep class com.google.android.gms.common.api.ApiException {
|
||||
public int getStatusCode();
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5c3c6f4e6fa6a485eae510a4a8382eae
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e875a0fb3431642b8a2dae76bdd988fa
|
||||
timeCreated: 1581040462
|
||||
licenseType: Pro
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 76119807e4889426ea2830d82c74eb2d
|
||||
folderAsset: yes
|
||||
timeCreated: 1576618908
|
||||
licenseType: Pro
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"name": "Google.Play.Core",
|
||||
"references": [],
|
||||
"includePlatforms": [
|
||||
"Android",
|
||||
"Editor"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b649415412a3d4e8a83df256b07478bb
|
||||
AssemblyDefinitionImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5ce086e6077594a2293b3717d002b800
|
||||
folderAsset: yes
|
||||
timeCreated: 1580835047
|
||||
licenseType: Pro
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 84d31a25d624346459133b65425fd20b
|
||||
folderAsset: yes
|
||||
timeCreated: 1580835047
|
||||
licenseType: Pro
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,39 @@
|
||||
// Copyright 2019 Google LLC
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// https://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
namespace Google.Play.Core.Internal
|
||||
{
|
||||
/// <summary>
|
||||
/// Mirror of a subset of Activity constants of
|
||||
/// <a href="https://developer.android.com/reference/android/app/Activity.html#constants_2"></a> and
|
||||
/// <a href="https://developer.android.com/reference/com/google/android/play/core/install/model/ActivityResult"></a>.
|
||||
/// </summary>
|
||||
public static class ActivityResult
|
||||
{
|
||||
/// <summary>
|
||||
/// Operation succeeded.
|
||||
/// </summary>
|
||||
public const int ResultOk = -1;
|
||||
|
||||
/// <summary>
|
||||
/// Operation cancelled.
|
||||
/// </summary>
|
||||
public const int ResultCancelled = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Operation for In-app update failed.
|
||||
/// </summary>
|
||||
public const int ResultFailed = 1;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8879ad8a300b4bde86c4f579dfede0d2
|
||||
timeCreated: 1566858727
|
||||
@@ -0,0 +1,28 @@
|
||||
// Copyright 2019 Google LLC
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// https://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
namespace Google.Play.Core.Internal
|
||||
{
|
||||
/// <summary>
|
||||
/// A collection of constants used for interfacing with the Play Core library.
|
||||
/// </summary>
|
||||
public static class PlayCoreConstants
|
||||
{
|
||||
public const string PlayCorePackagePrefix = "com.google.android.play.core.";
|
||||
public const string GmsCorePackagePrefix = "com.google.android.gms.";
|
||||
public const string AssetPackPackagePrefix = PlayCorePackagePrefix + "assetpacks.";
|
||||
public const string IntegrityPackagePrefix = PlayCorePackagePrefix + "integrity.";
|
||||
public const int InternalErrorCode = -100;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5e622666acb2d4781a7584f92b9a2b2e
|
||||
timeCreated: 1549654052
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,98 @@
|
||||
// Copyright 2019 Google LLC
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// https://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Google.Play.Core.Internal
|
||||
{
|
||||
/// <summary>
|
||||
/// Callbacks from Play Core can come from multiple threads.
|
||||
/// This class provides methods to forward those to Unity's main thread, where Unity APIs can be called.
|
||||
/// </summary>
|
||||
public class PlayCoreEventHandler : MonoBehaviour
|
||||
{
|
||||
private static PlayCoreEventHandler _instance;
|
||||
|
||||
// This must be called from Main thread.
|
||||
public static void CreateInScene()
|
||||
{
|
||||
var obj = new GameObject {name = "PlayCoreEventHandler"};
|
||||
DontDestroyOnLoad(obj);
|
||||
obj.AddComponent<PlayCoreEventHandler>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Schedules an action to invoke on Unity's main thread.
|
||||
/// </summary>
|
||||
/// <exception cref="InvalidOperationException">
|
||||
/// If there is no instance of PlayCoreEventHandler present in the scene, either because CreateInScene() was
|
||||
/// never called or because the instance was somehow destroyed.
|
||||
/// </exception>
|
||||
public static void HandleEvent(Action action)
|
||||
{
|
||||
if (_instance == null)
|
||||
{
|
||||
throw new InvalidOperationException("An instance of PlayCoreEventHandler is not present in the scene.");
|
||||
}
|
||||
|
||||
_instance.HandleEventInternal(action);
|
||||
}
|
||||
|
||||
// Queue accessed by multiple threads.
|
||||
// Note: ConcurrentQueue isn't available in .NET 3.5.
|
||||
private readonly Queue<Action> _sharedEventQueue = new Queue<Action>();
|
||||
|
||||
// Queue that is only accessed on the main thread.
|
||||
private readonly Queue<Action> _localEventQueue = new Queue<Action>();
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
if (_instance != null)
|
||||
{
|
||||
Destroy(this);
|
||||
return;
|
||||
}
|
||||
|
||||
_instance = this;
|
||||
}
|
||||
|
||||
private void HandleEventInternal(Action action)
|
||||
{
|
||||
lock (_sharedEventQueue)
|
||||
{
|
||||
_sharedEventQueue.Enqueue(action);
|
||||
}
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
lock (_sharedEventQueue)
|
||||
{
|
||||
while (_sharedEventQueue.Count > 0)
|
||||
{
|
||||
var action = _sharedEventQueue.Dequeue();
|
||||
_localEventQueue.Enqueue(action);
|
||||
}
|
||||
}
|
||||
|
||||
// Invoke events outside of the lock because they may take an indeterminate amount of time.
|
||||
while (_localEventQueue.Count > 0)
|
||||
{
|
||||
_localEventQueue.Dequeue().Invoke();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 051d5ab221b254fb3bb403a4eaae0df9
|
||||
timeCreated: 1555349623
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,96 @@
|
||||
// Copyright 2019 Google LLC
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// https://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Google.Play.Core.Internal
|
||||
{
|
||||
/// <summary>
|
||||
/// A collection of helper methods for interfacing with the Play Core library.
|
||||
/// </summary>
|
||||
public static class PlayCoreHelper
|
||||
{
|
||||
/// <summary>
|
||||
/// Converts the specified AndroidJavaObject representing a "java.util.List" into a C# List.
|
||||
/// </summary>
|
||||
/// <typeparam name="TAndroidJava">
|
||||
/// The type of the objects in the returned list.
|
||||
/// Must be a primitive type or an AndroidJavaObject.
|
||||
/// </typeparam>
|
||||
/// <returns>A List with the contents of the provided Java list</returns>
|
||||
public static List<TAndroidJava> ConvertJavaList<TAndroidJava>(AndroidJavaObject javaList)
|
||||
{
|
||||
var count = javaList.Call<int>("size");
|
||||
|
||||
var results = new List<TAndroidJava>();
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
results.Add(javaList.Call<TAndroidJava>("get", i));
|
||||
}
|
||||
|
||||
return results;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts the specified AndroidJavaObject representing a "java.util.Map" into a C# Dictionary.
|
||||
/// </summary>
|
||||
/// <typeparam name="TAndroidJavaKey">
|
||||
/// The type of the keys in the returned dictionary.
|
||||
/// Must be a primitive type or an AndroidJavaObject.
|
||||
/// </typeparam>
|
||||
/// <typeparam name="TAndroidJavaValue">
|
||||
/// The type of the values in the returned dictionary.
|
||||
/// Must be a primitive type or an AndroidJavaObject.
|
||||
/// </typeparam>
|
||||
/// <returns>A Dictionary with the contents of the provided Java map</returns>
|
||||
public static Dictionary<TAndroidJavaKey, TAndroidJavaValue> ConvertJavaMap<TAndroidJavaKey, TAndroidJavaValue>(
|
||||
AndroidJavaObject javaMap)
|
||||
{
|
||||
using (var entrySet = javaMap.Call<AndroidJavaObject>("entrySet"))
|
||||
using (var entrySetIterator = entrySet.Call<AndroidJavaObject>("iterator"))
|
||||
{
|
||||
var results = new Dictionary<TAndroidJavaKey, TAndroidJavaValue>();
|
||||
while (entrySetIterator.Call<bool>("hasNext"))
|
||||
{
|
||||
using (var entry = entrySetIterator.Call<AndroidJavaObject>("next"))
|
||||
{
|
||||
var key = entry.Call<TAndroidJavaKey>("getKey");
|
||||
var value = entry.Call<TAndroidJavaValue>("getValue");
|
||||
results.Add(key, value);
|
||||
}
|
||||
}
|
||||
|
||||
return results;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts the specified AndroidJavaObject representing a "java.lang.String" into a C# string.
|
||||
/// </summary>
|
||||
public static string ConvertJavaString(AndroidJavaObject javaString)
|
||||
{
|
||||
return IsNull(javaString) ? null : javaString.Call<string>("toString");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if the specified <see cref="AndroidJavaObject"/> is null or if the underlying Java object is
|
||||
/// null, false otherwise.
|
||||
/// </summary>
|
||||
public static bool IsNull(AndroidJavaObject javaObject)
|
||||
{
|
||||
return javaObject == null || javaObject.GetRawObject().ToInt32() == 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: eeadf4c79cb514f2c9b8a924b97d4b60
|
||||
timeCreated: 1550793799
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,51 @@
|
||||
// Copyright 2019 Google LLC
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// https://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Google.Play.Core.Internal
|
||||
{
|
||||
/// <summary>
|
||||
/// Proxy for Play Core's OnFailureListener class.
|
||||
/// Allows C# classes to be alerted when a Play Core Task throws an exception.
|
||||
/// </summary>
|
||||
public class PlayCoreOnFailureListener : AndroidJavaProxy
|
||||
{
|
||||
public event Action<string, int> OnTaskFailed = delegate { };
|
||||
|
||||
public PlayCoreOnFailureListener() : base(PlayCoreConstants.PlayCorePackagePrefix + "tasks.OnFailureListener")
|
||||
{
|
||||
}
|
||||
|
||||
// Proxied java calls. Method names are camelCase to match the corresponding java methods.
|
||||
public void onFailure(AndroidJavaObject exception)
|
||||
{
|
||||
var message = exception.Call<string>("getMessage");
|
||||
|
||||
int errorCode;
|
||||
try
|
||||
{
|
||||
// If exception is not a TaskException, this call will throw an AndroidJavaException.
|
||||
errorCode = exception.Call<int>("getErrorCode");
|
||||
}
|
||||
catch (AndroidJavaException)
|
||||
{
|
||||
errorCode = PlayCoreConstants.InternalErrorCode;
|
||||
}
|
||||
|
||||
PlayCoreEventHandler.HandleEvent(() => OnTaskFailed.Invoke(message, errorCode));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 637ec35fe288545c4b13d394a08a0c70
|
||||
timeCreated: 1549660839
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,45 @@
|
||||
// Copyright 2019 Google LLC
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// https://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Google.Play.Core.Internal
|
||||
{
|
||||
/// <summary>
|
||||
/// Proxy for Play Core's OnSuccessListener class.
|
||||
/// Allows C# classes to be alerted when a Play Core Task succeeds, and to get the result of that Task.
|
||||
/// </summary>
|
||||
/// <typeparam name="TAndroidJava">
|
||||
/// The return type of the proxied Play Core Task.
|
||||
/// Must be a primitive type (e.g. bool, int, or float) or an AndroidJavaObject.
|
||||
/// </typeparam>
|
||||
public class PlayCoreOnSuccessListener<TAndroidJava> : AndroidJavaProxy
|
||||
{
|
||||
/// <summary>
|
||||
/// Triggers when the associated Play Core Task succeeds.
|
||||
/// </summary>
|
||||
public event Action<TAndroidJava> OnTaskSucceeded = delegate { };
|
||||
|
||||
public PlayCoreOnSuccessListener() : base(PlayCoreConstants.PlayCorePackagePrefix + "tasks.OnSuccessListener")
|
||||
{
|
||||
}
|
||||
|
||||
// Proxied java calls. Method names are camelCase to match the corresponding java methods.
|
||||
public void onSuccess(TAndroidJava result)
|
||||
{
|
||||
PlayCoreEventHandler.HandleEvent(() => OnTaskSucceeded.Invoke(result));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fef4772d6fe7446e9a4dcfabf3ea9e74
|
||||
timeCreated: 1549660825
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,85 @@
|
||||
// Copyright 2019 Google LLC
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// https://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Google.Play.Core.Internal
|
||||
{
|
||||
/// <summary>
|
||||
/// Wraps Play Services Task which represent asynchronous operations.
|
||||
/// Allows C# classes to register callbacks for when a task succeeds or fails.
|
||||
/// </summary>
|
||||
/// <typeparam name="TAndroidJava">
|
||||
/// The type of the object that the underlying Play Services Task will provide, once it completes.
|
||||
/// Must be a primitive type (e.g. bool, int, or float) or an AndroidJavaObject.
|
||||
/// </typeparam>
|
||||
public class PlayServicesTask<TAndroidJava> : IDisposable
|
||||
{
|
||||
private readonly AndroidJavaObject _javaTask;
|
||||
|
||||
public PlayServicesTask(AndroidJavaObject javaTask)
|
||||
{
|
||||
if (javaTask == null)
|
||||
{
|
||||
throw new ArgumentNullException("javaTask must not be null.");
|
||||
}
|
||||
|
||||
_javaTask = javaTask;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Register a callback that will fire when the underlying Play Services Task succeeds.
|
||||
/// </summary>
|
||||
/// <param name="onSuccess">
|
||||
/// The action that will be invoked with the result of the underlying Play Services Task.
|
||||
/// </param>
|
||||
public void RegisterOnSuccessCallback(Action<TAndroidJava> onSuccess)
|
||||
{
|
||||
var listenerProxy = new TaskOnSuccessListener<TAndroidJava>();
|
||||
listenerProxy.OnTaskSucceeded += onSuccess;
|
||||
AddOnSuccessListener(listenerProxy);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Register a callback that will fire when the underlying Play Services Task fails.
|
||||
/// </summary>
|
||||
/// <param name="onFailure">
|
||||
/// The action that will be invoked when the underlying Play Services Task fails.
|
||||
/// The action will be passed a human-readable string describing the exception which caused the failure,
|
||||
/// along with a corresponding error code.
|
||||
/// </param>
|
||||
public void RegisterOnFailureCallback(Action<string, int> onFailure)
|
||||
{
|
||||
var listenerProxy = new TaskOnFailureListener();
|
||||
listenerProxy.OnTaskFailed += onFailure;
|
||||
AddOnFailureListener(listenerProxy);
|
||||
}
|
||||
|
||||
private void AddOnSuccessListener(AndroidJavaProxy listenerProxy)
|
||||
{
|
||||
_javaTask.Call<AndroidJavaObject>("addOnSuccessListener", listenerProxy).Dispose();
|
||||
}
|
||||
|
||||
private void AddOnFailureListener(AndroidJavaProxy listenerProxy)
|
||||
{
|
||||
_javaTask.Call<AndroidJavaObject>("addOnFailureListener", listenerProxy).Dispose();
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
_javaTask.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b9afdeebfe3f48029a48abd58942c338
|
||||
timeCreated: 1641857795
|
||||
@@ -0,0 +1,52 @@
|
||||
// Copyright 2019 Google LLC
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// https://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Google.Play.Core.Internal
|
||||
{
|
||||
/// <summary>
|
||||
/// Proxy for Play Services Task's OnFailureListener class.
|
||||
/// Allows C# classes to be alerted when a Play Core Task throws an exception.
|
||||
/// </summary>
|
||||
public class TaskOnFailureListener : AndroidJavaProxy
|
||||
{
|
||||
public event Action<string, int> OnTaskFailed = delegate { };
|
||||
|
||||
public TaskOnFailureListener() : base(PlayCoreConstants.GmsCorePackagePrefix + "tasks.OnFailureListener")
|
||||
{
|
||||
}
|
||||
|
||||
// Proxied java calls. Method names are camelCase to match the corresponding java methods.
|
||||
public void onFailure(AndroidJavaObject exception)
|
||||
{
|
||||
var message = exception.Call<string>("getMessage");
|
||||
|
||||
int errorCode;
|
||||
try
|
||||
{
|
||||
// If exception object doesn't provide getErrorCode method, this call will throw an
|
||||
// AndroidJavaException.
|
||||
errorCode = exception.Call<int>("getErrorCode");
|
||||
}
|
||||
catch (AndroidJavaException)
|
||||
{
|
||||
errorCode = PlayCoreConstants.InternalErrorCode;
|
||||
}
|
||||
|
||||
PlayCoreEventHandler.HandleEvent(() => OnTaskFailed.Invoke(message, errorCode));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 28db08947f4640aebf4a5f1c15012e4a
|
||||
timeCreated: 1641857543
|
||||
@@ -0,0 +1,45 @@
|
||||
// Copyright 2019 Google LLC
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// https://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Google.Play.Core.Internal
|
||||
{
|
||||
/// <summary>
|
||||
/// Proxy for Play Services Task's OnSuccessListener class.
|
||||
/// Allows C# classes to be alerted when a Play Core Task succeeds, and to get the result of that Task.
|
||||
/// </summary>
|
||||
/// <typeparam name="TAndroidJava">
|
||||
/// The return type of the proxied Play Core Task.
|
||||
/// Must be a primitive type (e.g. bool, int, or float) or an AndroidJavaObject.
|
||||
/// </typeparam>
|
||||
public class TaskOnSuccessListener<TAndroidJava> : AndroidJavaProxy
|
||||
{
|
||||
/// <summary>
|
||||
/// Triggers when the associated Play Core Task succeeds.
|
||||
/// </summary>
|
||||
public event Action<TAndroidJava> OnTaskSucceeded = delegate { };
|
||||
|
||||
public TaskOnSuccessListener() : base(PlayCoreConstants.GmsCorePackagePrefix + "tasks.OnSuccessListener")
|
||||
{
|
||||
}
|
||||
|
||||
// Proxied java calls. Method names are camelCase to match the corresponding java methods.
|
||||
public void onSuccess(TAndroidJava result)
|
||||
{
|
||||
PlayCoreEventHandler.HandleEvent(() => OnTaskSucceeded.Invoke(result));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: edce53eedcfb478f9738baa1e4a54319
|
||||
timeCreated: 1641857602
|
||||
14
Assets/GooglePlayPlugins/com.google.play.core/package.json
Normal file
14
Assets/GooglePlayPlugins/com.google.play.core/package.json
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"name": "com.google.play.core",
|
||||
"displayName": "Google Play Core",
|
||||
"description": "The Google Play Core package provides the Play Core Library required by some Google Play packages, such as Play Asset Delivery.\n\nThis package doesn't provide any features when installed separately.",
|
||||
"version": "1.8.4",
|
||||
"unity": "2018.4",
|
||||
"author": {
|
||||
"name": "Google LLC"
|
||||
},
|
||||
"dependencies": {
|
||||
"com.google.android.appbundle": "1.9.0",
|
||||
"com.google.external-dependency-manager": "1.2.172"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: cb49fa498ef3b4fd3938ce36a6f6bf72
|
||||
timeCreated: 1576695771
|
||||
licenseType: Pro
|
||||
TextScriptImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user