Coder Social home page Coder Social logo

root-manager's Introduction

360秒装功能分析

最新版360手机助手提供了秒装的功能,能够在已经取得root权限的手机上,不调用su进行授权,直接安装app从而能够有效减少应用安装的时间。

一、功能模块

360秒装功能主要分为permmgrrtservice两个模块, permmgr负责加载so库,实现root提权功能; rtservice模块在permmgr获得root权限的基础上以root身份启动qh_root_service进程,appstore通过跨进行通讯控制该进程执行秒装操作。

permmgr模块的com.qihoo.permmgr目录下主要包括以下几个核心文件:

类名作用
IPermMgrService定义权限管理服务接口
LocalRoot声明jni函数调用lib360.so接口
PermService权利管理服务,监控root状态
PermManager负责临时root方案的权限获取和so库的加载

rtservice模块的com.qihoo.rtservice目录下主要包括以下几个核心文件:

类名 作用
Cmd 负责执行shell命令
IRTService 定义action和service name等常量
IRTServiceImpl 继承IRootService.Stub和IRTService,是系统服务的具体实现
IRootService 系统服务的接口
MethodInfo method的接口实体类
NativeHelper 负责对native库的处理
RTServiceManager 与ServiceManager类似,客户端接口的封装
TempRoot 定义错误码和常量
support 目录,包含一些实用类

二、permmgr模块分析

permmgr模块主要由PermManager管理,PermManager负责获取root权限。 首先定义permmgr后台服务接口 LocalRoot调用本地so库获取临时root权限,具体实现在lib360.so库中 PermService监听root广播: PermManager是root权限管理的接口管理类(仅保留函数声明) PermManager需要进一步仔细分析

三、rtservice模块分析

rtService作为一个独立的进程,首先定义了进程通信的接口和实现类,该进程可以通过dexClassLoader加载jar包或apk文件,从而以root身份执行任意的代码!

IRootService接口 IRTServiceImpl继承IRootService.Stub作为独立root进程qh_root_service的服务端

class IRTServiceImpl extends IRootService.Stub implements IRTService

具体实现暂不进行分析

RTServiceManager负责qh_root_service进程的启动和管理

root-manager's People

Contributors

hewu2008 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.