|
2 | 2 |
|
3 | 3 | import android.content.Context; |
4 | 4 | import android.content.Intent; |
| 5 | +import android.os.Build; |
5 | 6 | import android.os.Bundle; |
6 | 7 | import android.support.annotation.Nullable; |
7 | 8 | import android.view.View; |
@@ -48,17 +49,32 @@ public void initView(Bundle savedInstanceState, View contentView) { |
48 | 49 | findViewById(R.id.btn_reboot_to_recovery).setOnClickListener(this); |
49 | 50 | findViewById(R.id.btn_reboot_to_bootloader).setOnClickListener(this); |
50 | 51 | TextView tvAboutDevice = findViewById(R.id.tv_about_device); |
51 | | - tvAboutDevice.setText(new SpanUtils() |
52 | | - .appendLine("isRoot: " + DeviceUtils.isDeviceRooted()) |
53 | | - .appendLine("getSDKVersionName: " + DeviceUtils.getSDKVersionName()) |
54 | | - .appendLine("getSDKVersionCode: " + DeviceUtils.getSDKVersionCode()) |
55 | | - .appendLine("getAndroidID: " + DeviceUtils.getAndroidID()) |
56 | | - .appendLine("getMacAddress: " + DeviceUtils.getMacAddress()) |
57 | | - .appendLine("getManufacturer: " + DeviceUtils.getManufacturer()) |
58 | | - .appendLine("getModel: " + DeviceUtils.getModel()) |
59 | | - .append("getABIs: " + Arrays.asList(DeviceUtils.getABIs())) |
60 | | - .create() |
61 | | - ); |
| 52 | + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) { |
| 53 | + tvAboutDevice.setText(new SpanUtils() |
| 54 | + .appendLine("isRoot: " + DeviceUtils.isDeviceRooted()) |
| 55 | + .appendLine("isAdbEnabled: " + DeviceUtils.isAdbEnabled()) |
| 56 | + .appendLine("getSDKVersionName: " + DeviceUtils.getSDKVersionName()) |
| 57 | + .appendLine("getSDKVersionCode: " + DeviceUtils.getSDKVersionCode()) |
| 58 | + .appendLine("getAndroidID: " + DeviceUtils.getAndroidID()) |
| 59 | + .appendLine("getMacAddress: " + DeviceUtils.getMacAddress()) |
| 60 | + .appendLine("getManufacturer: " + DeviceUtils.getManufacturer()) |
| 61 | + .appendLine("getModel: " + DeviceUtils.getModel()) |
| 62 | + .append("getABIs: " + Arrays.asList(DeviceUtils.getABIs())) |
| 63 | + .create() |
| 64 | + ); |
| 65 | + } else { |
| 66 | + tvAboutDevice.setText(new SpanUtils() |
| 67 | + .appendLine("isRoot: " + DeviceUtils.isDeviceRooted()) |
| 68 | + .appendLine("getSDKVersionName: " + DeviceUtils.getSDKVersionName()) |
| 69 | + .appendLine("getSDKVersionCode: " + DeviceUtils.getSDKVersionCode()) |
| 70 | + .appendLine("getAndroidID: " + DeviceUtils.getAndroidID()) |
| 71 | + .appendLine("getMacAddress: " + DeviceUtils.getMacAddress()) |
| 72 | + .appendLine("getManufacturer: " + DeviceUtils.getManufacturer()) |
| 73 | + .appendLine("getModel: " + DeviceUtils.getModel()) |
| 74 | + .append("getABIs: " + Arrays.asList(DeviceUtils.getABIs())) |
| 75 | + .create() |
| 76 | + ); |
| 77 | + } |
62 | 78 | } |
63 | 79 |
|
64 | 80 | @Override |
|
0 commit comments