Changed android UUID flow, again

This commit is contained in:
Anuken
2018-03-08 22:36:22 -05:00
parent 2a306d70be
commit 1d83e94ad6
2 changed files with 15 additions and 19 deletions
@@ -108,7 +108,15 @@ public class AndroidLauncher extends AndroidApplication{
String s = Secure.getString(getContext().getContentResolver(), String s = Secure.getString(getContext().getContentResolver(),
Secure.ANDROID_ID); Secure.ANDROID_ID);
if(s == null){ int len = s.length();
byte[] data = new byte[len / 2];
for (int i = 0; i < len; i += 2) {
data[i / 2] = (byte) ((Character.digit(s.charAt(i), 16) << 4)
+ Character.digit(s.charAt(i + 1), 16));
}
return data;
}catch (Exception e){
Settings.defaults("uuid", ""); Settings.defaults("uuid", "");
String uuid = Settings.getString("uuid"); String uuid = Settings.getString("uuid");
@@ -122,18 +130,6 @@ public class AndroidLauncher extends AndroidApplication{
} }
return Base64Coder.decode(uuid); return Base64Coder.decode(uuid);
} }
int len = s.length();
byte[] data = new byte[len / 2];
for (int i = 0; i < len; i += 2) {
data[i / 2] = (byte) ((Character.digit(s.charAt(i), 16) << 4)
+ Character.digit(s.charAt(i + 1), 16));
}
return data;
}catch (Exception e){
return null;
}
} }
}; };
+3 -3
View File
@@ -1,7 +1,7 @@
#Autogenerated file. Do not modify. #Autogenerated file. Do not modify.
#Thu Mar 08 20:46:47 EST 2018 #Thu Mar 08 22:36:02 EST 2018
version=release version=release
androidBuildCode=357 androidBuildCode=359
name=Mindustry name=Mindustry
code=3.4 code=3.4
build=33 build=custom build