@capgo/capacitor-updater 7.23.1 → 7.23.3

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.
@@ -71,7 +71,7 @@ public class CapacitorUpdaterPlugin extends Plugin {
71
71
  private static final String[] BREAKING_EVENT_NAMES = { "breakingAvailable", "majorAvailable" };
72
72
  private static final String LAST_FAILED_BUNDLE_PREF_KEY = "CapacitorUpdater.lastFailedBundle";
73
73
 
74
- private final String PLUGIN_VERSION = "7.23.1";
74
+ private final String PLUGIN_VERSION = "7.23.3";
75
75
  private static final String DELAY_CONDITION_PREFERENCES = "";
76
76
 
77
77
  private SharedPreferences.Editor editor;
@@ -276,9 +276,6 @@ public class CapacitorUpdaterPlugin extends Plugin {
276
276
  }
277
277
  logger.info("appId: " + implementation.appId);
278
278
 
279
- // Update User-Agent for shared OkHttpClient
280
- DownloadService.updateUserAgent(this.implementation.appId, this.PLUGIN_VERSION);
281
-
282
279
  this.persistCustomId = this.getConfig().getBoolean("persistCustomId", false);
283
280
  this.persistModifyUrl = this.getConfig().getBoolean("persistModifyUrl", false);
284
281
  this.implementation.publicKey = this.getConfig().getString("publicKey", "");
@@ -316,6 +313,10 @@ public class CapacitorUpdaterPlugin extends Plugin {
316
313
  this.implementation.deviceID = this.prefs.getString("appUUID", UUID.randomUUID().toString()).toLowerCase();
317
314
  this.editor.putString("appUUID", this.implementation.deviceID);
318
315
  this.editor.apply();
316
+
317
+ // Update User-Agent for shared OkHttpClient with OS version
318
+ DownloadService.updateUserAgent(this.implementation.appId, this.PLUGIN_VERSION, this.implementation.versionOs);
319
+
319
320
  if (Boolean.TRUE.equals(this.persistCustomId)) {
320
321
  final String storedCustomId = this.prefs.getString(CUSTOM_ID_PREF_KEY, "");
321
322
  if (storedCustomId != null && !storedCustomId.isEmpty()) {
@@ -70,6 +70,7 @@ public class DownloadService extends Worker {
70
70
  protected static OkHttpClient sharedClient;
71
71
  private static String currentAppId = "unknown";
72
72
  private static String currentPluginVersion = "unknown";
73
+ private static String currentVersionOs = "unknown";
73
74
 
74
75
  // Initialize shared client with User-Agent interceptor
75
76
  static {
@@ -82,7 +83,8 @@ public class DownloadService extends Worker {
82
83
  (currentPluginVersion != null ? currentPluginVersion : "unknown") +
83
84
  " (" +
84
85
  (currentAppId != null ? currentAppId : "unknown") +
85
- ")";
86
+ ") android/" +
87
+ (currentVersionOs != null ? currentVersionOs : "unknown");
86
88
  Request requestWithUserAgent = originalRequest.newBuilder().header("User-Agent", userAgent).build();
87
89
  return chain.proceed(requestWithUserAgent);
88
90
  })
@@ -90,10 +92,13 @@ public class DownloadService extends Worker {
90
92
  }
91
93
 
92
94
  // Method to update User-Agent values
93
- public static void updateUserAgent(String appId, String pluginVersion) {
95
+ public static void updateUserAgent(String appId, String pluginVersion, String versionOs) {
94
96
  currentAppId = appId != null ? appId : "unknown";
95
97
  currentPluginVersion = pluginVersion != null ? pluginVersion : "unknown";
96
- logger.debug("Updated User-Agent: CapacitorUpdater/" + currentPluginVersion + " (" + currentAppId + ")");
98
+ currentVersionOs = versionOs != null ? versionOs : "unknown";
99
+ logger.debug(
100
+ "Updated User-Agent: CapacitorUpdater/" + currentPluginVersion + " (" + currentAppId + ") android/" + currentVersionOs
101
+ );
97
102
  }
98
103
 
99
104
  public DownloadService(@NonNull Context context, @NonNull WorkerParameters params) {
@@ -54,7 +54,7 @@ public class CapacitorUpdaterPlugin: CAPPlugin, CAPBridgedPlugin {
54
54
  CAPPluginMethod(name: "isShakeMenuEnabled", returnType: CAPPluginReturnPromise)
55
55
  ]
56
56
  public var implementation = CapgoUpdater()
57
- private let PLUGIN_VERSION: String = "7.23.1"
57
+ private let PLUGIN_VERSION: String = "7.23.3"
58
58
  static let updateUrlDefault = "https://plugin.capgo.app/updates"
59
59
  static let statsUrlDefault = "https://plugin.capgo.app/stats"
60
60
  static let channelUrlDefault = "https://plugin.capgo.app/channel_self"
@@ -45,7 +45,7 @@ import UIKit
45
45
  private var userAgent: String {
46
46
  let safePluginVersion = PLUGIN_VERSION.isEmpty ? "unknown" : PLUGIN_VERSION
47
47
  let safeAppId = appId.isEmpty ? "unknown" : appId
48
- return "CapacitorUpdater/\(safePluginVersion) (\(safeAppId))"
48
+ return "CapacitorUpdater/\(safePluginVersion) (\(safeAppId)) ios/\(versionOs)"
49
49
  }
50
50
 
51
51
  private lazy var alamofireSession: Session = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capgo/capacitor-updater",
3
- "version": "7.23.1",
3
+ "version": "7.23.3",
4
4
  "license": "MPL-2.0",
5
5
  "description": "Live update for capacitor apps",
6
6
  "main": "dist/plugin.cjs.js",