@capgo/capacitor-updater 3.3.12 → 3.3.15
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.
|
@@ -35,6 +35,7 @@ import java.net.URLConnection;
|
|
|
35
35
|
import java.security.SecureRandom;
|
|
36
36
|
import java.util.HashMap;
|
|
37
37
|
import java.util.Map;
|
|
38
|
+
import java.util.UUID;
|
|
38
39
|
import java.util.zip.ZipEntry;
|
|
39
40
|
import java.util.zip.ZipInputStream;
|
|
40
41
|
import java.util.ArrayList;
|
|
@@ -58,7 +59,7 @@ public class CapacitorUpdater {
|
|
|
58
59
|
|
|
59
60
|
public String appId = "";
|
|
60
61
|
public String deviceID = "";
|
|
61
|
-
public final String pluginVersion = "3.3.
|
|
62
|
+
public final String pluginVersion = "3.3.15";
|
|
62
63
|
public String statsUrl = "";
|
|
63
64
|
|
|
64
65
|
public CapacitorUpdater (final Context context) throws PackageManager.NameNotFoundException {
|
|
@@ -67,6 +68,8 @@ public class CapacitorUpdater {
|
|
|
67
68
|
this.editor = this.prefs.edit();
|
|
68
69
|
this.versionOs = Build.VERSION.RELEASE;
|
|
69
70
|
this.deviceID = Secure.getString(context.getContentResolver(), Secure.ANDROID_ID);
|
|
71
|
+
this.deviceID = this.prefs.getString("appUUID", UUID.randomUUID().toString());
|
|
72
|
+
this.editor.putString("appUUID", this.deviceID);
|
|
70
73
|
final PackageInfo pInfo = context.getPackageManager().getPackageInfo(context.getPackageName(), 0);
|
|
71
74
|
this.versionBuild = pInfo.versionName;
|
|
72
75
|
this.versionCode = Integer.toString(pInfo.versionCode);
|
|
@@ -181,7 +181,7 @@ public class CapacitorUpdaterPlugin: CAPPlugin {
|
|
|
181
181
|
let current = pathHot.count >= 10 ? pathHot.suffix(10) : "builtin"
|
|
182
182
|
call.resolve([
|
|
183
183
|
"current": current,
|
|
184
|
-
"currentNative": currentVersionNative
|
|
184
|
+
"currentNative": currentVersionNative.description
|
|
185
185
|
])
|
|
186
186
|
}
|
|
187
187
|
|
|
@@ -230,7 +230,7 @@ public class CapacitorUpdaterPlugin: CAPPlugin {
|
|
|
230
230
|
print("✨ Capacitor-updater: New version: \(newVersion) found. Current is \(currentVersion == "" ? "builtin" : currentVersion), next backgrounding will trigger update")
|
|
231
231
|
UserDefaults.standard.set(dl, forKey: "nextVersion")
|
|
232
232
|
UserDefaults.standard.set(newVersion.description, forKey: "nextVersionName")
|
|
233
|
-
self.notifyListeners("updateAvailable", data: ["version": newVersion])
|
|
233
|
+
self.notifyListeners("updateAvailable", data: ["version": newVersion.description])
|
|
234
234
|
} catch {
|
|
235
235
|
print("✨ Capacitor-updater: Download version \(newVersion) fail", error.localizedDescription)
|
|
236
236
|
}
|