2023-10-21 14:07:35 +00:00
|
|
|
|
package com.muqingbfq;
|
|
|
|
|
|
2023-11-22 10:11:08 +00:00
|
|
|
|
import android.annotation.SuppressLint;
|
2023-10-21 14:07:35 +00:00
|
|
|
|
import android.content.Context;
|
|
|
|
|
import android.content.Intent;
|
2023-11-22 10:11:08 +00:00
|
|
|
|
import android.os.Build;
|
2023-10-21 14:07:35 +00:00
|
|
|
|
import android.os.Bundle;
|
2023-11-22 10:11:08 +00:00
|
|
|
|
import android.provider.Settings;
|
|
|
|
|
import android.util.DisplayMetrics;
|
2023-10-21 14:07:35 +00:00
|
|
|
|
import android.widget.TextView;
|
|
|
|
|
|
|
|
|
|
import androidx.annotation.Nullable;
|
|
|
|
|
import androidx.appcompat.app.AppCompatActivity;
|
|
|
|
|
|
2023-11-22 10:11:08 +00:00
|
|
|
|
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
|
|
|
|
|
|
2023-10-21 14:07:35 +00:00
|
|
|
|
public class yc extends AppCompatActivity {
|
|
|
|
|
public static Object exception;
|
2023-11-22 10:11:08 +00:00
|
|
|
|
|
2023-10-21 14:07:35 +00:00
|
|
|
|
@Override
|
|
|
|
|
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
|
|
|
|
super.onCreate(savedInstanceState);
|
|
|
|
|
setContentView(R.layout.activity_yc);
|
|
|
|
|
TextView text = findViewById(R.id.text);
|
2023-11-22 10:11:08 +00:00
|
|
|
|
|
|
|
|
|
String deviceModel = Build.MODEL;
|
|
|
|
|
String deviceManufacturer = Build.MANUFACTURER;
|
|
|
|
|
String osVersion = Build.VERSION.RELEASE;
|
|
|
|
|
int sdkVersion = Build.VERSION.SDK_INT;
|
|
|
|
|
@SuppressLint("HardwareIds") String deviceId = Settings.Secure.getString(getContentResolver(), Settings.Secure.ANDROID_ID);
|
|
|
|
|
DisplayMetrics metrics = getResources().getDisplayMetrics();
|
|
|
|
|
int widthPixels = metrics.widthPixels;
|
|
|
|
|
int heightPixels = metrics.heightPixels;
|
|
|
|
|
float density = metrics.density;
|
|
|
|
|
int densityDpi = metrics.densityDpi;
|
|
|
|
|
// 假设你已经获取到了手机信息,保存在相应的变量中
|
|
|
|
|
String wb = "设备型号:" + deviceModel + "\n"
|
|
|
|
|
+ "制造商:" + deviceManufacturer + "\n"
|
|
|
|
|
+ "设备ID:" + deviceId + "\n"
|
|
|
|
|
+ "操作系统版本:" + osVersion + "\n"
|
|
|
|
|
+ "SDK版本:" + sdkVersion + "\n"
|
|
|
|
|
+ "屏幕尺寸:" + widthPixels + "x" + heightPixels + "\n"
|
|
|
|
|
+ "屏幕密度:" + density + "\n"
|
|
|
|
|
+ "密度DPI:" + densityDpi + "\n" +
|
|
|
|
|
"异常信息: " + exception.toString();
|
|
|
|
|
text.setText(wb);
|
2023-10-21 14:07:35 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static void start(Object e) {
|
2023-10-22 05:46:52 +00:00
|
|
|
|
start(home.appCompatActivity, e);
|
2023-10-21 14:07:35 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static void start(Context context, Object e) {
|
|
|
|
|
yc.exception = e;
|
2023-11-22 10:11:08 +00:00
|
|
|
|
context.startActivity(new Intent(context, yc.class));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static void tc(Context context, Object exception) {
|
|
|
|
|
new MaterialAlertDialogBuilder(context)
|
|
|
|
|
.setTitle("不是特别重要的警告")
|
|
|
|
|
.setMessage(exception.toString())
|
|
|
|
|
.setNegativeButton("无视", null)
|
|
|
|
|
.setPositiveButton("分享", null)
|
|
|
|
|
.show();
|
2023-10-21 14:07:35 +00:00
|
|
|
|
}
|
|
|
|
|
}
|