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

Android 11 Support #38

Closed
wants to merge 27 commits into from
Closed

Android 11 Support #38

wants to merge 27 commits into from

Conversation

whew-inc
Copy link

@whew-inc whew-inc commented Apr 15, 2020

I've deleted the whole package name service thing and used a simpler way to retrieve package names and labels. Both the package and app name can be logged this way. This fixes the original NullPointerException spam in log.

As for Android 11 support: this now hooks into ApplicationPackageManager.getPackageInfo instead of the old method.

I've also upped Gradle version and target SDK.

Tested on Android 11 AOSP ROM.
Tested on Android 10 Samsung ROM.

@whew-inc
Copy link
Author

Forgot to add that this should fix issue #36.

@Uj947nXmRqV2nRaWshKtHzTvckUUpD

Can we have a new release with the fix please? Edxposed logs are still spammed on android Q

@Joecowboy
Copy link

Joecowboy commented Jan 17, 2021

I am running a OnePlus 7 Pro 5G (Sprint) latest firmware De-Googled. I uninstalled all Google apps and framework.

You can do the same thing Running the OnePlus 7 Pro 5G (Sprint) running the EU 5G firmware. You might want to copy the Modem image from the Sprint's latest firmware using TWRP and then write it back to the EU do to the latest builds (as of v10.0.9) modem is flaky and will not stay connected.

Backup Modem.img to both A and B partitions update using terminal:
dd if=/dev/block/bootdevice/by-name/modem_a of=/sdcard/Download/modem.img
dd if=/dev/block/bootdevice/by-name/modem_b of=/sdcard/Download/modem.img

Write Modem.img to both A and B partitions update using terminal:
dd if=/sdcard/Download/modem.img of=/dev/block/bootdevice/by-name/modem_a
dd if=/sdcard/Download/modem.img of=/dev/block/bootdevice/by-name/modem_b

I can confirm whew-inc will work with MicroG latest build Magisk revived module. I am using it with Magisk 21.3 and latest build of EdXposed YAHAFA Canary. Just install Ruri modules via Magisk Manager. Just enabled the FakesGApps module in EdXposed Manager after you install it. If you run into any issues with it not wanting to check the boxes in MicroG Self-Check might need to fix the permissions XML file after you install it. Also, with OnePlus 7 Pro and Magisk 21.x version you might run into an issue of not being able to use a root explorer or terminal exploring root hangs you might need to install the latest version of Disable_Dm-Verity_ForceEncryption.zip follow the steps on XDA forum exactly.

================================================================================
Update the following file:
/data/system/users/0/runtime-permissions.xml

Find this section and update it:
Change 4300 to 3320 and this should fix issue. Reboot and you should now be able to check the boxes.

`<pkg` name="com.google.android.gms">
    <item name="android.permission.ACCESS_FINE_LOCATION" granted="true" flags="300" />
    <item name="android.permission.FAKE_PACKAGE_SIGNATURE" granted="true" flags="300" />
    <item name="android.permission.READ_EXTERNAL_STORAGE" granted="true" flags="4300" />
    <item name="android.permission.ACCESS_COARSE_LOCATION" granted="true" flags="300" />
    <item name="android.permission.READ_PHONE_STATE" granted="true" flags="300" />
    <item name="android.permission.GET_ACCOUNTS" granted="true" flags="300" />
    <item name="android.permission.WRITE_EXTERNAL_STORAGE" granted="true" flags="4300" />
    <item name="android.permission.ACCESS_BACKGROUND_LOCATION" granted="false" flags="4300" />
  </pkg>

==============================================================================

I have attached compiled version (extract it from the zip):

FakeGapps.zip

@downtoground
Copy link

I have no such permission file in LOS under /data/system/users/0/runtime-permissions.xml

Would you explain how to setup fakegapps in my OS?

@tenpura-shrimp
Copy link

This is a good change. It wasn't working for me on 11 though. I got it working by modifying the hook to hook ApplicationPackageManger.getPackageInfo

@whew-inc
Copy link
Author

whew-inc commented Mar 22, 2021

This is a good change. It wasn't working for me on 11 though. I got it working by modifying the hook to hook ApplicationPackageManger.getPackageInfo

