View Full Version : بدست آوردن IMEI گوشی با کمک AndroidId ?
  
hamedg1366
سه شنبه 13 شهریور 1397, 09:27 صبح
با سلام خدمت همه عزیزان
آیا راه حلی هستش که بشه با کمک اندروید آیدی به شماره imei همون گوشی رسید ؟ (گوشی دستم نیس و گم شده فقط اندروید آیدیش رو دارم)
لطفا در این زمینه منو راهنمائی بفرمائید
با تشکر
afi_program
سه شنبه 13 شهریور 1397, 17:01 عصر
با کد زیر:
public String getDeviceIMEI() {
    String deviceUniqueIdentifier = null;
TelephonyManager tm = (TelephonyManager) this.getSystemService(Context.TELEPHONY_SERVICE);
    if (null != tm) {
        if (ActivityCompat.checkSelfPermission(this, Manifest.permission.READ_PHONE_STATE) != PackageManager.PERMISSION_GRANTED) {
            // TODO: Consider calling
//    ActivityCompat#requestPermissions
            // here to request the missing permissions, and then overriding
            //   public void onRequestPermissionsResult(int requestCode, String[] permissions,
            //                                          int[] grantResults)
            // to handle the case where the user grants the permission. See the documentation
            // for ActivityCompat#requestPermissions for more details.
            //return TODO;
return "!!!!!";
}
        deviceUniqueIdentifier = tm.getDeviceId();
}
    if (null == deviceUniqueIdentifier || 0 == deviceUniqueIdentifier.length()) {
        deviceUniqueIdentifier = Settings.Secure.getString(this.getContentResolver( ), Settings.Secure.ANDROID_ID);
}    return deviceUniqueIdentifier;
}
hamedg1366
چهارشنبه 14 شهریور 1397, 17:17 عصر
با کد زیر:
public String getDeviceIMEI() {
    String deviceUniqueIdentifier = null;
TelephonyManager tm = (TelephonyManager) this.getSystemService(Context.TELEPHONY_SERVICE);
    if (null != tm) {
        if (ActivityCompat.checkSelfPermission(this, Manifest.permission.READ_PHONE_STATE) != PackageManager.PERMISSION_GRANTED) {
            // TODO: Consider calling
//    ActivityCompat#requestPermissions
            // here to request the missing permissions, and then overriding
            //   public void onRequestPermissionsResult(int requestCode, String[] permissions,
            //                                          int[] grantResults)
            // to handle the case where the user grants the permission. See the documentation
            // for ActivityCompat#requestPermissions for more details.
            //return TODO;
return "!!!!!";
}
        deviceUniqueIdentifier = tm.getDeviceId();
}
    if (null == deviceUniqueIdentifier || 0 == deviceUniqueIdentifier.length()) {
        deviceUniqueIdentifier = Settings.Secure.getString(this.getContentResolver( ), Settings.Secure.ANDROID_ID);
}    return deviceUniqueIdentifier;
}
با تشکر از شما ؛ متاسفانه بنده متوجه کدهای شما نشدم ؛ اما اگه کد زیر هستش که بنظر هم همینطور میاد ، این کد در رابطه با بدست آوردن Imei گوشی از خود گوشی هستش ؛ متاسفانه گوشی رو ندارم من و فقط AndroidId رو میدونم چی هستش
/**
 * Returns the unique identifier for the device
 *
 * @return unique identifier for the device
 */
public String getDeviceIMEI() {
    String deviceUniqueIdentifier = null;
    TelephonyManager tm = (TelephonyManager) this.getSystemService(Context.TELEPHONY_SERVICE);
    if (null != tm) {
        deviceUniqueIdentifier = tm.getDeviceId();
    }
    if (null == deviceUniqueIdentifier || 0 == deviceUniqueIdentifier.length()) {
        deviceUniqueIdentifier = Settings.Secure.getString(this.getContentResolver( ), Settings.Secure.ANDROID_ID);
    }
    return deviceUniqueIdentifier;
}
#root#
پنج شنبه 15 شهریور 1397, 13:18 عصر
اگر به حساب کاربری گوگلتون توی گوشی لاگین کرده بودین، میشه پیداش کرد، برای اطلاعات بیشتر جستجو کنید:
how to find imei number without phone or box
 
vBulletin® v4.2.5, Copyright ©2000-1404, Jelsoft Enterprises Ltd.