thermatk / FakeGApps

A better approach for microg
GNU General Public License v3.0
227 stars 48 forks source link

Android 11 Support #38

Closed whew-inc closed 2 years ago

whew-inc commented 4 years ago

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 commented 4 years ago

Forgot to add that this should fix issue #36.

Uj947nXmRqV2nRaWshKtHzTvckUUpD commented 4 years ago

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

Joecowboy commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

@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 commented 3 years ago

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 commented 3 years ago

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

there is a known issue with versions > 16 in order to make microg integration work https://github.com/microg/GmsCore/issues/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 commented 3 years ago

@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 commented 3 years ago

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 commented 3 years ago

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: https://github.com/microg/GmsCore/issues/1408

https://www.reddit.com/r/MicroG/comments/kuhgse/device_registration_and_push_notifications/girx53t
whew-inc commented 3 years ago

@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 commented 3 years ago

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 commented 3 years ago

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

MrNessuno commented 3 years ago

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 commented 3 years ago

@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 commented 3 years ago

@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 commented 3 years ago

@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 commented 3 years ago

@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, https://github.com/eebssk1/FakeGApps/commit/3b8aebc0efd39c968905ca62b430ba182f5af95e

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 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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

MrNessuno commented 3 years ago

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

Is it true that I have to rename the zip file with system-minmicrog ecc ecc.zip before flashing? I saw it in XDA but I don't see that thing in github

chaoscalm commented 3 years ago

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

Is it true that I have to rename the zip file with system-minmicrog ecc ecc.zip before flashing? I saw it in XDA but I don't see that thing in github

I don't know, personally I never rename anything, had builded what I shared with you too inside VM and lately using the one provided with the github-actions, if you can share the XDA post probably I can tell you, but based on my experience no.

MrNessuno commented 3 years ago

I installed MicroG removing Google Apps and... It works! :cupid: and with MIUI is the only patch that works ^^

chaoscalm commented 3 years ago

I installed MicroG removing Google Apps and... It works! 💘 and with MIUI is the only patch that works ^^

I am happy for your success Mr. Nessuno, sometime we get lucky.

whew-inc commented 3 years ago

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

Fs00 commented 3 years ago

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 commented 3 years ago

https://github.com/whew-inc/FakeGApps/pull/1#issuecomment-940050877

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

Improved app startup performance is one of the changes

whew-inc commented 3 years ago

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

kurt-by commented 2 years ago

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 commented 2 years ago

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

whew-inc commented 2 years ago

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