Get "pointer" to NavigationBarView.java by reflection

I am trying to change several software programs in the navigation bar of an embedded system using the old Android OS. I narrowed down to a class that handles the navigation bar below.

https://android.googlesource.com/platform/frameworks/base/+/7d8abae/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java

the object appears to be declared here:

https://android.googlesource.com/platform/frameworks/base/+/598a7aedfb6b77fc98bace9f420968a6f3ed637e/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java

line 238

private NavigationBarView mNavigationBarView = null;

Is there a way to get a pointer to this object programmatically? The only thing I can find is the code to get a larger container, for example, when you hide the navigation bar programmatically.

        View decorView = getWindow().getDecorView();
        int uiOptions = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;
        decorView.setSystemUiVisibility(uiOptions);

so far this is not enough. I want to go to navigation screens.

any hints with much thanks.

thank.

PS Since it is an embedded system, so if I change the OS, it’s fine, because it will never be in the Google store.

+4
source share
1 answer

Unable to get object mNavigationBarViewin PhoneStatusBar by reflection. This object lives in the process com.android.systemui, your own process cannot access another process object using reflection.

- Xposed framework. PhoneStatusBar mNavigationBarView.

, navigationBar, : Xperia/AOSP NavBar. , SystemUI Xposed.

+1

Source: https://habr.com/ru/post/1680259/


All Articles