This seems to work for me too on 11. However I think this won't work on older releases so likely gonna have to add a version check.

I built an apk for testing: https://github.com/whew-inc/FakeGApps/releases/tag/android11_initial

Can someone test this with android < 11?

(If you would rather build it yourself: https://github.com/whew-inc/FakeGApps/tree/android11_initial)

@chaoscalm
Copy link

I self-compiled this for testing on armv7 , device klte LineageOS 18.1 and confirm it works good, I can test on one of my tablets which runs android 9.0 and see if it works same.

@chaoscalm
Copy link

@whew-inc Spoofing works on another tablet running Android 9.0 with https://github.com/whew-inc/FakeGApps/releases/tag/android11_initial for me, needs more tests about this.

@whew-inc
Copy link
Author

Youtube Vanced (official one too?) does not seem to trigger the hook. "YouTube won't run without Google Play services" yadayada

Signal does not work too.

Play services reports services are installed.

My country's corona app works properly.

ApplicationPackageManager.getPackageInfo is probably not a good method to hook. I will look into what changed in R.

@chaoscalm
Copy link

chaoscalm commented Mar 23, 2021

About YouTube vanced: https://vancedmanager.com/

there is a known issue with versions > 16 in order to make microg integration work microg/GmsCore#1373

I personally use an old v15 for the channels with subscriptions, and newpipe for anything else.

Another degoogled signal alternative: https://langis.cloudfrancois.fr/#download-en

Signal works for me, so I guess we are using different microg implementations: https://github.com/FriendlyNeighborhoodShane/MinMicroG-abuse-CI This is what I use.

I used the corona app for my country too, but I ended stopping using it because of the many bugs.

Edit:

For ethics reason I'll use the degoogled version above, but I just tested the Google Play one downloaded from Aurora Store, and works fine at first sight.

@whew-inc
Copy link
Author

@dantecpu Thanks for the info. Older Vanced version didn't work at first but after a few reboots and such it magically works now.

Signal is now the only one acting up, though it seems it switched to using the notification trick to push new message notifications. I can't be bothered to backup my messages and install something else right now.

I've also checked the source code a bit and it looks like ApplicationPackageManager.getPackageInfo also existed in older Android versions, so I expect it to work on older versions. Though I can't tell why the original hook doesn't work anymore. I don't feel like digging through the source code that much. The only reasons I can think of right now:

Android doesn't use the method anymore
The old method is now private and Xposed somehow can't hook into it

@BlueMax
Copy link

BlueMax commented Mar 24, 2021

Your test apk is not signed.
Signing it with v1/v2/v3 schemes results in 'parse error'. Can you upload a proper one?
Tested on LOS18.1/armv7.

W/PackageInstaller(13514): Parse error when parsing manifest. Discontinuing installation

Edit: Looks like it doesn't like zipalign even though i did it before apksign (as it's meant to be done for v2+).
Will test it now...

@chaoscalm
Copy link

chaoscalm commented Mar 24, 2021

Signal is now the only one acting up, though it seems it switched to using the notification trick to push new message notifications. I can't be bothered to backup my messages and install something else right now.

After a first research, I setted myself with a completely different app that enforce security measures, here is the F-Droid repo:

https://molly.im/fdroid/repo?fingerprint=3B7E93B1FE32C6E35A93D6DDFC5AFBEB1239A7C6EA6AF20FF33ED53CDC38B04A

I think this could help your situation:

A workaround for this issue has been reported on r/MicroG and I have verified it to work:
microg/GmsCore#1408

https://www.reddit.com/r/MicroG/comments/kuhgse/device_registration_and_push_notifications/girx53t

@whew-inc
Copy link
Author

@dantecpu Thanks for this. I don't think the microg thing will help because literally all my other apps work now. It's just Signal being Signal I guess.

@BlueMax I've updated the release to include a signed apk. Note that it's signed with debug keys.

@BlueMax
Copy link

BlueMax commented Mar 25, 2021

Thanks. I've tested it on Android 11 and the self-test is ok now indeed. I don't have any further GCM demanding apps installed atm.
What i can say though is that it has the same problem as xprivacy with lsposed. You need to explicitly enable all apps that need fake sigs. That's not a module fault of course.
Thanks for the update.

@whew-inc
Copy link
Author

I will change this pull request to include android 11 support.

@whew-inc whew-inc changed the title Fix NullPointerException Android 11 Support Mar 25, 2021
@whew-inc whew-inc changed the title Android 11 Support Support Android 11 Mar 25, 2021
Copy link

@Fs00 Fs00 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your work @whew-inc, I tested your patch on Android 10 and Android 6 and it worked flawlessly.
I've seen also that the ApplicationPackageManager method you're now hooking into is present since Android 4.0, therefore it's super backwards-compatible.
I left some feedback about the code to (IMO) improve this patch even more before it gets merged (hopefully) :D

@MrNessuno
Copy link

MrNessuno commented Apr 3, 2021

This is a good change. It wasn't working for me on 11 though. I got it working by modifying the hook to hook ApplicationPackageManger.getPackageInfo

This seems to work for me too on 11. However I think this won't work on older releases so likely gonna have to add a version check.

I built an apk for testing: https://github.com/whew-inc/FakeGApps/releases/tag/android11_initial

Can someone test this with android < 11?

(If you would rather build it yourself: https://github.com/whew-inc/FakeGApps/tree/android11_initial)

LSPosed Log --------- beginning of information Manufacturer: Xiaomi Brand: Redmi Device: lmi Product: lmi Model: Redmi K30 Pro Fingerprint: Redmi/lmi/lmi:11/RKQ1.200826.002/V12.2.3.0.RJKCNXM:user/release-keys ROM description: lmi-user 11 RKQ1.200826.002 V12.2.3.0.RJKCNXM release-keys Architecture: arm64-v8a Android build: RKQ1.200826.002 Android version: 11 Android sdk: 30 LSPosed version: v1.3.4 (5501) Riru version: v25.3.4.r399.84f7084 (399) Riru api: 25 Magisk: 22.0 (22000) 2021-04-03 19:34:01.001 I/?(1968-1968): FakeGApps: returning fake signature to "unknown package label" (android.uid.system:1000)

Is EdExposed better than LSPosed? I tryed with the 2.0 and the new test apk but with this new one I got this error, what can I try?

@whew-inc
Copy link
Author

whew-inc commented Apr 3, 2021

@MrNessuno It's normal. This happens when the sig is spoofed for system itself. Check if eg. Microg works. @Fs00' feedback fixes this but I haven't found the time to get onto it yet.

@MrNessuno
Copy link

@MrNessuno It's normal. This happens when the sig is spoofed for system itself. Check if eg. Microg works. @Fs00' feedback fixes this but I haven't found the time to get onto it yet.

I have to enable the module and check System Framework right? I tried with the Signature Spoofing Checker and I got disabled as result

@whew-inc
Copy link
Author

whew-inc commented Apr 3, 2021

@MrNessuno It's normal. This happens when the sig is spoofed for system itself. Check if eg. Microg works. @Fs00' feedback fixes this but I haven't found the time to get onto it yet.

I have to enable the module and check System Framework right? I tried with the Signature Spoofing Checker and I got disabled as result

I don't know how Lxposed works but in Edxposed all you have to do is enable the module and reboot.

This module only spoofs two google play apps (play store and services). Because Signature Spoofing Checker isn't one of the two, its signature won't be spoofed and therefore the app thinks spoofing doesn't work.

@chaoscalm
Copy link

chaoscalm commented Apr 3, 2021

@MrNessuno It's normal. This happens when the sig is spoofed for system itself. Check if eg. Microg works. @Fs00' feedback fixes this but I haven't found the time to get onto it yet.

I have to enable the module and check System Framework right? I tried with the Signature Spoofing Checker and I got disabled as result

I don't know how Lxposed works but in Edxposed all you have to do is enable the module and reboot.

This module only spoofs two google play apps (play store and services). Because Signature Spoofing Checker isn't one of the two, its signature won't be spoofed and therefore the app thinks spoofing doesn't work.

LSPosed is the opposite approach to EdXposed, by default nothing is hooked, you have to select it, so from a security/bug point of view is better, I remember on EdXposed a similar options with it working fine, also we can make rules for it for automatic selection of best settings.

Edit: Indeed the verbose log isn't something new I think? Anyway in order for LSPosed to work with fakegapps, I added what is required to be enabled on Android 11.

Edit:

This is a good change. It wasn't working for me on 11 though. I got it working by modifying the hook to hook ApplicationPackageManger.getPackageInfo

This seems to work for me too on 11. However I think this won't work on older releases so likely gonna have to add a version check.
I built an apk for testing: https://github.com/whew-inc/FakeGApps/releases/tag/android11_initial
Can someone test this with android < 11?
(If you would rather build it yourself: https://github.com/whew-inc/FakeGApps/tree/android11_initial)

LSPosed Log --------- beginning of information Manufacturer: Xiaomi Brand: Redmi Device: lmi Product: lmi Model: Redmi K30 Pro Fingerprint: Redmi/lmi/lmi:11/RKQ1.200826.002/V12.2.3.0.RJKCNXM:user/release-keys ROM description: lmi-user 11 RKQ1.200826.002 V12.2.3.0.RJKCNXM release-keys Architecture: arm64-v8a Android build: RKQ1.200826.002 Android version: 11 Android sdk: 30 LSPosed version: v1.3.4 (5501) Riru version: v25.3.4.r399.84f7084 (399) Riru api: 25 Magisk: 22.0 (22000) 2021-04-03 19:34:01.001 I/?(1968-1968): FakeGApps: returning fake signature to "unknown package label" (android.uid.system:1000)

Is EdExposed better than LSPosed? I tryed with the 2.0 and the new test apk but with this new one I got this error, what can I try?

If the log trouble you, you can try merge this into 11 and test, eebssk1@3b8aebc

Final Result: both the log problem you mentioned, and the LSPosed are functional with the Android 11 branch.

photo_2021-04-04_02-50-27
photo_2021-04-04_02-55-05

@MrNessuno
Copy link

where is recommended to download MicroG to be more compatible with this module? (sorry for "spamming" here, but idk another place for this question)

@chaoscalm
Copy link

where is recommended to download MicroG to be more compatible with this module? (sorry for "spamming" here, but idk another place for this question)

I personally use this: https://github.com/FriendlyNeighborhoodShane/MinMicroG-abuse-CI

You are welcome.

@chaoscalm
Copy link

where is recommended to download MicroG to be more compatible with this module? (sorry for "spamming" here, but idk another place for this question)

I personally use this: https://github.com/FriendlyNeighborhoodShane/MinMicroG-abuse-CI

You are welcome.

ps: nobody recommended me anything, I just tested them during time, in the end I developed a personal taste for the one I shared with you, which of course maybe not of your taste, another one is nanodroid...

@whew-inc
Copy link
Author

whew-inc commented Apr 7, 2021

No log spam and LSposed scoped module support: https://github.com/whew-inc/FakeGApps/releases/tag/lsposed

@Fs00
Copy link

Fs00 commented Apr 14, 2021

Awesome job @whew-inc! Thanks for listening to my feedback 😃

@thermatk Could you please look into this PR and merge it if it's fine for you?

@whew-inc whew-inc changed the title Support Android 11 Android 11 Support Jun 27, 2021
Fs00 and others added 4 commits August 2, 2021 08:49
@whew-inc
Copy link
Author

whew-inc commented Oct 11, 2021

whew-inc#1 (comment)

Looking for someone to test this with LSposed on Android 11.

Improved app startup performance is one of the changes

Change hook logic to avoid having to enable the module for all apps on LSPosed
@whew-inc
Copy link
Author

New release: https://github.com/whew-inc/FakeGApps/releases/tag/3.0

@kurt-by
Copy link

kurt-by commented Dec 6, 2021

Hi @whew-inc
Your log fix release works fine on android 12. The 3.0 version doesn't. No mattee what i select in apps list.

@whew-inc
Copy link
Author

@kurt-by The module has been updated for Android 12.

@whew-inc
Copy link
Author

Closing as there has been no response from the author for 2+ years now.

@whew-inc whew-inc closed this Jun 25, 2022
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

Successfully merging this pull request may close these issues.