com.andysu.unity 0.0.0-stage → 0.1.90

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md.meta ADDED
@@ -0,0 +1,7 @@
1
+ fileFormatVersion: 2
2
+ guid: 96a7541f9e516577abf2fba7ef7db9b8
3
+ TextScriptImporter:
4
+ externalObjects: {}
5
+ userData:
6
+ assetBundleName:
7
+ assetBundleVariant:
@@ -0,0 +1,57 @@
1
+ // AndySU for Unity (Android). Talks to the host's com.andysu.api.Host over JNI; on other
2
+ // platforms and without an AndySU host every call returns neutral values.
3
+ using System;
4
+ using UnityEngine;
5
+
6
+ namespace AndySU
7
+ {
8
+ public enum ApplyPolicy { Live, Restart, NextStart }
9
+
10
+ public static class Updates
11
+ {
12
+ #if UNITY_ANDROID && !UNITY_EDITOR
13
+ static AndroidJavaObject HostApi()
14
+ {
15
+ using (var host = new AndroidJavaClass("com.andysu.api.Host"))
16
+ return host.CallStatic<AndroidJavaObject>("current");
17
+ }
18
+
19
+ static AndroidJavaObject Client()
20
+ {
21
+ var h = HostApi();
22
+ return h?.Call<AndroidJavaObject>("updates");
23
+ }
24
+ #else
25
+ static AndroidJavaObject HostApi() => null;
26
+ static AndroidJavaObject Client() => null;
27
+ #endif
28
+
29
+ /// <summary>True when the game runs under an AndySU host.</summary>
30
+ public static bool IsPresent => HostApi() != null;
31
+
32
+ public static string Version => HostApi()?.Call<string>("version") ?? "";
33
+
34
+ /// <summary>Status as JSON, e.g. {"state":"staged","release":"1.4.0"}.</summary>
35
+ public static string StatusJson => Client()?.Call<string>("status") ?? "{\"state\":\"idle\"}";
36
+
37
+ public static void CheckNow() => Client()?.Call("checkNow");
38
+ public static void ApplyNow() => Client()?.Call("applyNow");
39
+ public static void RestartNow() => Client()?.Call("restartNow");
40
+
41
+ /// <summary>Commit this payload once the game is known to work.</summary>
42
+ public static void MarkHealthy() => HostApi()?.Call("markHealthy");
43
+
44
+ /// <summary>How staged updates apply on this install; null for the configured policy.</summary>
45
+ public static void SetApplyPolicy(ApplyPolicy? p)
46
+ {
47
+ string v = p switch
48
+ {
49
+ ApplyPolicy.Live => "live",
50
+ ApplyPolicy.Restart => "restart",
51
+ ApplyPolicy.NextStart => "next_start",
52
+ _ => null,
53
+ };
54
+ Client()?.Call("setApplyPolicy", v);
55
+ }
56
+ }
57
+ }
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: 09ad901c34575efe6367beaf44c35aa1
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -0,0 +1 @@
1
+ { "name": "AndySU", "rootNamespace": "AndySU", "references": [], "includePlatforms": [], "excludePlatforms": [] }
@@ -0,0 +1,7 @@
1
+ fileFormatVersion: 2
2
+ guid: 4679d26459d1729255df896d39b317ee
3
+ AssemblyDefinitionImporter:
4
+ externalObjects: {}
5
+ userData:
6
+ assetBundleName:
7
+ assetBundleVariant:
package/Runtime.meta ADDED
@@ -0,0 +1,8 @@
1
+ fileFormatVersion: 2
2
+ guid: 6e421f5ac91bd1bf57112a8258d5165a
3
+ folderAsset: yes
4
+ DefaultImporter:
5
+ externalObjects: {}
6
+ userData:
7
+ assetBundleName:
8
+ assetBundleVariant:
package/package.json CHANGED
@@ -1,6 +1,24 @@
1
1
  {
2
2
  "name": "com.andysu.unity",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.90",
4
+ "displayName": "AndySU",
5
+ "description": "Self-updates for Unity games on Android outside the stores: status, check, apply, apply policy.",
6
+ "unity": "2021.3",
7
+ "license": "Apache-2.0",
8
+ "author": {
9
+ "name": "dixonSolutions",
10
+ "url": "https://github.com/dixonSolutions/AndySU"
11
+ },
12
+ "files": [
13
+ "Runtime",
14
+ "package.json.meta",
15
+ "README.md",
16
+ "README.md.meta",
17
+ "Runtime.meta"
18
+ ],
19
+ "repository": {
20
+ "type": "git",
21
+ "url": "https://github.com/dixonSolutions/AndySU",
22
+ "directory": "bindings/unity"
23
+ }
24
+ }
@@ -0,0 +1,7 @@
1
+ fileFormatVersion: 2
2
+ guid: c4641170ed1a03be509e4770522737df
3
+ PackageManifestImporter:
4
+ externalObjects: {}
5
+ userData:
6
+ assetBundleName:
7
+ assetBundleVariant:
package/README.md DELETED
@@ -1,3 +0,0 @@
1
- # Temporary Holding Version
2
-
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.