Skip to content

Commit

Permalink
fix: uuid android
Browse files Browse the repository at this point in the history
  • Loading branch information
riderx committed Jul 31, 2022
1 parent a4ab8cf commit a2d50e1
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import java.util.Date;
import java.util.Iterator;
import java.util.List;
import java.util.UUID;

@CapacitorPlugin(name = "CapacitorUpdater")
public class CapacitorUpdaterPlugin extends Plugin implements Application.ActivityLifecycleCallbacks {
Expand Down Expand Up @@ -87,7 +88,8 @@ public void notifyDownload(final String id, final int percent) {
this.implementation.prefs = this.prefs;
this.implementation.editor = this.editor;
this.implementation.versionOs = Build.VERSION.RELEASE;
this.implementation.deviceID = Settings.Secure.getString(this.getContext().getContentResolver(), Settings.Secure.ANDROID_ID);
this.implementation.deviceID = this.prefs.getString("appUUID", UUID.randomUUID().toString());
this.editor.putString("appUUID", this.implementation.deviceID);
Log.e(CapacitorUpdater.TAG, "init for device " + this.implementation.deviceID);

this.autoDeleteFailed = this.getConfig().getBoolean("autoDeleteFailed", true);
Expand Down

0 comments on commit a2d50e1

Please sign in to comment.