@capgo/capacitor-updater 8.0.0 → 8.0.1
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/CapgoCapacitorUpdater.podspec +2 -2
- package/Package.swift +35 -0
- package/README.md +667 -206
- package/android/build.gradle +16 -11
- package/android/proguard-rules.pro +28 -0
- package/android/src/main/AndroidManifest.xml +0 -1
- package/android/src/main/java/ee/forgr/capacitor_updater/BundleInfo.java +134 -194
- package/android/src/main/java/ee/forgr/capacitor_updater/BundleStatus.java +23 -23
- package/android/src/main/java/ee/forgr/capacitor_updater/Callback.java +13 -0
- package/android/src/main/java/ee/forgr/capacitor_updater/CapacitorUpdater.java +967 -1027
- package/android/src/main/java/ee/forgr/capacitor_updater/CapacitorUpdaterPlugin.java +1283 -1180
- package/android/src/main/java/ee/forgr/capacitor_updater/CryptoCipherV2.java +276 -0
- package/android/src/main/java/ee/forgr/capacitor_updater/DataManager.java +28 -0
- package/android/src/main/java/ee/forgr/capacitor_updater/DelayCondition.java +45 -48
- package/android/src/main/java/ee/forgr/capacitor_updater/DelayUntilNext.java +4 -4
- package/android/src/main/java/ee/forgr/capacitor_updater/DownloadService.java +440 -113
- package/android/src/main/java/ee/forgr/capacitor_updater/DownloadWorkerManager.java +101 -0
- package/android/src/main/java/ee/forgr/capacitor_updater/InternalUtils.java +32 -0
- package/dist/docs.json +1316 -473
- package/dist/esm/definitions.d.ts +518 -248
- package/dist/esm/definitions.js.map +1 -1
- package/dist/esm/index.d.ts +2 -2
- package/dist/esm/index.js +4 -4
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/web.d.ts +25 -41
- package/dist/esm/web.js +67 -35
- package/dist/esm/web.js.map +1 -1
- package/dist/plugin.cjs.js +67 -35
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +67 -35
- package/dist/plugin.js.map +1 -1
- package/ios/Plugin/CapacitorUpdater.swift +736 -361
- package/ios/Plugin/CapacitorUpdaterPlugin.swift +436 -136
- package/ios/Plugin/CryptoCipherV2.swift +310 -0
- package/ios/Plugin/InternalUtils.swift +258 -0
- package/package.json +33 -29
- package/android/src/main/java/ee/forgr/capacitor_updater/CryptoCipher.java +0 -153
- package/ios/Plugin/CapacitorUpdaterPlugin.h +0 -10
- package/ios/Plugin/CapacitorUpdaterPlugin.m +0 -27
- package/ios/Plugin/CryptoCipher.swift +0 -240
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.7.0'
|
|
4
|
+
androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.2.1'
|
|
5
|
+
androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.6.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:8.
|
|
14
|
+
classpath 'com.android.tools.build:gradle:8.7.2'
|
|
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
|
-
|
|
22
|
+
compileSdk project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 35
|
|
23
23
|
defaultConfig {
|
|
24
|
-
minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion :
|
|
25
|
-
targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion :
|
|
24
|
+
minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 23
|
|
25
|
+
targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 35
|
|
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_21
|
|
41
|
+
targetCompatibility JavaVersion.VERSION_21
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
|
|
@@ -49,13 +49,18 @@ repositories {
|
|
|
49
49
|
|
|
50
50
|
|
|
51
51
|
dependencies {
|
|
52
|
+
def work_version = "2.10.0"
|
|
53
|
+
implementation "androidx.work:work-runtime:$work_version"
|
|
54
|
+
implementation "com.google.android.gms:play-services-tasks:18.2.0"
|
|
55
|
+
implementation "com.google.guava:guava:32.1.3-jre"
|
|
52
56
|
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
|
53
57
|
implementation project(':capacitor-android')
|
|
54
58
|
implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion"
|
|
55
|
-
implementation 'com.android.volley:volley:1.2.1'
|
|
56
59
|
implementation 'io.github.g00fy2:versioncompare:1.5.0'
|
|
57
|
-
implementation 'com.google.code.gson:gson:2.
|
|
60
|
+
implementation 'com.google.code.gson:gson:2.11.0'
|
|
58
61
|
testImplementation "junit:junit:$junitVersion"
|
|
59
62
|
androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion"
|
|
60
63
|
androidTestImplementation "androidx.test.espresso:espresso-core:$androidxEspressoCoreVersion"
|
|
64
|
+
implementation 'org.brotli:dec:0.1.2'
|
|
65
|
+
implementation 'com.squareup.okhttp3:okhttp:4.12.0'
|
|
61
66
|
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Add project specific ProGuard rules here.
|
|
2
|
+
# You can control the set of applied configuration files using the
|
|
3
|
+
# proguardFiles setting in build.gradle.
|
|
4
|
+
#
|
|
5
|
+
# For more details, see
|
|
6
|
+
# http://developer.android.com/guide/developing/tools/proguard.html
|
|
7
|
+
|
|
8
|
+
# If your project uses WebView with JS, uncomment the following
|
|
9
|
+
# and specify the fully qualified class name to the JavaScript interface
|
|
10
|
+
# class:
|
|
11
|
+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
|
12
|
+
# public *;
|
|
13
|
+
#}
|
|
14
|
+
|
|
15
|
+
# Uncomment this to preserve the line number information for
|
|
16
|
+
# debugging stack traces.
|
|
17
|
+
#-keepattributes SourceFile,LineNumberTable
|
|
18
|
+
|
|
19
|
+
# If you keep the line number information, uncomment this to
|
|
20
|
+
# hide the original source file name.
|
|
21
|
+
#-renamesourcefileattribute SourceFile
|
|
22
|
+
|
|
23
|
+
# Necessary for Gson Deserialization
|
|
24
|
+
-keepattributes *Annotation*
|
|
25
|
+
|
|
26
|
+
# Necessary for Gson Deserialization
|
|
27
|
+
-keep class ee.forgr.capacitor_updater.DelayCondition { *; }
|
|
28
|
+
-keepattributes Signature
|
|
@@ -17,198 +17,138 @@ import org.json.JSONTokener;
|
|
|
17
17
|
|
|
18
18
|
public class BundleInfo {
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
)
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
return this.isBuiltin() ? BundleStatus.SUCCESS : this.status;
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
public BundleInfo setStatus(BundleStatus status) {
|
|
158
|
-
return new BundleInfo(
|
|
159
|
-
this.id,
|
|
160
|
-
this.version,
|
|
161
|
-
status,
|
|
162
|
-
this.downloaded,
|
|
163
|
-
this.checksum
|
|
164
|
-
);
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
public static BundleInfo fromJSON(final JSObject json) throws JSONException {
|
|
168
|
-
return BundleInfo.fromJSON(json.toString());
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
public static BundleInfo fromJSON(final String jsonString)
|
|
172
|
-
throws JSONException {
|
|
173
|
-
JSONObject json = new JSONObject(new JSONTokener(jsonString));
|
|
174
|
-
return new BundleInfo(
|
|
175
|
-
json.has("id") ? json.getString("id") : "",
|
|
176
|
-
json.has("version")
|
|
177
|
-
? json.getString("version")
|
|
178
|
-
: BundleInfo.VERSION_UNKNOWN,
|
|
179
|
-
json.has("status")
|
|
180
|
-
? BundleStatus.fromString(json.getString("status"))
|
|
181
|
-
: BundleStatus.PENDING,
|
|
182
|
-
json.has("downloaded") ? json.getString("downloaded") : "",
|
|
183
|
-
json.has("checksum") ? json.getString("checksum") : ""
|
|
184
|
-
);
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
public JSObject toJSON() {
|
|
188
|
-
final JSObject result = new JSObject();
|
|
189
|
-
result.put("id", this.getId());
|
|
190
|
-
result.put("version", this.getVersionName());
|
|
191
|
-
result.put("downloaded", this.getDownloaded());
|
|
192
|
-
result.put("checksum", this.getChecksum());
|
|
193
|
-
result.put("status", this.getStatus());
|
|
194
|
-
return result;
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
@Override
|
|
198
|
-
public boolean equals(final Object o) {
|
|
199
|
-
if (this == o) return true;
|
|
200
|
-
if (!(o instanceof BundleInfo)) return false;
|
|
201
|
-
final BundleInfo that = (BundleInfo) o;
|
|
202
|
-
return this.getId().equals(that.getId());
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
@Override
|
|
206
|
-
public int hashCode() {
|
|
207
|
-
return Objects.hash(this.version);
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
@Override
|
|
211
|
-
public String toString() {
|
|
212
|
-
return this.toJSON().toString();
|
|
213
|
-
}
|
|
20
|
+
private static final SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ");
|
|
21
|
+
|
|
22
|
+
public static final String ID_BUILTIN = "builtin";
|
|
23
|
+
public static final String VERSION_UNKNOWN = "unknown";
|
|
24
|
+
public static final String DOWNLOADED_BUILTIN = "1970-01-01T00:00:00.000Z";
|
|
25
|
+
|
|
26
|
+
private final String downloaded;
|
|
27
|
+
private final String id;
|
|
28
|
+
private final String version;
|
|
29
|
+
private final String checksum;
|
|
30
|
+
private final BundleStatus status;
|
|
31
|
+
|
|
32
|
+
static {
|
|
33
|
+
sdf.setTimeZone(TimeZone.getTimeZone("GMT"));
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
public BundleInfo(final BundleInfo source) {
|
|
37
|
+
this(source.id, source.version, source.status, source.downloaded, source.checksum);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
public BundleInfo(final String id, final String version, final BundleStatus status, final Date downloaded, final String checksum) {
|
|
41
|
+
this(id, version, status, sdf.format(downloaded), checksum);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
public BundleInfo(final String id, final String version, final BundleStatus status, final String downloaded, final String checksum) {
|
|
45
|
+
this.downloaded = downloaded.trim();
|
|
46
|
+
this.id = id;
|
|
47
|
+
this.version = version;
|
|
48
|
+
this.checksum = checksum;
|
|
49
|
+
this.status = status;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
public Boolean isBuiltin() {
|
|
53
|
+
return ID_BUILTIN.equals(this.id);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
public Boolean isUnknown() {
|
|
57
|
+
return VERSION_UNKNOWN.equals(this.id);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
public Boolean isErrorStatus() {
|
|
61
|
+
return BundleStatus.ERROR == this.status;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
public Boolean isDeleted() {
|
|
65
|
+
return BundleStatus.DELETED == this.status;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
public boolean isDownloaded() {
|
|
69
|
+
return (!this.isBuiltin() && this.downloaded != null && !this.downloaded.isEmpty() && !this.isDeleted());
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
public String getDownloaded() {
|
|
73
|
+
return this.isBuiltin() ? DOWNLOADED_BUILTIN : this.downloaded;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
public BundleInfo setDownloaded(Date downloaded) {
|
|
77
|
+
return new BundleInfo(this.id, this.version, this.status, downloaded, this.checksum);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
public String getChecksum() {
|
|
81
|
+
return this.isBuiltin() ? "" : this.checksum;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
public BundleInfo setChecksum(String checksum) {
|
|
85
|
+
return new BundleInfo(this.id, this.version, this.status, this.downloaded, checksum);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
public String getId() {
|
|
89
|
+
return this.isBuiltin() ? ID_BUILTIN : this.id;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
public BundleInfo setId(String id) {
|
|
93
|
+
return new BundleInfo(id, this.version, this.status, this.downloaded, this.checksum);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
public String getVersionName() {
|
|
97
|
+
return this.version == null ? ID_BUILTIN : this.version;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
public BundleInfo setVersionName(String version) {
|
|
101
|
+
return new BundleInfo(this.id, version, this.status, this.downloaded, this.checksum);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
public BundleStatus getStatus() {
|
|
105
|
+
return this.isBuiltin() ? BundleStatus.SUCCESS : this.status;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
public BundleInfo setStatus(BundleStatus status) {
|
|
109
|
+
return new BundleInfo(this.id, this.version, status, this.downloaded, this.checksum);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
public static BundleInfo fromJSON(final JSObject json) throws JSONException {
|
|
113
|
+
return BundleInfo.fromJSON(json.toString());
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
public static BundleInfo fromJSON(final String jsonString) throws JSONException {
|
|
117
|
+
JSONObject json = new JSONObject(new JSONTokener(jsonString));
|
|
118
|
+
return new BundleInfo(
|
|
119
|
+
json.has("id") ? json.getString("id") : "",
|
|
120
|
+
json.has("version") ? json.getString("version") : BundleInfo.VERSION_UNKNOWN,
|
|
121
|
+
json.has("status") ? BundleStatus.fromString(json.getString("status")) : BundleStatus.PENDING,
|
|
122
|
+
json.has("downloaded") ? json.getString("downloaded") : "",
|
|
123
|
+
json.has("checksum") ? json.getString("checksum") : ""
|
|
124
|
+
);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
public JSObject toJSON() {
|
|
128
|
+
final JSObject result = new JSObject();
|
|
129
|
+
result.put("id", this.getId());
|
|
130
|
+
result.put("version", this.getVersionName());
|
|
131
|
+
result.put("downloaded", this.getDownloaded());
|
|
132
|
+
result.put("checksum", this.getChecksum());
|
|
133
|
+
result.put("status", this.getStatus());
|
|
134
|
+
return result;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
@Override
|
|
138
|
+
public boolean equals(final Object o) {
|
|
139
|
+
if (this == o) return true;
|
|
140
|
+
if (!(o instanceof BundleInfo)) return false;
|
|
141
|
+
final BundleInfo that = (BundleInfo) o;
|
|
142
|
+
return this.getId().equals(that.getId());
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
@Override
|
|
146
|
+
public int hashCode() {
|
|
147
|
+
return Objects.hash(this.version);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
@Override
|
|
151
|
+
public String toString() {
|
|
152
|
+
return this.toJSON().toString();
|
|
153
|
+
}
|
|
214
154
|
}
|
|
@@ -10,35 +10,35 @@ import java.util.HashMap;
|
|
|
10
10
|
import java.util.Map;
|
|
11
11
|
|
|
12
12
|
public enum BundleStatus {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
SUCCESS("success"),
|
|
14
|
+
ERROR("error"),
|
|
15
|
+
PENDING("pending"),
|
|
16
|
+
DELETED("deleted"),
|
|
17
|
+
DOWNLOADING("downloading");
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
public final String label;
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
private static final Map<String, BundleStatus> BY_LABEL = new HashMap<>();
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
static {
|
|
24
|
+
for (final BundleStatus e : values()) {
|
|
25
|
+
BY_LABEL.put(e.label, e);
|
|
26
|
+
}
|
|
26
27
|
}
|
|
27
|
-
}
|
|
28
28
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
BundleStatus(final String label) {
|
|
30
|
+
this.label = label;
|
|
31
|
+
}
|
|
32
32
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
@Override
|
|
34
|
+
public String toString() {
|
|
35
|
+
return this.label;
|
|
36
|
+
}
|
|
37
37
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
public static BundleStatus fromString(final String status) {
|
|
39
|
+
if (status == null || status.isEmpty()) {
|
|
40
|
+
return BundleStatus.PENDING;
|
|
41
|
+
}
|
|
42
|
+
return BundleStatus.BY_LABEL.get(status);
|
|
41
43
|
}
|
|
42
|
-
return BundleStatus.BY_LABEL.get(status);
|
|
43
|
-
}
|
|
44
44
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
3
|
+
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
4
|
+
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
package ee.forgr.capacitor_updater;
|
|
8
|
+
|
|
9
|
+
import com.getcapacitor.JSObject;
|
|
10
|
+
|
|
11
|
+
public interface Callback {
|
|
12
|
+
void callback(JSObject jsoObject);
|
|
13
|
+
}
|