@capgo/capacitor-updater 4.61.8 → 6.0.0
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 +0 -18
- package/android/build.gradle +8 -8
- package/android/src/main/java/ee/forgr/capacitor_updater/CapacitorUpdaterPlugin.java +13 -43
- package/dist/docs.json +0 -39
- package/dist/esm/definitions.d.ts +0 -10
- package/ios/Plugin/CapacitorUpdaterPlugin.swift +1 -13
- package/package.json +14 -14
package/README.md
CHANGED
|
@@ -130,7 +130,6 @@ Capacitor Updator works by unzipping a compiled app bundle to the native device
|
|
|
130
130
|
* [`current()`](#current)
|
|
131
131
|
* [`reload()`](#reload)
|
|
132
132
|
* [`setMultiDelay(...)`](#setmultidelay)
|
|
133
|
-
* [`setDelay(...)`](#setdelay)
|
|
134
133
|
* [`cancelDelay()`](#canceldelay)
|
|
135
134
|
* [`getLatest()`](#getlatest)
|
|
136
135
|
* [`setChannel(...)`](#setchannel)
|
|
@@ -304,23 +303,6 @@ Set <a href="#delaycondition">DelayCondition</a>, skip updates until one of the
|
|
|
304
303
|
--------------------
|
|
305
304
|
|
|
306
305
|
|
|
307
|
-
### setDelay(...)
|
|
308
|
-
|
|
309
|
-
```typescript
|
|
310
|
-
setDelay(options: DelayCondition) => Promise<void>
|
|
311
|
-
```
|
|
312
|
-
|
|
313
|
-
Set <a href="#delaycondition">DelayCondition</a>, skip updates until the condition is met
|
|
314
|
-
|
|
315
|
-
| Param | Type | Description |
|
|
316
|
-
| ------------- | --------------------------------------------------------- | ------------------------------------------------------------------ |
|
|
317
|
-
| **`options`** | <code><a href="#delaycondition">DelayCondition</a></code> | is the {@link <a href="#delaycondition">DelayCondition</a>} to set |
|
|
318
|
-
|
|
319
|
-
**Since:** 4.0.0
|
|
320
|
-
|
|
321
|
-
--------------------
|
|
322
|
-
|
|
323
|
-
|
|
324
306
|
### cancelDelay()
|
|
325
307
|
|
|
326
308
|
```typescript
|
package/android/build.gradle
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
ext {
|
|
2
2
|
junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.2'
|
|
3
|
-
androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.
|
|
4
|
-
androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.1.
|
|
5
|
-
androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.
|
|
3
|
+
androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.6.1'
|
|
4
|
+
androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.1.5'
|
|
5
|
+
androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.5.1'
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
buildscript {
|
|
@@ -11,7 +11,7 @@ buildscript {
|
|
|
11
11
|
mavenCentral()
|
|
12
12
|
}
|
|
13
13
|
dependencies {
|
|
14
|
-
classpath 'com.android.tools.build:gradle:
|
|
14
|
+
classpath 'com.android.tools.build:gradle:8.0.0'
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
|
|
@@ -19,10 +19,10 @@ apply plugin: 'com.android.library'
|
|
|
19
19
|
|
|
20
20
|
android {
|
|
21
21
|
namespace "ee.forgr.capacitor_updater"
|
|
22
|
-
compileSdkVersion project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion :
|
|
22
|
+
compileSdkVersion project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 33
|
|
23
23
|
defaultConfig {
|
|
24
24
|
minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 22
|
|
25
|
-
targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion :
|
|
25
|
+
targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 33
|
|
26
26
|
versionCode 1
|
|
27
27
|
versionName "1.0"
|
|
28
28
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
|
@@ -37,8 +37,8 @@ android {
|
|
|
37
37
|
abortOnError false
|
|
38
38
|
}
|
|
39
39
|
compileOptions {
|
|
40
|
-
sourceCompatibility JavaVersion.
|
|
41
|
-
targetCompatibility JavaVersion.
|
|
40
|
+
sourceCompatibility JavaVersion.VERSION_17
|
|
41
|
+
targetCompatibility JavaVersion.VERSION_17
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
|
|
@@ -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 = "
|
|
58
|
+
private final String PLUGIN_VERSION = "6.0.0";
|
|
59
59
|
private static final String DELAY_CONDITION_PREFERENCES = "";
|
|
60
60
|
|
|
61
61
|
private SharedPreferences.Editor editor;
|
|
@@ -675,33 +675,6 @@ public class CapacitorUpdaterPlugin
|
|
|
675
675
|
}
|
|
676
676
|
}
|
|
677
677
|
|
|
678
|
-
@Deprecated
|
|
679
|
-
@PluginMethod
|
|
680
|
-
public void setDelay(final PluginCall call) {
|
|
681
|
-
try {
|
|
682
|
-
String kind = call.getString("kind");
|
|
683
|
-
String value = call.getString("value");
|
|
684
|
-
String delayConditions =
|
|
685
|
-
"[{\"kind\":\"" +
|
|
686
|
-
kind +
|
|
687
|
-
"\", \"value\":\"" +
|
|
688
|
-
(value != null ? value : "") +
|
|
689
|
-
"\"}]";
|
|
690
|
-
if (_setMultiDelay(delayConditions)) {
|
|
691
|
-
call.resolve();
|
|
692
|
-
} else {
|
|
693
|
-
call.reject("Failed to delay update");
|
|
694
|
-
}
|
|
695
|
-
} catch (final Exception e) {
|
|
696
|
-
Log.e(
|
|
697
|
-
CapacitorUpdater.TAG,
|
|
698
|
-
"Failed to delay update, [Error calling 'setDelay()']",
|
|
699
|
-
e
|
|
700
|
-
);
|
|
701
|
-
call.reject("Failed to delay update", e);
|
|
702
|
-
}
|
|
703
|
-
}
|
|
704
|
-
|
|
705
678
|
private boolean _cancelDelay(String source) {
|
|
706
679
|
try {
|
|
707
680
|
this.editor.remove(DELAY_CONDITION_PREFERENCES);
|
|
@@ -1254,23 +1227,20 @@ public class CapacitorUpdaterPlugin
|
|
|
1254
1227
|
}
|
|
1255
1228
|
|
|
1256
1229
|
private boolean isMainActivity() {
|
|
1257
|
-
|
|
1258
|
-
Context mContext = this.getContext();
|
|
1259
|
-
ActivityManager activityManager =
|
|
1260
|
-
(ActivityManager) mContext.getSystemService(Context.ACTIVITY_SERVICE);
|
|
1261
|
-
List<ActivityManager.AppTask> runningTasks =
|
|
1262
|
-
activityManager.getAppTasks();
|
|
1263
|
-
ActivityManager.RecentTaskInfo runningTask = runningTasks
|
|
1264
|
-
.get(0)
|
|
1265
|
-
.getTaskInfo();
|
|
1266
|
-
String className = runningTask.baseIntent.getComponent().getClassName();
|
|
1267
|
-
String runningActivity = runningTask.topActivity.getClassName();
|
|
1268
|
-
boolean isThisAppActivity = className.equals(runningActivity);
|
|
1269
|
-
return isThisAppActivity;
|
|
1270
|
-
} catch (final Exception e) {
|
|
1271
|
-
Log.e(CapacitorUpdater.TAG, "Error getting Main Activity", e);
|
|
1230
|
+
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {
|
|
1272
1231
|
return false;
|
|
1273
1232
|
}
|
|
1233
|
+
Context mContext = this.getContext();
|
|
1234
|
+
ActivityManager activityManager =
|
|
1235
|
+
(ActivityManager) mContext.getSystemService(Context.ACTIVITY_SERVICE);
|
|
1236
|
+
List<ActivityManager.AppTask> runningTasks = activityManager.getAppTasks();
|
|
1237
|
+
ActivityManager.RecentTaskInfo runningTask = runningTasks
|
|
1238
|
+
.get(0)
|
|
1239
|
+
.getTaskInfo();
|
|
1240
|
+
String className = runningTask.baseIntent.getComponent().getClassName();
|
|
1241
|
+
String runningActivity = runningTask.topActivity.getClassName();
|
|
1242
|
+
boolean isThisAppActivity = className.equals(runningActivity);
|
|
1243
|
+
return isThisAppActivity;
|
|
1274
1244
|
}
|
|
1275
1245
|
|
|
1276
1246
|
private void appKilled() {
|
package/dist/docs.json
CHANGED
|
@@ -287,45 +287,6 @@
|
|
|
287
287
|
],
|
|
288
288
|
"slug": "setmultidelay"
|
|
289
289
|
},
|
|
290
|
-
{
|
|
291
|
-
"name": "setDelay",
|
|
292
|
-
"signature": "(options: DelayCondition) => Promise<void>",
|
|
293
|
-
"parameters": [
|
|
294
|
-
{
|
|
295
|
-
"name": "options",
|
|
296
|
-
"docs": "is the {@link DelayCondition} to set",
|
|
297
|
-
"type": "DelayCondition"
|
|
298
|
-
}
|
|
299
|
-
],
|
|
300
|
-
"returns": "Promise<void>",
|
|
301
|
-
"tags": [
|
|
302
|
-
{
|
|
303
|
-
"name": "deprecated",
|
|
304
|
-
"text": "use setMultiDelay instead passing a single value in array"
|
|
305
|
-
},
|
|
306
|
-
{
|
|
307
|
-
"name": "returns",
|
|
308
|
-
"text": "an Promise resolved directly"
|
|
309
|
-
},
|
|
310
|
-
{
|
|
311
|
-
"name": "param",
|
|
312
|
-
"text": "options is the {@link DelayCondition} to set"
|
|
313
|
-
},
|
|
314
|
-
{
|
|
315
|
-
"name": "throws",
|
|
316
|
-
"text": "An error if the something went wrong"
|
|
317
|
-
},
|
|
318
|
-
{
|
|
319
|
-
"name": "since",
|
|
320
|
-
"text": "4.0.0"
|
|
321
|
-
}
|
|
322
|
-
],
|
|
323
|
-
"docs": "Set DelayCondition, skip updates until the condition is met",
|
|
324
|
-
"complexTypes": [
|
|
325
|
-
"DelayCondition"
|
|
326
|
-
],
|
|
327
|
-
"slug": "setdelay"
|
|
328
|
-
},
|
|
329
290
|
{
|
|
330
291
|
"name": "cancelDelay",
|
|
331
292
|
"signature": "() => Promise<void>",
|
|
@@ -327,16 +327,6 @@ export interface CapacitorUpdaterPlugin {
|
|
|
327
327
|
setMultiDelay(options: {
|
|
328
328
|
delayConditions: DelayCondition[];
|
|
329
329
|
}): Promise<void>;
|
|
330
|
-
/**
|
|
331
|
-
* Set DelayCondition, skip updates until the condition is met
|
|
332
|
-
*
|
|
333
|
-
* @deprecated use setMultiDelay instead passing a single value in array
|
|
334
|
-
* @returns {Promise<void>} an Promise resolved directly
|
|
335
|
-
* @param options is the {@link DelayCondition} to set
|
|
336
|
-
* @throws An error if the something went wrong
|
|
337
|
-
* @since 4.0.0
|
|
338
|
-
*/
|
|
339
|
-
setDelay(options: DelayCondition): Promise<void>;
|
|
340
330
|
/**
|
|
341
331
|
* Cancel delay to updates as usual
|
|
342
332
|
*
|
|
@@ -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 = "
|
|
18
|
+
private let PLUGIN_VERSION: String = "6.0.0"
|
|
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"
|
|
@@ -338,18 +338,6 @@ public class CapacitorUpdaterPlugin: CAPPlugin {
|
|
|
338
338
|
}
|
|
339
339
|
}
|
|
340
340
|
|
|
341
|
-
@available(*, deprecated, message: "use SetMultiDelay instead")
|
|
342
|
-
@objc func setDelay(_ call: CAPPluginCall) {
|
|
343
|
-
let kind: String = call.getString("kind", "")
|
|
344
|
-
let value: String? = call.getString("value", "")
|
|
345
|
-
let delayConditions: String = "[{\"kind\":\"\(kind)\", \"value\":\"\(value ?? "")\"}]"
|
|
346
|
-
if _setMultiDelay(delayConditions: delayConditions) {
|
|
347
|
-
call.resolve()
|
|
348
|
-
} else {
|
|
349
|
-
call.reject("Failed to delay update")
|
|
350
|
-
}
|
|
351
|
-
}
|
|
352
|
-
|
|
353
341
|
private func _setMultiDelay(delayConditions: String?) -> Bool {
|
|
354
342
|
if delayConditions != nil && "" != delayConditions {
|
|
355
343
|
UserDefaults.standard.set(delayConditions, forKey: DELAY_CONDITION_PREFERENCES)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@capgo/capacitor-updater",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.0.0",
|
|
4
4
|
"packageManager": "pnpm@8.5.1",
|
|
5
5
|
"license": "MPL-2.0",
|
|
6
6
|
"description": "Live update for capacitor apps",
|
|
@@ -53,24 +53,24 @@
|
|
|
53
53
|
"prepublishOnly": "npm run build"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
|
-
"@capacitor/android": "^
|
|
57
|
-
"@capacitor/cli": "^
|
|
58
|
-
"@capacitor/core": "^
|
|
56
|
+
"@capacitor/android": "^5.0.3",
|
|
57
|
+
"@capacitor/cli": "^5.0.3",
|
|
58
|
+
"@capacitor/core": "^5.0.3",
|
|
59
59
|
"@capacitor/docgen": "^0.2.1",
|
|
60
|
-
"@capacitor/ios": "^
|
|
60
|
+
"@capacitor/ios": "^5.0.3",
|
|
61
61
|
"@ionic/eslint-config": "^0.3.0",
|
|
62
|
-
"@ionic/prettier-config": "^
|
|
62
|
+
"@ionic/prettier-config": "^3.0.0",
|
|
63
63
|
"@ionic/swiftlint-config": "^1.1.2",
|
|
64
|
-
"@types/node": "^
|
|
65
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
66
|
-
"@typescript-eslint/parser": "^5.
|
|
67
|
-
"eslint": "^8.
|
|
64
|
+
"@types/node": "^20.2.3",
|
|
65
|
+
"@typescript-eslint/eslint-plugin": "^5.59.7",
|
|
66
|
+
"@typescript-eslint/parser": "^5.59.7",
|
|
67
|
+
"eslint": "^8.41.0",
|
|
68
68
|
"eslint-plugin-import": "^2.27.5",
|
|
69
|
-
"prettier": "^2.8.
|
|
69
|
+
"prettier": "^2.8.8",
|
|
70
70
|
"prettier-plugin-java": "^2.1.0",
|
|
71
|
-
"rimraf": "^5.0.
|
|
72
|
-
"rollup": "^3.
|
|
73
|
-
"swiftlint": "^1.0.
|
|
71
|
+
"rimraf": "^5.0.1",
|
|
72
|
+
"rollup": "^3.23.0",
|
|
73
|
+
"swiftlint": "^1.0.2",
|
|
74
74
|
"typescript": "^5.0.4"
|
|
75
75
|
},
|
|
76
76
|
"peerDependencies": {
|