导航

    全志在线开发者论坛

    • 注册
    • 登录
    • 搜索
    • 版块
    • 话题
    • 在线文档
    • 社区主页

    Android10 制作完全Root版本,A133平台验证通过

    其它全志芯片讨论区
    1
    4
    1865
    正在加载更多帖子
    • 从旧到新
    • 从新到旧
    • 最多赞同
    回复
    • 在新帖中回复
    登录后回复
    此主题已被删除。只有拥有主题管理权限的用户可以查看。
    • M
      memory LV 7 最后由 whycan 编辑

      参考链接:

      http://www.zhuoyue360.com/crack/34.html

      https://www.jianshu.com/p/b7b0361aca34

      1 条回复 最后回复 回复 引用 分享 0
      • M
        memory LV 7 最后由 编辑

        1.修改/aosp/system/extras/su/su.cpp

        // 注释掉第83-84行
        // uid_t current_uid = getuid();
        // if (current_uid != AID_ROOT && current_uid != AID_SHELL) error(1, 0, "not allowed");
        

        2.修改/aosp/system/core/libcutils/fs_config.cpp

        // the following files have enhanced capabilities and ARE included
        // in user builds.
        // 添加下面代码至212行处,注意标点符号不要漏掉
        { 06755, AID_ROOT,      AID_ROOT,      0, "system/bin/su" }
        
        1. 修改/aosp/frameworks/base/core/jni/com_android_internal_os_Zygote.cpp
        // 修改542行处,注释掉DropCapabilitiesBoundingSet方法体
        static void DropCapabilitiesBoundingSet(fail_fn_t fail_fn) {
        //   for (int i = 0; prctl(PR_CAPBSET_READ, i, 0, 0, 0) >= 0; i++) {;
        //     if (prctl(PR_CAPBSET_DROP, i, 0, 0, 0) == -1) {
        //       if (errno == EINVAL) {
        //         ALOGE("prctl(PR_CAPBSET_DROP) failed with EINVAL. Please verify "
        //               "your kernel is compiled with file capabilities support");
        //       } else {
        //         fail_fn(CREATE_ERROR("prctl(PR_CAPBSET_DROP, %d) failed: %s", i, strerror(errno)));
        //       }
        //     }
        //   }
        }
        
        1. 修改/aosp/system/core/adb/daemon/main.cpp
        // 修改should_drop_capabilities_bounding_set返回false
        static bool should_drop_capabilities_bounding_set() {
            if (ALLOW_ADBD_ROOT || is_device_unlocked()) {
                if (__android_log_is_debuggable()) {
                    return false;
                }
            }
        //    return true;
            return false;
        }
        
        1. 修改/aosp/system/core/init/selinux.cpp
        // 修改IsEnforcing方法返回false, 注释掉StatusFromCmdline方法
        // EnforcingStatus StatusFromCmdline() {
        //     EnforcingStatus status = SELINUX_ENFORCING;
        
        //     import_kernel_cmdline(false,
        //                           [&](const std::string& key, const std::string& value, bool in_qemu) {
        //                               if (key == "androidboot.selinux" && value == "permissive") {
        //                                   status = SELINUX_PERMISSIVE;
        //                               }
        //                           });
        
        //     return status;
        // }
        
        bool IsEnforcing() {
            // if (ALLOW_PERMISSIVE_SELINUX) {
                // return StatusFromCmdline() == SELINUX_ENFORCING;
            // }
            // return true;
            return false;
        }
        
        M 1 条回复 最后回复 回复 引用 分享 1
        • M
          memory LV 7 最后由 编辑

          切换到源码编译目录

          source build/envsetup.sh
          
          lunch xxxxx
          
          make update-api && make -j65536 && pack
          
          1 条回复 最后回复 回复 引用 分享 0
          • M
            memory LV 7 @memory 最后由 编辑

            @memory 在 Android10 制作完全Root版本,A133平台验证通过 中说:

            // 添加下面代码至212行处,注意标点符号不要漏掉
            { 06755, AID_ROOT, AID_ROOT, 0, "system/bin/su" }

            这里有个小坑,A133 Android10 SDK不要另外添加,找到这行修改即可!

            1 条回复 最后回复 回复 引用 分享 0
            • 1 / 1
            • First post
              Last post

            Copyright © 2024 深圳全志在线有限公司 粤ICP备2021084185号 粤公网安备44030502007680号

            行为准则 | 用户协议 | 隐私权政策