GithubHelp home page GithubHelp logo

Comments (4)

WindySha avatar WindySha commented on September 28, 2024

systemMain()只在system_server进程启动时才会调用,你自己的进程启动更本不会调用到,因此无法hook到

from whale.

WindySha avatar WindySha commented on September 28, 2024

SystemServer.java

private void createSystemContext() {
        ActivityThread activityThread = ActivityThread.systemMain();
        mSystemContext = activityThread.getSystemContext();
        mSystemContext.setTheme(DEFAULT_SYSTEM_THEME);

        final Context systemUiContext = activityThread.getSystemUiContext();
        systemUiContext.setTheme(DEFAULT_SYSTEM_THEME);
    }

from whale.

bmax121 avatar bmax121 commented on September 28, 2024

在 zygote 进程中 hook 的,类似 xposed

from whale.

bmax121 avatar bmax121 commented on September 28, 2024
    } else if (startsSystemServer) {
        Log.d("xxxx", "startsSystemServer");

        findAndHookMethod(ActivityThread.class, "systemMain", new XC_MethodHook() {
            @Override
            protected void afterHookedMethod(MethodHookParam param) throws Throwable {
                final ClassLoader cl = Thread.currentThread().getContextClassLoader();

                Log.d("xxxxxx", "systemMain");

我在 414 进程,也就是 zygote 进程做的上面的代码的 hook ,
然后:

02-17 12:24:18.845: D/xxxx(414): startsSystemServer
02-17 12:24:20.062: I/Zygote(414): System server process 963 has been created
02-17 12:24:28.698: I/SystemServer(963): Entered the Android system server!
02-17 12:24:28.768: D/added-source-log(963): /frameworks/base/core/java/android/app/ActivityThread.java#systemMain()

但是 963 进程并没有打印出 systemMain

其他 app 进程的 hook 正常

from whale.

Related Issues (20)

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.