whew-inc / FakeGApps

Signature spoofing for MicroG as an Xposed module
GNU General Public License v3.0
273 stars 16 forks source link

Change hook logic to avoid having to enable the module for all apps on LSPosed #1

Closed Fs00 closed 2 years ago

Fs00 commented 3 years ago

Hello @whew-inc! I did the move to LSPosed, but soon after I found frustrating having to enable FakeGApps for all apps that need GMS signature spoofing. Another consequence of this is that - due to how LSPosed and EdXposed 0.5+ work - there is a small (albeit noticeable) lag on start-up of hooked apps. So in order to fix these inconveniences, I've taken inspiration from LineageOS for MicroG spoofing patches and slightly reworked the logic to only hook into the PackageManagerService class of the system server, precisely after the method generatePackageInfo. This private method has proved to remain stable throughout the years and is present even on very old Android versions (including 4.0). I can confirm this works on Android 6 (original Xposed) and 10 (LSPosed), but should work on other versions too.

I've also added .idea folder to gitignore and bumped app version (feel free to revert/change that if you don't agree).

PS: I've seen that in this fork you have both a branch and a tag named lsposed. This caused me some trouble when trying to push the code due to this ambiguity. I think it would be best to delete and recreate the tag with a different name.

whew-inc commented 3 years ago

Hey @Fs00 !

This looks good. I'll test this when I find the time. Thanks for the PR!

As for the lsposed branch/tag, you're right. After testing/merging your proposal I'll clean the repo. Sorry for the confusion.

j0110 commented 2 years ago

Is there any updates on this PR ?

whew-inc commented 2 years ago

@Dev0110 I'm currently in a situation irl that makes me unable to work on this or anything really.

If all goes fine expect an update or merge somewhere next week.

whew-inc commented 2 years ago

It looks like it works on Android 11 with EdXposed, but I don't know about Lsposed and I don't want to risk installing right now because I'm lacking time and backups. If someone else can test and confirm it works especially on 11 then I'll merge it, otherwise I'll wait a bit before I do.

https://transfer.sh/J5VETT/app-release.apk

Fs00 commented 2 years ago

Great! At this point, I think that the odds that this PR won't work on LSPosed/Android 11 are extremely low, given that it works with EdXposed. I've been using FakeGapps with this PR applied on LSPosed on Android 9 and 10 since a few months and everything works fine.

rhjdvsgsgks commented 2 years ago

it works on my device, Android 11 + lsposed

whew-inc commented 2 years ago

Great! At this point, I think that the odds that this PR won't work on LSPosed/Android 11 are extremely low, given that it works with EdXposed. I've been using FakeGapps with this PR applied on LSPosed on Android 9 and 10 since a few months and everything works fine.

I'm only worried about the activation scope not working properly on 11. I tried using the feature with EdXposed but it seems no matter what I select signature spoofing always works

whew-inc commented 2 years ago

It looks like it works on Android 11 with EdXposed, but I don't know about Lsposed and I don't want to risk installing right now because I'm lacking time and backups. If someone else can test and confirm it works especially on 11 then I'll merge it, otherwise I'll wait a bit before I do.

https://transfer.sh/J5VETT/app-release.apk

On second thought I'll just merge this now. It works fine on 11 with edxposed and Lsposed should work fine too, just not sure about activation scope. If it doesn't the older apk can be used in the meantime.

Fs00 commented 2 years ago

I tried using the feature with EdXposed but it seems no matter what I select signature spoofing always works

It always works because the module has been changed to hook only the Android system server, which corresponds to the "System framework" app when selecting activation scope on LSPosed. I honestly don't remember if you can toggle modules for the "system framework" app in EdXposed.

Anyway, thanks for testing and merging!

whew-inc commented 2 years ago

It's rather strange. Even if I don't select ANYTHING or an irrelevant app, spoofing still works. EdXposed moment? Persists with reboots too.

Screenshot_20211011-181209_EdXposed_Manager

Fs00 commented 2 years ago

Definitely strange. Maybe a bug in the activation scope implementation of EdXposed?

whew-inc commented 2 years ago

Ah, it's because my rom already has MicroG spoofing support, rendering this module redundant for me.