106 lines
3.8 KiB
Java
106 lines
3.8 KiB
Java
package pink.yuv.android_id;
|
|
|
|
import android.app.Activity;
|
|
import android.content.Context;
|
|
import android.content.pm.ApplicationInfo;
|
|
import android.content.pm.PackageManager;
|
|
import android.os.Build;
|
|
import android.os.Bundle;
|
|
import android.provider.Settings.Secure;
|
|
import android.telephony.TelephonyManager;
|
|
import android.widget.TextView;
|
|
|
|
|
|
public class MainActivity extends Activity {
|
|
@Override
|
|
public void onCreate(Bundle savedInstanceState) {
|
|
super.onCreate(savedInstanceState);
|
|
setContentView(R.layout.activity_main);
|
|
|
|
TextView androidIdTextView = (TextView)findViewById(R.id.androidId);
|
|
String android_id = Secure.getString(getContentResolver(), Secure.ANDROID_ID);
|
|
System.out.println("android_id: "+android_id);
|
|
androidIdTextView.setText("android_id: "+android_id);
|
|
|
|
String psmAppId = "app not installed";
|
|
|
|
try{
|
|
ApplicationInfo psmAppInfo = this.getApplicationContext().getPackageManager().getApplicationInfo("com.playstation.psstore", 0);
|
|
if(psmAppInfo != null)
|
|
psmAppId = String.valueOf(psmAppInfo.uid);
|
|
}
|
|
catch (PackageManager.NameNotFoundException e) { };
|
|
|
|
TextView psmAppIdTextView = (TextView)findViewById(R.id.psmAppId);
|
|
System.out.println("psstore_uid: "+psmAppId);
|
|
psmAppIdTextView.setText("psstore_uid: "+psmAppId);
|
|
|
|
Context appCtx = getApplicationContext();
|
|
TelephonyManager tm = ((TelephonyManager) appCtx.getSystemService( Context.TELEPHONY_SERVICE));
|
|
String deviceId = tm.getDeviceId();
|
|
if(deviceId == null)
|
|
deviceId = "(blank)";
|
|
|
|
String serial = Build.SERIAL;
|
|
if(serial == null)
|
|
serial = "(blank)";
|
|
|
|
String brand = Build.BRAND;
|
|
if(brand == null)
|
|
brand = "(blank)";
|
|
|
|
String manu = Build.MANUFACTURER;
|
|
if(manu == null)
|
|
manu = "(blank)";
|
|
|
|
String model = Build.MODEL;
|
|
if(model == null)
|
|
model = "(blank)";
|
|
|
|
String product = Build.PRODUCT;
|
|
if(product == null)
|
|
product = "(blank)";
|
|
|
|
String device = Build.DEVICE;
|
|
if(device == null)
|
|
device = "(blank)";
|
|
|
|
String type = Build.TYPE;
|
|
if(type == null)
|
|
type = "(blank)";
|
|
|
|
|
|
TextView devPhoneIdTextview = (TextView)findViewById(R.id.devPhoneId);
|
|
System.out.println("getDeviceId(): " + deviceId);
|
|
devPhoneIdTextview.setText("getDeviceId(): "+deviceId);
|
|
|
|
TextView devSerialTextview = (TextView)findViewById(R.id.devSerial);
|
|
System.out.println("SERIAL: " + serial);
|
|
devSerialTextview.setText("SERIAL: "+serial);
|
|
|
|
TextView devBrandTextview = (TextView)findViewById(R.id.devBrand);
|
|
System.out.println("BRAND: " + brand);
|
|
devBrandTextview.setText("BRAND: "+brand);
|
|
|
|
TextView devManuTextview = (TextView)findViewById(R.id.devManu);
|
|
System.out.println("MANUFACTURER: " + manu);
|
|
devManuTextview.setText("MANUFACTURER: "+manu);
|
|
|
|
TextView devModelTextview = (TextView)findViewById(R.id.devModel);
|
|
System.out.println("MODEL: " + model);
|
|
devModelTextview.setText("MODEL: "+model);
|
|
|
|
TextView devProductTextview = (TextView)findViewById(R.id.devProduct);
|
|
System.out.println("PRODUCT: " + product);
|
|
devProductTextview.setText("PRODUCT: "+product);
|
|
|
|
TextView devDeviceTextview = (TextView)findViewById(R.id.devDevice);
|
|
System.out.println("DEVICE: " + device);
|
|
devDeviceTextview.setText("DEVICE: "+device);
|
|
|
|
TextView devTyoeTextview = (TextView)findViewById(R.id.devType);
|
|
System.out.println("TYPE: " + type);
|
|
devTyoeTextview.setText("TYPE: "+type);
|
|
}
|
|
}
|