Android id support
This commit is contained in:
parent
9613276658
commit
a4745e06fc
2 changed files with 22 additions and 1 deletions
|
@ -1 +1 @@
|
|||
Subproject commit 4baf8e58a95255bda04ef6e03ec1d01665e80c4a
|
||||
Subproject commit 579bc57809441c9e939c65f6233bf51b883f043e
|
|
@ -34,6 +34,7 @@ import in.celest.xash3d.hl.BuildConfig;
|
|||
import in.celest.xash3d.XashConfig;
|
||||
import in.celest.xash3d.JoystickHandler;
|
||||
import in.celest.xash3d.CertCheck;
|
||||
import android.provider.Settings.Secure;
|
||||
|
||||
/**
|
||||
Xash Activity
|
||||
|
@ -805,6 +806,26 @@ public class XashActivity extends Activity {
|
|||
|
||||
}
|
||||
|
||||
public static String getAndroidID()
|
||||
{
|
||||
String str = Secure.getString( mSingleton.getContentResolver(), Secure.ANDROID_ID );
|
||||
if( str == null )
|
||||
return "";
|
||||
return str;
|
||||
}
|
||||
|
||||
public static String loadID()
|
||||
{
|
||||
return mPref.getString("xash_id", "");
|
||||
}
|
||||
|
||||
public static void saveID(String id)
|
||||
{
|
||||
SharedPreferences.Editor editor = mPref.edit();
|
||||
|
||||
editor.putString( "xash_id", id );
|
||||
editor.commit();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue