Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ActivityManagerHidden.UID_OBSERVER_ACTIVE or ActivityManagerHidden.PROCESS_STATE_UNKNOWN Values are (0) #8

Open
0bbedCode opened this issue Aug 25, 2024 · 0 comments

Comments

@0bbedCode
Copy link

0bbedCode commented Aug 25, 2024

Android 13, SDK 33
Oneplus 7 Pro (Guacamole)

YAAP Custom Rom (TQ3A.230805.001)

Project Minimum SDK (23) Running SDK (33)
HiddenApi Version (4.2.0)

I was looking at Source from (HMA) Hide My App List to Attempt this, I do the same as in hook from the Android Server "addService" Wait for the Package Manager Service, then wait for the Activity Manager Service then Register UID Observer.

I check to ensure its Android N+ (SDK 24+)

Simply put it the return Values for "ActivityManagerHidden.UID_OBSERVER_ACTIVE" or "ActivityManagerHidden.PROCESS_STATE_UNKNOWN" Are (0).

I Disovered this When I hooked

"com.android.server.am.UidObserverController.register()" and "com.android.server.am.ActivityManagerService.registerUidObserverForUids"

When I looked at the logs for those Xposed Hooks in LSPosed Manager I noticed HMA was passing:
(8) For the Which Value => ActivityManagerHidden.UID_OBSERVER_ACTIVE
(-1) For the Cut Point => ActivityManagerHidden.PROCESS_STATE_UNKNOWN

When Calling too "ActivityManagerApis.registerUidObserver"

But looking at my Logs for my Hooks calling the Same way same parameter it passes:
(0) For the Which Value
(0) For the Cut Point

Using the Same code Same Version of the Library, Same Function, Same Static Fields from "ActivityManagerHidden"

For a while UID Observer was not working so I made my own Manual way using "getRunningAppProcesses" but coming back today to look back at this "issue" that's when I hooked the register functions for UID observer and saw (HMA) is passing Different values versus my Project some how despite the similar to same code from the Github.

For now I have a function to use Reflection to get the Field Values Dynamically in "android.app.ActivityManager" else if fails to find it will use a hard coded value from Android Source Code.

Here is Source from my project if needed:
Deploying Hooks:
https://github.com/0bbedCode/XPLEX/blob/master/app/src/main/java/com/obbedcode/xplex/hook/HookAndroid.java

UID Observer Class Wrapper:
https://github.com/0bbedCode/XPLEX/blob/master/shared/src/main/java/com/obbedcode/shared/usage/monitor/UidProcessObserver.java

No Logs as no errors were ever thrown or anything aside from the Hooks Logs but that's pretty self explanatory

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant