Tech

雷神改机-改机原理分析

保存OAID:

保存OAID:

 public void updateModel(JSONObject arg13) {
    try {
      this.execCommand("echo ro.product.brand=huawei > /data/adb/modules/mfcx/system.prop");
      this.execCommand("echo ro.product.manufacturer=huawei >> /data/adb/modules/mfcx/system.prop");
      this.execCommand("echo ro.product.name=" + arg13.get("device_name") + " >> /data/adb/modules/mfcx/system.prop");
      this.execCommand("echo ro.product.model=" + arg13.get("model") + " >> /data/adb/modules/mfcx/system.prop");
      this.execCommand("echo ro.product.device=" + arg13.get("model") + " >> /data/adb/modules/mfcx/system.prop");
      this.execCommand("echo ro.build.version.release=" + arg13.get("android_version") + " >> /data/adb/modules/mfcx/system.prop");
      this.execCommand("echo ro.build.display.id=" + arg13.get("version") + " >> /data/adb/modules/mfcx/system.prop");
      this.execCommand("echo ro.build.id=" + arg13.get("version") + " >> /data/adb/modules/mfcx/system.prop");
      this.execCommand("echo ro.build.system.build.id=" + arg13.get("version") + " >> /data/adb/modules/mfcx/system.prop");
      this.editor.putString("oaid", arg13.getString("oaid"));
      this.editor.putString("name", arg13.getString("device_name"));
      this.editor.commit();
      this.mode.setText(arg13.getString("device_name"));
      this.showToast("数据写入成功");
    }
    catch(JSONException v5) {
      this.showToast("数据写入失败!");
    }
  }

选择某一厂商:


public void oper(View arg15) {
    Class v9;
    if(!this.getRootAhth()) {
      this.showToast("请检查root权限!");
      return;
    }

    int v3 = arg15.getId();
    if(v3 == 0x7F080003) { // id:samsung
      this.showDialog("三星", "samsung");
      return;
    }

    if(v3 == 0x7F080004) { // id:xiaomi
      this.showDialog("小米", "xiaomi");
      return;
    }

    if(v3 == 0x7F080005) { // id:huawi
      this.showDialog("华为", "huawei");
      return;
    }

    if(v3 == 0x7F080006) { // id:oppo
      this.showDialog("OPPO", "oppo");
      return;
    }传奇Unity手游分析

    if(v3 == 0x7F080007) { // id:vivo
      this.showDialog("VIVO", "vivo");
      return;
    }

    if(v3 == 0x7F080008) { // id:setoaid
      this.showOaidDialog();
      return;
    }

    if(v3 == 0x7F080009) { // id:geturl
      this.dialog.show();
      new Thread(new 100000001(this)).start();
      return;
    }

    if(v3 == 0x7F08000A) { // id:savedevice
      Intent v4 = new Intent();
      try {
        v9 = Class.forName("mfcx.yunyou.leishengaiji.LoginActivity");
      }
      catch(ClassNotFoundException v7) {
        throw new NoClassDefFoundError(v7.getMessage());
      }

      v4.setClass(this, v9);
      this.startActivity(v4);
      return;
    }

    if(v3 == 0x7F08000B) { // id:reboot
      this.execCommand("reboot");
      return;
    }

    if(v3 == 0x7F08000C) { // id:reset
      this.reset();
      return;
    }
  }

magisk模块开发文档中: 雷神改机通过system.prop文件写入相应系统信息属性,但是该文件还有一层作用就是通过 resetprop 作为系统属性加载。以此实现改机的功能。