Skip to content

Commit 7532586

Browse files
committed
fix: pluginVersion lint issue
1 parent bc18393 commit 7532586

File tree

6 files changed

+15
-15
lines changed

6 files changed

+15
-15
lines changed

android/src/main/java/ee/forgr/capacitor_updater/CapacitorUpdaterPlugin.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public class CapacitorUpdaterPlugin extends Plugin {
7171
private static final String[] BREAKING_EVENT_NAMES = { "breakingAvailable", "majorAvailable" };
7272
private static final String LAST_FAILED_BUNDLE_PREF_KEY = "CapacitorUpdater.lastFailedBundle";
7373

74-
private final String PLUGIN_VERSION = "7.23.13";
74+
private final String pluginVersion = "7.23.13";
7575
private static final String DELAY_CONDITION_PREFERENCES = "";
7676

7777
private SharedPreferences.Editor editor;
@@ -219,7 +219,7 @@ public void notifyListeners(final String id, final Map<String, Object> res) {
219219
this.implementation.activity = this.getActivity();
220220
this.implementation.versionBuild = this.getConfig().getString("version", pInfo.versionName);
221221
this.implementation.CAP_SERVER_PATH = WebView.CAP_SERVER_PATH;
222-
this.implementation.PLUGIN_VERSION = this.PLUGIN_VERSION;
222+
this.implementation.pluginVersion = this.pluginVersion;
223223
this.implementation.versionCode = Integer.toString(pInfo.versionCode);
224224
// Removed unused OkHttpClient creation - using shared client in DownloadService instead
225225
// Handle directUpdate configuration - support string values and backward compatibility
@@ -313,7 +313,7 @@ public void notifyListeners(final String id, final Map<String, Object> res) {
313313
this.editor.apply();
314314

315315
// Update User-Agent for shared OkHttpClient with OS version
316-
DownloadService.updateUserAgent(this.implementation.appId, this.PLUGIN_VERSION, this.implementation.versionOs);
316+
DownloadService.updateUserAgent(this.implementation.appId, this.pluginVersion, this.implementation.versionOs);
317317

318318
if (Boolean.TRUE.equals(this.persistCustomId)) {
319319
final String storedCustomId = this.prefs.getString(CUSTOM_ID_PREF_KEY, "");
@@ -810,7 +810,7 @@ public void setCustomId(final PluginCall call) {
810810
public void getPluginVersion(final PluginCall call) {
811811
try {
812812
final JSObject ret = new JSObject();
813-
ret.put("version", this.PLUGIN_VERSION);
813+
ret.put("version", this.pluginVersion);
814814
call.resolve(ret);
815815
} catch (final Exception e) {
816816
logger.error("Could not get plugin version " + e.getMessage());

android/src/main/java/ee/forgr/capacitor_updater/CapgoUpdater.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public class CapgoUpdater {
6666
public File documentsDir;
6767
public Boolean directUpdate = false;
6868
public Activity activity;
69-
public String PLUGIN_VERSION = "";
69+
public String pluginVersion = "";
7070
public String versionBuild = "";
7171
public String versionCode = "";
7272
public String versionOs = "";
@@ -353,7 +353,7 @@ private void download(
353353
manifest != null,
354354
this.isEmulator(),
355355
this.appId,
356-
this.PLUGIN_VERSION
356+
this.pluginVersion
357357
);
358358

359359
if (manifest != null) {
@@ -775,7 +775,7 @@ private JSONObject createInfoObject() throws JSONException {
775775
json.put("version_code", this.versionCode);
776776
json.put("version_os", this.versionOs);
777777
json.put("version_name", this.getCurrentBundle().getVersionName());
778-
json.put("plugin_version", this.PLUGIN_VERSION);
778+
json.put("plugin_version", this.pluginVersion);
779779
json.put("is_emulator", this.isEmulator());
780780
json.put("is_prod", this.isProd());
781781
json.put("defaultChannel", this.defaultChannel);

android/src/main/java/ee/forgr/capacitor_updater/DownloadService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public static void setLogger(Logger loggerInstance) {
6363
public static final String PUBLIC_KEY = "publickey";
6464
public static final String IS_MANIFEST = "is_manifest";
6565
public static final String APP_ID = "app_id";
66-
public static final String PLUGIN_VERSION = "plugin_version";
66+
public static final String pluginVersion = "plugin_version";
6767
private static final String UPDATE_FILE = "update.dat";
6868

6969
// Shared OkHttpClient to prevent resource leaks

android/src/main/java/ee/forgr/capacitor_updater/DownloadWorkerManager.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public static void enqueueDownload(
8080
.putBoolean(DownloadService.IS_MANIFEST, isManifest)
8181
.putString(DownloadService.PUBLIC_KEY, publicKey)
8282
.putString(DownloadService.APP_ID, appId)
83-
.putString(DownloadService.PLUGIN_VERSION, pluginVersion)
83+
.putString(DownloadService.pluginVersion, pluginVersion)
8484
.build();
8585

8686
// Create network constraints - be more lenient on emulators

ios/Sources/CapacitorUpdaterPlugin/CapacitorUpdaterPlugin.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public class CapacitorUpdaterPlugin: CAPPlugin, CAPBridgedPlugin {
5454
CAPPluginMethod(name: "isShakeMenuEnabled", returnType: CAPPluginReturnPromise)
5555
]
5656
public var implementation = CapgoUpdater()
57-
private let PLUGIN_VERSION: String = "7.23.13"
57+
private let pluginVersion: String = "7.23.13"
5858
static let updateUrlDefault = "https://plugin.capgo.app/updates"
5959
static let statsUrlDefault = "https://plugin.capgo.app/stats"
6060
static let channelUrlDefault = "https://plugin.capgo.app/channel_self"
@@ -183,7 +183,7 @@ public class CapacitorUpdaterPlugin: CAPPlugin, CAPBridgedPlugin {
183183

184184
implementation.publicKey = getConfig().getString("publicKey", "")!
185185
implementation.notifyDownloadRaw = notifyDownload
186-
implementation.PLUGIN_VERSION = self.PLUGIN_VERSION
186+
implementation.pluginVersion = self.pluginVersion
187187

188188
// Set logger for shared classes
189189
implementation.setLogger(logger)
@@ -436,7 +436,7 @@ public class CapacitorUpdaterPlugin: CAPPlugin, CAPBridgedPlugin {
436436
}
437437

438438
@objc func getPluginVersion(_ call: CAPPluginCall) {
439-
call.resolve(["version": self.PLUGIN_VERSION])
439+
call.resolve(["version": self.pluginVersion])
440440
}
441441

442442
@objc func download(_ call: CAPPluginCall) {

ios/Sources/CapacitorUpdaterPlugin/CapgoUpdater.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ import UIKit
3333
public let CAP_SERVER_PATH: String = "serverBasePath"
3434
public var versionBuild: String = ""
3535
public var customId: String = ""
36-
public var PLUGIN_VERSION: String = ""
36+
public var pluginVersion: String = ""
3737
public var timeout: Double = 20
3838
public var statsUrl: String = ""
3939
public var channelUrl: String = ""
@@ -49,7 +49,7 @@ import UIKit
4949
private static var rateLimitStatisticSent = false
5050

5151
private var userAgent: String {
52-
let safePluginVersion = PLUGIN_VERSION.isEmpty ? "unknown" : PLUGIN_VERSION
52+
let safePluginVersion = pluginVersion.isEmpty ? "unknown" : pluginVersion
5353
let safeAppId = appId.isEmpty ? "unknown" : appId
5454
return "CapacitorUpdater/\(safePluginVersion) (\(safeAppId)) ios/\(versionOs)"
5555
}
@@ -313,7 +313,7 @@ import UIKit
313313
version_code: self.versionCode,
314314
version_os: self.versionOs,
315315
version_name: self.getCurrentBundle().getVersionName(),
316-
plugin_version: self.PLUGIN_VERSION,
316+
plugin_version: self.pluginVersion,
317317
is_emulator: self.isEmulator(),
318318
is_prod: self.isProd(),
319319
action: nil,

0 commit comments

Comments
 (0)