@capgo/capacitor-updater 7.2.19 → 7.2.21

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.
@@ -6,9 +6,10 @@
6
6
 
7
7
  package ee.forgr.capacitor_updater;
8
8
 
9
- import com.getcapacitor.JSObject;
10
9
  import java.text.SimpleDateFormat;
11
10
  import java.util.Date;
11
+ import java.util.HashMap;
12
+ import java.util.Map;
12
13
  import java.util.Objects;
13
14
  import java.util.TimeZone;
14
15
  import org.json.JSONException;
@@ -109,10 +110,6 @@ public class BundleInfo {
109
110
  return new BundleInfo(this.id, this.version, status, this.downloaded, this.checksum);
110
111
  }
111
112
 
112
- public static BundleInfo fromJSON(final JSObject json) throws JSONException {
113
- return BundleInfo.fromJSON(json.toString());
114
- }
115
-
116
113
  public static BundleInfo fromJSON(final String jsonString) throws JSONException {
117
114
  JSONObject json = new JSONObject(new JSONTokener(jsonString));
118
115
  return new BundleInfo(
@@ -124,8 +121,8 @@ public class BundleInfo {
124
121
  );
125
122
  }
126
123
 
127
- public JSObject toJSON() {
128
- final JSObject result = new JSObject();
124
+ public Map<String, Object> toJSONMap() {
125
+ final Map<String, Object> result = new HashMap<>();
129
126
  result.put("id", this.getId());
130
127
  result.put("version", this.getVersionName());
131
128
  result.put("downloaded", this.getDownloaded());
@@ -149,6 +146,23 @@ public class BundleInfo {
149
146
 
150
147
  @Override
151
148
  public String toString() {
152
- return this.toJSON().toString();
149
+ return (
150
+ "BundleInfo{" +
151
+ "id='" +
152
+ getId() +
153
+ '\'' +
154
+ ", version='" +
155
+ getVersionName() +
156
+ '\'' +
157
+ ", downloaded='" +
158
+ getDownloaded() +
159
+ '\'' +
160
+ ", checksum='" +
161
+ getChecksum() +
162
+ '\'' +
163
+ ", status=" +
164
+ getStatus() +
165
+ '}'
166
+ );
153
167
  }
154
168
  }
@@ -6,8 +6,8 @@
6
6
 
7
7
  package ee.forgr.capacitor_updater;
8
8
 
9
- import com.getcapacitor.JSObject;
9
+ import java.util.Map;
10
10
 
11
11
  public interface Callback {
12
- void callback(JSObject jsoObject);
12
+ void callback(Map<String, Object> result);
13
13
  }