一些平台可以通過單刷eng版本的boot.imag來root user版本,如果無法通過單刷bootimage來root,可以通過修改**,使預設開啟root。
1.1system/core/adb/ android.mk修改如下:
//local_cflags +=-dallow_adbd_root=$(if $(filter userdebug eng,$(target_build_variant)),1,0)
local_cflags += -dallow_adbd_root=$(if $(filter user userdebug eng,$(target_build_variant)),1,0)
local_cflags += -dallow_adbd_no_auth=$(if $(filter userdebug eng,$(target_build_variant)),1,0)
10.0平台使用system/core/adb/ android.bp修改如下
cflags: [
"-wall",
"-wextra",
"-werror",
"-wexit-time-destructors",
"-wno-unused-parameter",
"-wno-missing-field-initializers",
"-wthread-safety",
"-wvla",
"-dadb_host=1", // overridden by adbd_defaults
"-dallow_adbd_root=1", // overridden by adbd_defaults
"-dallow_adbd_disable_verity=1",
],cc_defaults ,
},}
1.2system/core/adb/ services.cpp修改如下:
void restart_root_service(int fd, void *cookie) else */
android::base::setproperty("service.adb.root", "1");
writefdexactly(fd, "restarting adbd as root\n");
adb_close(fd);
}}
10.0平台相關修改移到system/core/adb/daemon/restart_service.cpp
void restart_root_service(unique_fd fd)
/* if (!__android_log_is_debuggable()) */
log(info) << "adbd restarting as root";
android::base::setproperty("service.adb.root", "1");
writefdexactly(fd.get(), "restarting adbd as root\n");
}
1.3關閉selinux,system/core/init/init.cpp修改如下:
enum selinux_enforcing_status ;
static selinux_enforcing_status selinux_status_from_cmdline()
});//return status;
return selinux_permissive;
}static bool selinux_is_enforcing(void)
//return true;
return false;
}
9.0以後平台相關修改移到system/core/init/selinux.cpp檔案
enum enforcingstatus ;
enforcingstatus statusfromcmdline()
bool isenforcing()
//return true;
return false;
}
1.4system/core/adb/daemon/main.cpp修改如下:
static bool should_drop_capabilities_bounding_set()
}//return true;
return false;
}
1.5system/core/liblog/properties.c修改如下:
liblog_abi_public int __android_log_is_debuggable()
//return ret;
return 1;
}
kernel/msm-4.9/arch/arm64/configs/*product*-perf_defconfig新增如下
config_serial_msm=y
config_serial_msm_console=y
3.1在/device/qcom/sepolicy/vendor/common/shell.te修改如下:
diff --git a/vendor/common/shell.te b/vendor/common/shell.te
index 901b56c..13f7b20 100644
--- a/vendor/common/shell.te
+++ b/vendor/common/shell.te
@@ -35,3 +35,4 @@ r_dir_file(shell, qti_logkit_pub_data_file)
# allow shell permissions to perf
get_prop(shell, vendor_mpctl_prop);
+allow shell kernel:system ;
3.2解決se衝突,在system/sepolicy/下修改如下:
index 439c1f8..3b664ce 100644
proc:dir_file_class_set write;
# access to syslog(2) or /proc/kmsg.
index 439c1f8..3b664ce 100644
proc:dir_file_class_set write;
# access to syslog(2) or /proc/kmsg.
高通user版本diag口無法正常連線QXDM除錯
modem同事除錯網路問題,需要連qxdm讀取裝置資訊和抓取log,正常不做修改的user版本只有9091的埠,但是無法正常連線除錯.出於對廠商安全的考慮 修改如下,cts版本不建議修改,修改位置 遮蔽userdebug or eng的限制 userdebug or eng allow kernel...
高通平台Bring up
3.2.amss 部分編譯 主要由以下部分構成 adsp,boot,debug,modem,rpm,trustzone,wcnss,分別根據高通的說明編譯這些模組,不過其中有些模組我們不會改,直接用release的binary檔案就行,比如 debug,rpm,trustzone,wcnss。3.3...
高通平台mipi panel kernel讀包方法
熟悉高通平台mipi panel kernel讀包方法,我想我們可以是的同一客戶要是使用2塊mipi panel的話我想我們可以通過讀取id來下不同序列而不用更換boot.img,還有能否讀id可以說明mipi通訊是否正常。還有我們只需在lk下面讀一次id再對全域性變數賦值通過lk傳遞到kernel...