mirror of
https://github.com/Anuken/Mindustry.git
synced 2024-09-23 14:27:56 +03:00
Changed android UUID flow, again
This commit is contained in:
parent
2a306d70be
commit
1d83e94ad6
@ -108,21 +108,6 @@ public class AndroidLauncher extends AndroidApplication{
|
||||
String s = Secure.getString(getContext().getContentResolver(),
|
||||
Secure.ANDROID_ID);
|
||||
|
||||
if(s == null){
|
||||
Settings.defaults("uuid", "");
|
||||
|
||||
String uuid = Settings.getString("uuid");
|
||||
if(uuid.isEmpty()){
|
||||
byte[] result = new byte[8];
|
||||
new Random().nextBytes(result);
|
||||
uuid = new String(Base64Coder.encode(result));
|
||||
Settings.putString("uuid", uuid);
|
||||
Settings.save();
|
||||
return result;
|
||||
}
|
||||
return Base64Coder.decode(uuid);
|
||||
}
|
||||
|
||||
int len = s.length();
|
||||
byte[] data = new byte[len / 2];
|
||||
for (int i = 0; i < len; i += 2) {
|
||||
@ -132,7 +117,18 @@ public class AndroidLauncher extends AndroidApplication{
|
||||
|
||||
return data;
|
||||
}catch (Exception e){
|
||||
return null;
|
||||
Settings.defaults("uuid", "");
|
||||
|
||||
String uuid = Settings.getString("uuid");
|
||||
if(uuid.isEmpty()){
|
||||
byte[] result = new byte[8];
|
||||
new Random().nextBytes(result);
|
||||
uuid = new String(Base64Coder.encode(result));
|
||||
Settings.putString("uuid", uuid);
|
||||
Settings.save();
|
||||
return result;
|
||||
}
|
||||
return Base64Coder.decode(uuid);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -1,7 +1,7 @@
|
||||
#Autogenerated file. Do not modify.
|
||||
#Thu Mar 08 20:46:47 EST 2018
|
||||
#Thu Mar 08 22:36:02 EST 2018
|
||||
version=release
|
||||
androidBuildCode=357
|
||||
androidBuildCode=359
|
||||
name=Mindustry
|
||||
code=3.4
|
||||
build=33
|
||||
build=custom build
|
||||
|
Loading…
Reference in New Issue
Block a user