Skip to content

Commit

Permalink
fix: android studio error
Browse files Browse the repository at this point in the history
  • Loading branch information
riderx committed Mar 19, 2024
1 parent 29e4a1c commit 217062a
Showing 1 changed file with 15 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public class CapacitorUpdaterPlugin extends Plugin {
private static final String channelUrlDefault =
"https://api.capgo.app/channel_self";

private final String PLUGIN_VERSION = "5.7.11";
private final String PLUGIN_VERSION = "5.7.9";
private static final String DELAY_CONDITION_PREFERENCES = "";

private SharedPreferences.Editor editor;
Expand Down Expand Up @@ -473,7 +473,7 @@ public void unsetChannel(final PluginCall call) {
CapacitorUpdater.TAG,
"unsetChannel triggerAutoUpdate: " + triggerAutoUpdate
);
startNewThread(() -> {
startNewThread(() ->
CapacitorUpdaterPlugin.this.implementation.unsetChannel(res -> {
if (res.has("error")) {
call.reject(res.getString("error"));
Expand All @@ -490,8 +490,8 @@ public void unsetChannel(final PluginCall call) {
}
call.resolve(res);
}
});
});
})
);
} catch (final Exception e) {
Log.e(CapacitorUpdater.TAG, "Failed to unsetChannel: ", e);
call.reject("Failed to unsetChannel: ", e);
Expand All @@ -516,7 +516,7 @@ public void setChannel(final PluginCall call) {
CapacitorUpdater.TAG,
"setChannel " + channel + " triggerAutoUpdate: " + triggerAutoUpdate
);
startNewThread(() -> {
startNewThread(() ->
CapacitorUpdaterPlugin.this.implementation.setChannel(
channel,
res -> {
Expand All @@ -536,8 +536,8 @@ public void setChannel(final PluginCall call) {
call.resolve(res);
}
}
);
});
)
);
} catch (final Exception e) {
Log.e(CapacitorUpdater.TAG, "Failed to setChannel: " + channel, e);
call.reject("Failed to setChannel: " + channel, e);
Expand All @@ -548,15 +548,15 @@ public void setChannel(final PluginCall call) {
public void getChannel(final PluginCall call) {
try {
Log.i(CapacitorUpdater.TAG, "getChannel");
startNewThread(() -> {
startNewThread(() ->
CapacitorUpdaterPlugin.this.implementation.getChannel(res -> {
if (res.has("error")) {
call.reject(res.getString("error"));
} else {
call.resolve(res);
}
});
});
})
);
} catch (final Exception e) {
Log.e(CapacitorUpdater.TAG, "Failed to getChannel", e);
call.reject("Failed to getChannel", e);
Expand Down Expand Up @@ -748,7 +748,7 @@ public void list(final PluginCall call) {

@PluginMethod
public void getLatest(final PluginCall call) {
startNewThread(() -> {
startNewThread(() ->
CapacitorUpdaterPlugin.this.implementation.getLatest(
CapacitorUpdaterPlugin.this.updateUrl,
res -> {
Expand All @@ -775,8 +775,8 @@ public void getLatest(final PluginCall call) {
}
call.resolve(ret);
}
);
});
)
);
}

private boolean _reset(final Boolean toLastSuccessful) {
Expand Down Expand Up @@ -843,7 +843,6 @@ public void run() {
CapacitorUpdater.TAG,
Objects.requireNonNull(res.getString("error"))
);
return;
} else if (res.has("version")) {
String newVersion = res.getString("version");
String currentVersion = String.valueOf(
Expand Down Expand Up @@ -1070,7 +1069,7 @@ private void checkAppReady() {

private boolean isValidURL(String urlStr) {
try {
URL url = new URL(urlStr);
new URL(urlStr);
return true;
} catch (MalformedURLException e) {
return false;
Expand All @@ -1084,10 +1083,7 @@ private void endBackGroundTaskWithNotif(
Boolean error
) {
if (error) {
Log.i(
CapacitorUpdater.TAG,
"endBackGroundTaskWithNotif error" + error.toString()
);
Log.i(CapacitorUpdater.TAG, "endBackGroundTaskWithNotif error" + error);
this.implementation.sendStats("download_fail", current.getVersionName());
final JSObject ret = new JSObject();
ret.put("version", latestVersionName);
Expand Down

0 comments on commit 217062a

Please sign in to comment.