tag 标签: root

相关博文
  • 2025-1-8 00:06
    92 次阅读|
    0 个评论
    本文介绍编译Android13 ROOT权限固件的方法, 触觉智能RK3562开发板 演示,搭载4核A53处理器,主频高达2.0GHz;内置独立1Tops算力NPU,可应用于物联网网关、平板电脑、智能家居、教育电子、工业显示与控制等行业。 关闭selinux 修改此文件("+"号为修改内容) device/rockchip/common/BoardConfig.mk BOARD_BOOT_HEADER_VERSION ?= 2 BOARD_MKBOOTIMG_ARGS := BOARD_PREBUILT_DTBOIMAGE ?= $(TARGET_DEVICE_DIR) /dtbo.img BOARD_ROCKCHIP_VIRTUAL_AB_ENABLE ?= false -BOARD_SELINUX_ENFORCING?= true +BOARD_SELINUX_ENFORCING?= false 注释用户组权限检测 修改此文件("+"号为修改内容) system/extras/su/su.cpp void extract_uidgids ( const char *uidgids, uid_t *uid, gid_t * gid, gid_t * gids, i } int main ( int argc, char ** argv) { - uid_t current_uid = getuid (); - if (current_uid != AID_ROOT && current_uid != AID_SHELL) error ( 1 , 0 , "notallowed"); + //uid_t current_uid = getuid(); + //if (current_uid != AID_ROOT && current_uid != AID_SHELL) error(1, 0, "notallowed" ); 给su文件默认授予root权限 修改此文件("+"号为修改内容) system/core/libcutils/fs_config.cpp staticconststructfs_path_configandroid_dirs = { // the following two files are INTENTIONALLY set-uid, but they // are NOT included on user builds. { 06755, AID_ROOT, AID_ROOT, 0, "system/xbin/procmem" }, - { 04750, AID_ROOT, AID_SHELL, 0, "system/xbin/su" }, + { 06755, AID_ROOT, AID_SHELL, 0, "system/xbin/su" }, 然后修改此文件("+"号为修改内容) frameworks /base/ core /jni/ com_android_internal_os_Zygote.cpp 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))); } } } + */ } 最后修改此文件("+"号为修改内容) kernel-5.10/security/commoncap.c intcap_task_setnice ( struct task_struct *p, int nice) staticintcap_prctl_drop ( unsigned long cap) { struct cred * new ; +/* if (! ns_capable ( current_user_ns (), CAP_SETPCAP)) return -EPERM; if (!cap_valid( cap )) return -EINVAL; - +*/ new = prepare_creds() ; 源码编译并验证固件是否ROOT 修改完上面三个步骤的文件后,重新编译内核和安卓源码,执行以下命令: # make -j4 下载RootChecker测试APK软件包(自行下载),可通过ADB命令或者U盘安装,安装后按照提示 点击按钮检查root。 root成功如图:
  • 2024-12-5 10:27
    115 次阅读|
    0 个评论
    本文介绍RK3566/RK3568开发板Android11系统,编译ROOT权限固件的方法。 触觉智能Purple Pi OH鸿蒙开发板 演示,搭载了瑞芯微RK3566四核处理器,Laval鸿蒙社区推荐开发板,已适配全新OpenHarmony5.0 Release系统,SDK源码全开放! 关闭Selinux 修改以下路径文件: adevice/rockchip/common/BoardConfig.mk 修改代码如下: BOARD_BOOT_HEADER_VERSION ?= 2 BOARD_MKBOOTIMG_ARGS := BOARD_PREBUILT_DTBOIMAGE ?= $(TARGET_DEVICE_DIR)/dtbo.img BOARD_ROCKCHIP_VIRTUAL_AB_ENABLE ?= false -BOARD_SELINUX_ENFORCING ?= true +BOARD_SELINUX_ENFORCING ?= false 注意:"+"号为修改内容。 注释用户组权限检测 修改以下路径文件: system/extras/su/su.cpp 修改代码如下: void extract_uidgids(const char* uidgids, uid_t* uid, gid_t* gid, gid_t* gids, i } int main(int argc, char** argv) { - uid_t current_uid = getuid(); - if (current_uid != AID_ROOT && current_uid != AID_SHELL) error(1, 0, "notallowed"); + //uid_t current_uid = getuid(); + //if (current_uid != AID_ROOT && current_uid != AID_SHELL) error(1, 0, "notallowed"); 注意:"+"号为修改内容。 ​给su文件默认授予root权限 修改以下路径文件: system/core/libcutils/fs_config.cpp 修改代码如下: static const struct fs_path_config android_files[] = { // the following two files are INTENTIONALLY set-uid, but they // are NOT included on user builds.{ 06755, AID_ROOT, AID_ROOT, 0, "system/xbin/procmem" }, - { 04750, AID_ROOT, AID_SHELL, 0, "system/xbin/su" }, + { 06755, AID_ROOT, AID_SHELL, 0, "system/xbin/su" }, 修改以下路径文件: frameworks /base/ core /jni/ com_android_internal_os_Zygote.cpp 修改代码如下: static void DropCapabilitiesBoundingSet(fail_fn_t fail_fn) { +/* = 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))); } } } + */ } 修改以下路径文件: kernel/security/commoncap.c 修改代码如下: int cap_task_setnice(struct task_struct *p, int nice) static int cap_prctl_drop(unsigned long cap){ struct cred *new; +/* if (!ns_capable(current_user_ns(), CAP_SETPCAP)) return -EPERM; if (!cap_valid(cap)) return -EINVAL;-+*/ new = prepare_creds(); 注意:"+"号为修改内容。 源码编译并测试 修改完上面三个步骤的文件后,即可在源码根目录下编译安卓源码: # make -j4 下载Root Checker(ROOT检查工具),通过ADB命令或者U盘安装后,打开按照提示点击按钮检测ROOT,如图: 若ROOT成功则如图所示: 产品简介 作为开源鸿蒙OpenHarmony硬件方案的领跑者,触觉智能坚守开源共创精神,Purple Pi OH鸿蒙开发板源码全开放,持续为大家带来各种技术分享,产品具有以下优势: 支持OpenHarmony/Andriod/Linux 多操作系统,兼容树莓派排针; 瑞芯微RK3566芯片,四核A55处理器, 主频1.8GHz,Mali G52-2EE GPU; 支持OpenGL/CL/Vulkan,8M ISP; 1T算力NPU,支持TensorFlow/Caffe/ MXNet/PyTorch等深度学习框架; 支持1 x 千兆以太网、3 x USB2.0 1 x USB3.0、3xUART、2xSPI 2xI2C、28xGPIO、1xMIPI DSI 1 x MIPI CSI、1 x HDMI; 率先支持OpenHarmony5.0/4.1/4.0/ 3.2,开放SDK源代码、3D打印外壳; 活跃的开发者社区, 更多牛人在线互动 与技术支持; 小尺寸高性价比SBC单板,只需249元; 请点击输入图片描述(最多18字)
相关资源
  • 所需E币: 0
    时间: 2022-8-19 16:44
    大小: 248.8KB
    NEWSIMPLEALGEBRAICROOTLOCUSMETHODFORDESIGNOFFEEDBACKCONTROLSYSTEMS
  • 所需E币: 4
    时间: 2019-12-24 18:54
    大小: 284.98KB
    上传者: givh79_163.com
    【应用笔记】AN532:使用GUI界面进行SOPCBuilderPCIExpress设计(AN532:AnSOPCBuilderPCIExpressDesignwithGUIInterface)本应用笔记教你如何创建一个包含PCIExpressMegaCore功能模块的SOPCBuilder系统,并将其下载到开发板。ThisapplicationnoteteachesyouhowtobuildanSOPCBuildersystemthatincludesaPCIExpressMegaCorefunctionanddownloadittoadevelopmentboard.ThisapplicationnotebuildsontheconceptsdiscussedinthedesignexamplefoundinthePCIExpressCompilerUserGuide.ThedesignincludesaGUIthatyoucanusetospecifyreads,writes,andloopbackcommandstoexercisethePCIExpressbus.YoucanalsousethisGUItoreadPCIeconfigurationregisters.YoucanobservePCIetrafficintheGUI’sDisplayWindow.AN532:AnSOPCBuilderPCIExpressDesignwithGUIInterfaceJune2008,ver.1.0ApplicationNote532ThisapplicationnoteteachesyouhowtobuildanSOPCBuildersystemthatincludesaPCIExpressMegaCorefunctionanddownloadittoadevelopmentboard.ThisapplicationnotebuildsontheconceptsdiscussedinthedesignexamplefoundinthePCIExpressCompilerUserGuide.ThedesignincludesaGUIthatyoucanusetospecifyreads,write……