Skip to content

Commit

Permalink
fix: UUID source on android
Browse files Browse the repository at this point in the history
  • Loading branch information
riderx committed Jul 31, 2022
1 parent c8ef8b5 commit ebbe473
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import java.security.SecureRandom;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
import java.util.ArrayList;
Expand Down Expand Up @@ -67,6 +68,8 @@ public CapacitorUpdater (final Context context) throws PackageManager.NameNotFou
this.editor = this.prefs.edit();
this.versionOs = Build.VERSION.RELEASE;
this.deviceID = Secure.getString(context.getContentResolver(), Secure.ANDROID_ID);
this.deviceID = this.prefs.getString("appUUID", UUID.randomUUID().toString());
this.editor.putString("appUUID", this.deviceID);
final PackageInfo pInfo = context.getPackageManager().getPackageInfo(context.getPackageName(), 0);
this.versionBuild = pInfo.versionName;
this.versionCode = Integer.toString(pInfo.versionCode);
Expand Down

0 comments on commit ebbe473

Please sign in to comment.