@capgo/capacitor-updater 4.61.7 → 4.61.10
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
|
|
|
55
55
|
private static final String channelUrlDefault =
|
|
56
56
|
"https://api.capgo.app/channel_self";
|
|
57
57
|
|
|
58
|
-
private final String PLUGIN_VERSION = "4.61.
|
|
58
|
+
private final String PLUGIN_VERSION = "4.61.10";
|
|
59
59
|
private static final String DELAY_CONDITION_PREFERENCES = "";
|
|
60
60
|
|
|
61
61
|
private SharedPreferences.Editor editor;
|
|
@@ -145,7 +145,10 @@ public class CapacitorUpdaterPlugin
|
|
|
145
145
|
CapacitorUpdater.TAG,
|
|
146
146
|
"init for device " + this.implementation.deviceID
|
|
147
147
|
);
|
|
148
|
-
|
|
148
|
+
Log.i(
|
|
149
|
+
CapacitorUpdater.TAG,
|
|
150
|
+
"version native " + this.currentVersionNative.getOriginalString()
|
|
151
|
+
);
|
|
149
152
|
this.autoDeleteFailed =
|
|
150
153
|
this.getConfig().getBoolean("autoDeleteFailed", true);
|
|
151
154
|
this.autoDeletePrevious =
|
|
@@ -1251,23 +1254,21 @@ public class CapacitorUpdaterPlugin
|
|
|
1251
1254
|
}
|
|
1252
1255
|
|
|
1253
1256
|
private boolean isMainActivity() {
|
|
1254
|
-
|
|
1255
|
-
Context mContext = this.getContext();
|
|
1256
|
-
ActivityManager activityManager =
|
|
1257
|
-
(ActivityManager) mContext.getSystemService(Context.ACTIVITY_SERVICE);
|
|
1258
|
-
List<ActivityManager.AppTask> runningTasks =
|
|
1259
|
-
activityManager.getAppTasks();
|
|
1260
|
-
ActivityManager.RecentTaskInfo runningTask = runningTasks
|
|
1261
|
-
.get(0)
|
|
1262
|
-
.getTaskInfo();
|
|
1263
|
-
String className = runningTask.baseIntent.getComponent().getClassName();
|
|
1264
|
-
String runningActivity = runningTask.topActivity.getClassName();
|
|
1265
|
-
boolean isThisAppActivity = className.equals(runningActivity);
|
|
1266
|
-
return isThisAppActivity;
|
|
1267
|
-
} catch (final Exception e) {
|
|
1268
|
-
Log.e(CapacitorUpdater.TAG, "Error getting Main Activity", e);
|
|
1257
|
+
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {
|
|
1269
1258
|
return false;
|
|
1270
1259
|
}
|
|
1260
|
+
Context mContext = this.getContext();
|
|
1261
|
+
ActivityManager activityManager =
|
|
1262
|
+
(ActivityManager) mContext.getSystemService(Context.ACTIVITY_SERVICE);
|
|
1263
|
+
List<ActivityManager.AppTask> runningTasks =
|
|
1264
|
+
activityManager.getAppTasks();
|
|
1265
|
+
ActivityManager.RecentTaskInfo runningTask = runningTasks
|
|
1266
|
+
.get(0)
|
|
1267
|
+
.getTaskInfo();
|
|
1268
|
+
String className = runningTask.baseIntent.getComponent().getClassName();
|
|
1269
|
+
String runningActivity = runningTask.topActivity.getClassName();
|
|
1270
|
+
boolean isThisAppActivity = className.equals(runningActivity);
|
|
1271
|
+
return isThisAppActivity;
|
|
1271
1272
|
}
|
|
1272
1273
|
|
|
1273
1274
|
private void appKilled() {
|
|
@@ -15,7 +15,7 @@ import Version
|
|
|
15
15
|
@objc(CapacitorUpdaterPlugin)
|
|
16
16
|
public class CapacitorUpdaterPlugin: CAPPlugin {
|
|
17
17
|
private var implementation = CapacitorUpdater()
|
|
18
|
-
private let PLUGIN_VERSION: String = "4.61.
|
|
18
|
+
private let PLUGIN_VERSION: String = "4.61.10"
|
|
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"
|
|
@@ -41,6 +41,7 @@ public class CapacitorUpdaterPlugin: CAPPlugin {
|
|
|
41
41
|
} catch {
|
|
42
42
|
print("\(self.implementation.TAG) Cannot get version native \(currentVersionNative)")
|
|
43
43
|
}
|
|
44
|
+
print("\(self.implementation.TAG) version native \(self.currentVersionNative.description)")
|
|
44
45
|
implementation.versionName = getConfig().getString("version", Bundle.main.versionName)!
|
|
45
46
|
autoDeleteFailed = getConfig().getBoolean("autoDeleteFailed", true)
|
|
46
47
|
autoDeletePrevious = getConfig().getBoolean("autoDeletePrevious", true)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@capgo/capacitor-updater",
|
|
3
|
-
"version": "4.61.
|
|
3
|
+
"version": "4.61.10",
|
|
4
4
|
"packageManager": "pnpm@8.5.1",
|
|
5
5
|
"license": "MPL-2.0",
|
|
6
6
|
"description": "Live update for capacitor apps",
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
"typescript": "^5.0.4"
|
|
75
75
|
},
|
|
76
76
|
"peerDependencies": {
|
|
77
|
-
"@capacitor/core": "^
|
|
77
|
+
"@capacitor/core": "^4.0.0"
|
|
78
78
|
},
|
|
79
79
|
"prettier": "@ionic/prettier-config",
|
|
80
80
|
"swiftlint": "@ionic/swiftlint-config",
|