Giter VIP home page Giter VIP logo

depthexploit's Introduction

DepthExploit

DepthExploit是一款非常快捷的安卓深度开发框架,支持Android5.0 - Android12,与ROOT进程深度交互,实现无障碍化ROOT安卓开发,可以很方便的使用xposedsubstrate对安卓进程进行深度调试/修改。

下载

repositories {
    maven { url 'https://jitpack.io' }
}

dependencies {
    def depthVersion = '1.2.9'
    implementation "com.github.xw103:DepthExploit:${depthVersion}"
    ...
}

开始使用

AndroidManifest.xml

<!--    定义Activity主类(这个类必须继承自'DepthActivity')    -->
        <meta-data
            android:name="MainActivity"
            android:value="org.exploit.depth.example.MainActivity"/>

        <!--    定义Root运行环境类(这个类必须实现'IRootRemote'接口)    -->
        <!--    注:若不使用Root运行环境可不声明RootMain    -->
        <meta-data
            android:name="RootMain"
            android:value="org.exploit.depth.example.Main"/>

也可以

<!--    定义Activity主类(这个类必须继承自'DepthActivity')    -->
        <meta-data
            android:name="MainActivity"
            android:value=".MainActivity"/>

        <!--    定义Root运行环境类(这个类必须实现'IRootRemote'接口)    -->
        <!--    注:若不使用Root运行环境可不声明RootMain    -->
        <meta-data
            android:name="RootMain"
            android:value=".Main"/>

DepthExploit中,继承自DepthActivity的活动,已废弃this关键字,改为使用that关键字,并且继承自DepthActivity的活动可不用在清单重复声明,可直接跳转。

public class MainActivity extends DepthActivity {
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        Toast.makeText(that, "test", Toast.LENGTH_SHORT).show();
    }
}

使用AIDL与SU进程通信

创建AIDL文件夹,并且创建AIDL文件。例:

package org.exploit.depth.example;

interface Test {
    String test();
}

创建SU进程并绑定IPC

public class MainActivity extends DepthActivity {

    private final RootIPCReceiver<Test> ipcReceiver = new RootIPCReceiver<Test>(that, 0) {
        @Override
        public void onConnect(Test ipc) {
            //连接成功调用
            try {
                Toast.makeText(that, ipc.test(), Toast.LENGTH_SHORT).show();
            } catch (RemoteException e) {
                e.printStackTrace();
            }
        }

        @Override
        public void onDisconnect(Test ipc) {
            //断开连接调用
        }
    };

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        IPCUtils.startIPC(that, ipcReceiver, null, null, line -> {
            //接收输出(可为NULL)
            System.out.println(line);
        });
        //IPCUtils.startIPC(that, ipcReceiver, null, null,null);
    }
}

关于IPCUtils.startIPC方法

/**
     * 
     * @param context 上下文
     * @param rootIPCReceiver RootIPCReceiver对象
     * @param param 传给Root进程的参数,可为null
     * @param libs 创建root进程时想要加载的so,只写库名,例如‘libdepth.so’写如‘depth’
     * @param onLine root进程输出接口
     */
    public static void startIPC(Context context, RootIPCReceiver rootIPCReceiver,String[] param,String[] libs,OnLine onLine){
        ...
    }

Root进程入口类配置

public class Main implements IRootRemote {
    /**
     * @param args
     * args[0] = SU程序路径
     * args[...] = 你传的参数
     */
    @Override
    public void onCreate(String[] args) {
        for (int i = 0; i < args.length; i++) {
            System.out.println("args["+i+"]="+args[i]);
        }
    }

    //你的AIDL方法实现
    @Override
    public IBinder onBind() {
        return new Test.Stub() {
            @Override
            public String test() throws RemoteException {
                return "I am the root process!";
            }
        };
    }
}

使用Lua

具体使用方法见AndroidLua

案例

        try {
            LuaRunner runner = new LuaRunner();
            runner.run("print(888)".getBytes(),"test");
            runner.close();
        } catch (Exception e) {
            e.printStackTrace();
        }

Hook功能

敬请期待
...


更多功能正在开发中。

depthexploit's People

Contributors

xw103 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.