@capgo/capacitor-updater 5.7.11 → 5.7.13
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.
|
@@ -55,7 +55,7 @@ public class CapacitorUpdaterPlugin extends Plugin {
|
|
|
55
55
|
private static final String channelUrlDefault =
|
|
56
56
|
"https://api.capgo.app/channel_self";
|
|
57
57
|
|
|
58
|
-
private final String PLUGIN_VERSION = "5.7.
|
|
58
|
+
private final String PLUGIN_VERSION = "5.7.13";
|
|
59
59
|
private static final String DELAY_CONDITION_PREFERENCES = "";
|
|
60
60
|
|
|
61
61
|
private SharedPreferences.Editor editor;
|
|
@@ -473,7 +473,7 @@ public class CapacitorUpdaterPlugin extends Plugin {
|
|
|
473
473
|
CapacitorUpdater.TAG,
|
|
474
474
|
"unsetChannel triggerAutoUpdate: " + triggerAutoUpdate
|
|
475
475
|
);
|
|
476
|
-
startNewThread(() ->
|
|
476
|
+
startNewThread(() ->
|
|
477
477
|
CapacitorUpdaterPlugin.this.implementation.unsetChannel(res -> {
|
|
478
478
|
if (res.has("error")) {
|
|
479
479
|
call.reject(res.getString("error"));
|
|
@@ -490,8 +490,8 @@ public class CapacitorUpdaterPlugin extends Plugin {
|
|
|
490
490
|
}
|
|
491
491
|
call.resolve(res);
|
|
492
492
|
}
|
|
493
|
-
})
|
|
494
|
-
|
|
493
|
+
})
|
|
494
|
+
);
|
|
495
495
|
} catch (final Exception e) {
|
|
496
496
|
Log.e(CapacitorUpdater.TAG, "Failed to unsetChannel: ", e);
|
|
497
497
|
call.reject("Failed to unsetChannel: ", e);
|
|
@@ -516,7 +516,7 @@ public class CapacitorUpdaterPlugin extends Plugin {
|
|
|
516
516
|
CapacitorUpdater.TAG,
|
|
517
517
|
"setChannel " + channel + " triggerAutoUpdate: " + triggerAutoUpdate
|
|
518
518
|
);
|
|
519
|
-
startNewThread(() ->
|
|
519
|
+
startNewThread(() ->
|
|
520
520
|
CapacitorUpdaterPlugin.this.implementation.setChannel(
|
|
521
521
|
channel,
|
|
522
522
|
res -> {
|
|
@@ -536,8 +536,8 @@ public class CapacitorUpdaterPlugin extends Plugin {
|
|
|
536
536
|
call.resolve(res);
|
|
537
537
|
}
|
|
538
538
|
}
|
|
539
|
-
)
|
|
540
|
-
|
|
539
|
+
)
|
|
540
|
+
);
|
|
541
541
|
} catch (final Exception e) {
|
|
542
542
|
Log.e(CapacitorUpdater.TAG, "Failed to setChannel: " + channel, e);
|
|
543
543
|
call.reject("Failed to setChannel: " + channel, e);
|
|
@@ -548,15 +548,15 @@ public class CapacitorUpdaterPlugin extends Plugin {
|
|
|
548
548
|
public void getChannel(final PluginCall call) {
|
|
549
549
|
try {
|
|
550
550
|
Log.i(CapacitorUpdater.TAG, "getChannel");
|
|
551
|
-
startNewThread(() ->
|
|
551
|
+
startNewThread(() ->
|
|
552
552
|
CapacitorUpdaterPlugin.this.implementation.getChannel(res -> {
|
|
553
553
|
if (res.has("error")) {
|
|
554
554
|
call.reject(res.getString("error"));
|
|
555
555
|
} else {
|
|
556
556
|
call.resolve(res);
|
|
557
557
|
}
|
|
558
|
-
})
|
|
559
|
-
|
|
558
|
+
})
|
|
559
|
+
);
|
|
560
560
|
} catch (final Exception e) {
|
|
561
561
|
Log.e(CapacitorUpdater.TAG, "Failed to getChannel", e);
|
|
562
562
|
call.reject("Failed to getChannel", e);
|
|
@@ -748,7 +748,7 @@ public class CapacitorUpdaterPlugin extends Plugin {
|
|
|
748
748
|
|
|
749
749
|
@PluginMethod
|
|
750
750
|
public void getLatest(final PluginCall call) {
|
|
751
|
-
startNewThread(() ->
|
|
751
|
+
startNewThread(() ->
|
|
752
752
|
CapacitorUpdaterPlugin.this.implementation.getLatest(
|
|
753
753
|
CapacitorUpdaterPlugin.this.updateUrl,
|
|
754
754
|
res -> {
|
|
@@ -775,8 +775,8 @@ public class CapacitorUpdaterPlugin extends Plugin {
|
|
|
775
775
|
}
|
|
776
776
|
call.resolve(ret);
|
|
777
777
|
}
|
|
778
|
-
)
|
|
779
|
-
|
|
778
|
+
)
|
|
779
|
+
);
|
|
780
780
|
}
|
|
781
781
|
|
|
782
782
|
private boolean _reset(final Boolean toLastSuccessful) {
|
|
@@ -843,7 +843,6 @@ public class CapacitorUpdaterPlugin extends Plugin {
|
|
|
843
843
|
CapacitorUpdater.TAG,
|
|
844
844
|
Objects.requireNonNull(res.getString("error"))
|
|
845
845
|
);
|
|
846
|
-
return;
|
|
847
846
|
} else if (res.has("version")) {
|
|
848
847
|
String newVersion = res.getString("version");
|
|
849
848
|
String currentVersion = String.valueOf(
|
|
@@ -1070,7 +1069,7 @@ public class CapacitorUpdaterPlugin extends Plugin {
|
|
|
1070
1069
|
|
|
1071
1070
|
private boolean isValidURL(String urlStr) {
|
|
1072
1071
|
try {
|
|
1073
|
-
|
|
1072
|
+
new URL(urlStr);
|
|
1074
1073
|
return true;
|
|
1075
1074
|
} catch (MalformedURLException e) {
|
|
1076
1075
|
return false;
|
|
@@ -1084,10 +1083,7 @@ public class CapacitorUpdaterPlugin extends Plugin {
|
|
|
1084
1083
|
Boolean error
|
|
1085
1084
|
) {
|
|
1086
1085
|
if (error) {
|
|
1087
|
-
Log.i(
|
|
1088
|
-
CapacitorUpdater.TAG,
|
|
1089
|
-
"endBackGroundTaskWithNotif error" + error.toString()
|
|
1090
|
-
);
|
|
1086
|
+
Log.i(CapacitorUpdater.TAG, "endBackGroundTaskWithNotif error" + error);
|
|
1091
1087
|
this.implementation.sendStats("download_fail", current.getVersionName());
|
|
1092
1088
|
final JSObject ret = new JSObject();
|
|
1093
1089
|
ret.put("version", latestVersionName);
|
|
@@ -15,7 +15,7 @@ import Version
|
|
|
15
15
|
@objc(CapacitorUpdaterPlugin)
|
|
16
16
|
public class CapacitorUpdaterPlugin: CAPPlugin {
|
|
17
17
|
public var implementation = CapacitorUpdater()
|
|
18
|
-
private let PLUGIN_VERSION: String = "5.7.
|
|
18
|
+
private let PLUGIN_VERSION: String = "5.7.13"
|
|
19
19
|
static let updateUrlDefault = "https://api.capgo.app/updates"
|
|
20
20
|
static let statsUrlDefault = "https://api.capgo.app/stats"
|
|
21
21
|
static let channelUrlDefault = "https://api.capgo.app/channel_self"
|