• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

Signature Spoofing on unsuported Android 11 (R) Roms

Search This thread

electricfield

Member
Apr 7, 2012
33
11
My situation is a little different. I'm trying to install signature spoofing on something that isn't a phone.... heck it isn't even an android device..... a Raspberry Pi.



I'm using Konstakang's Android 11 rom linked here: https://konstakang.com/devices/rpi4/


Since the Raspberry Pi isn't really an android device, a lot of the processes typically used to do android things don't make sense (there's no fastboot, no dialer, etc.). I have no way to install Magisk, so I'm trying to understand each of the components and steps in order to adapt the procedure.


It seems like the goal here is to:


1) patch your device's services.jar with dex files that the original author pre-generated using haystack

2) install this services.jar over your existing one, and

3) tell the system that signature spoofing should be activated


First, the components:

1) The spoofAVDapi30 zip file contains an app that claims to be "Signature Spoofing Support (NanoDroid-Patcher) plus a dummy services.jar

2) The microG AVD Magisk Marvin zipfile appears to contain copies of microG and related apps that are intended for installation in priv-app (I don't want to use these... I want to use mciroG from the f-droid store so that it gets updates).

3) The haystack-11-attempt zipfile contains dex files that have been pre-patched with signature spoofing (along with a lot of other stuff that is not used)

4) dexpatcher is a java program that is used to extract the contents of services.jar and patch them with the dex files from (3)

5) adb is used to push and pull files to/from the device


My initial procedure is pretty straighforward. I can take the system disk out of my device and mount it on a linux system, so I do.

I copy framework.jar from the relevant place to a directory with the haystack dex files and dexpatcher and use the patch command (starts with "jar") in the first post. Everything works fine.

I repack framework.jar and copy it to the system disk using "cat >" instead of "cp" in order to retain any permissions that have been set.

I put the system disk back in the device, boot up, and install microG from f-droid. I also install fakeGapps from f-droid.

microG says that my rom does not support signature spoofing (zero checkmarks).

I tried instaliing the apk that was inside the spoofAVDapi30 zip, but it doesn't seem to do anything.

Here are my questions.

Is there somewhere that I need to tell the system that signature spoofing should be activated?

Do microG and its friends need to be installed in priv-app instead of as regular apps?

Does magisk do anything other than copy the services.jar to the correct place? I'd like to understand how this procedure works instead of waving my magic app-wand around and hoping for the best.
 

kurtn

Senior Member
Jan 28, 2017
4,194
1,816
Small town in Bavaria
My situation is a little different. I'm trying to install signature spoofing on something that isn't a phone.... heck it isn't even an android device..... a Raspberry Pi.



I'm using Konstakang's Android 11 rom linked here: https://konstakang.com/devices/rpi4/


Since the Raspberry Pi isn't really an android device, a lot of the processes typically used to do android things don't make sense (there's no fastboot, no dialer, etc.). I have no way to install Magisk, so I'm trying to understand each of the components and steps in order to adapt the procedure.


It seems like the goal here is to:


1) patch your device's services.jar with dex files that the original author pre-generated using haystack

2) install this services.jar over your existing one, and

3) tell the system that signature spoofing should be activated


First, the components:

1) The spoofAVDapi30 zip file contains an app that claims to be "Signature Spoofing Support (NanoDroid-Patcher) plus a dummy services.jar

2) The microG AVD Magisk Marvin zipfile appears to contain copies of microG and related apps that are intended for installation in priv-app (I don't want to use these... I want to use mciroG from the f-droid store so that it gets updates).

3) The haystack-11-attempt zipfile contains dex files that have been pre-patched with signature spoofing (along with a lot of other stuff that is not used)

4) dexpatcher is a java program that is used to extract the contents of services.jar and patch them with the dex files from (3)

5) adb is used to push and pull files to/from the device


My initial procedure is pretty straighforward. I can take the system disk out of my device and mount it on a linux system, so I do.

I copy framework.jar from the relevant place to a directory with the haystack dex files and dexpatcher and use the patch command (starts with "jar") in the first post. Everything works fine.

I repack framework.jar and copy it to the system disk using "cat >" instead of "cp" in order to retain any permissions that have been set.

I put the system disk back in the device, boot up, and install microG from f-droid. I also install fakeGapps from f-droid.

microG says that my rom does not support signature spoofing (zero checkmarks).

I tried instaliing the apk that was inside the spoofAVDapi30 zip, but it doesn't seem to do anything.

Here are my questions.

Is there somewhere that I need to tell the system that signature spoofing should be activated?

Do microG and its friends need to be installed in priv-app instead of as regular apps?

Does magisk do anything other than copy the services.jar to the correct place? I'd like to understand how this procedure works instead of waving my magic app-wand around and hoping for the best.
No idea about your procedure.
The thing with system app is: some features of microG will not work if you install it as user app.
What do you want microG to do for you?
Magisk does nothing magical. Its just used for changing system partition content without actually writing to system partition. MicroG runs fine without Magisk.

Why don't you try to build or use a OS with baked in signature spoofing?
 

electricfield

Member
Apr 7, 2012
33
11
No idea about your procedure.
The thing with system app is: some features of microG will not work if you install it as user app.
What do you want microG to do for you?
Magisk does nothing magical. Its just used for changing system partition content without actually writing to system partition. MicroG runs fine without Magisk.

Why don't you try to build or use a OS with baked in signature spoofing?

I am not aware of a rom for Raspberry Pi that has signature spoofing.

I am aware of docker-lineage-cicd, but I don't have the knowledge required to combine it with the Pi sources in order to compile a rom.
 

electricfield

Member
Apr 7, 2012
33
11
Thanks for the comment, but I'm still going to need microG working. I have a couple of apps that attempt to detect play services. If they don't find it, they won't run. They run fine with microG on another device.
 

mineshaftgap

Member
Sep 25, 2021
7
0
Thanks @Kingslayer9988 this worked like a charm on the Uniherz Jelly 2 with LOS 18.1 as installed from this thread as described by @Meetoul

Your very first post here was basically enough, but it was an amazingly detailed thing to carry out, pleased I had a few hours to focus single mindedly on it and do it until it was done. Will write the more specific aspects of it in the other thread.
 

mineshaftgap

Member
Sep 25, 2021
7
0
Basically, everything is working. I needed this for mobility apps, and have found so far after trying 4 of them that 3 out of 4 have worked. I started a thread about the one which was complaining here:


...but basically I'm happy as it seems I can use these things around the town despite lineageos + microg. Actually one app has a very unusual quirk, basically some of the cars are available and some aren't "because the phone is rooted". I may PM someone about that. Still, will be content as it is very good outcome for open source remake of all this play services stuff.

This was the first time I ever used or installed from magisk :

Where did that file come from? Did someone ask marvin to create is specially for this thread? Most of his microg files are either .apk or .zip but I think it is a .zip of the whole repo. This is some other kind of .zip, presumably a .zip made for magisk. It would be nice to know if there is a way to add newer versions of microg through magisk as they become available.

There are two small issues in this one for me:
  1. google cloud messaging will not switch on
  2. „im Hintergrund auf den Standort zugreifen“ cannot be ticked, background update of positioning.
So not a big deal, but they may be the cause of the quirks I've observed with some of the app.
 

masset12

Member
Oct 9, 2021
11
2
Hi all,

Many thanks to Kingslayer9988 for his OP, everything works fine for sigspoof enabled :)

Unfortunately, I can't manage to have microg properly installed ..

I tried microG\_AVDx86api30\_magiskMaRViN.zip, MinmicroG, nanodroid and even Microg Revived from the magisk repo without any success ..

I either got a bootloop or either MicroG is installed but randomly disappear after reboot and I have numerous notifications telling playstore is not working ..


I already installed microG on my S8+ (MinmicroG) without any issue but I used to debloat this files from /system/priv-apps before flashing microG :

- GmsCore (PrebuiltGmsCore, PrebuiltGmsCorePi, PrebuiltGmsCorePix)
- GoogleBackupTransport
- GoogleFeedback
- GoogleLoginService
- GoogleOneTimeInitializer
- GooglePartnerSetup
- GoogleServicesFramework
- Phonesky
- SetupWizard
- Velvet

Should I also debloat the same before ?
I can't figure what I'm doing wrong

I am on SM-G986B/DS, Android 11, Beyond Rom 3.7

Thank you for your help
 

kurtn

Senior Member
Jan 28, 2017
4,194
1,816
Small town in Bavaria
  • Like
Reactions: oF2pks

masset12

Member
Oct 9, 2021
11
2
Hello,

Just in case it would be helpful to any noob like me

I managed to have MicroG working doing this :

1) I debloat this one
pm uninstall --user 0 com.google.android.gms
pm uninstall --user 0 com.android.vending
pm uninstall --user 0 com.google.android.gsf

2) I removed this with a root explorer
/product/priv-app/GmsCore
/product/priv-app/GooglePartnerSetup
/product/priv-app/Phonesky
/system_ext/priv-app/GoogleFeedback
/system_ext/priv-app/GoogleOneTimeInitializer
/system_ext/priv-app/GoogleServicesFramework
/system_ext/priv-app/SetupWizard

3) I follow the OP procedure to enable sigspoof
(flash spoof-AVDapi30.zip via magisk)

4) flash Microg Revived 2.2.1-0 (22100) via magisk repo
(either copy a patched playstore (like the one patched by nanolx in /data/adb to use paid apps or copy nothing to use fakestore instead)

5) I installed this from Fdroid for location
Local GSM Location
Wifi Location Service
Déjà Vu
MozillaNlpBackend
NominatimNlpBackend
UnifiedNlp

Works for me
 

maxwen

Senior Member
Jun 10, 2012
8,052
10,284
  • Like
Reactions: oF2pks

Top Liked Posts

  • There are no posts matching your filters.
  • 1
    I am not aware of a rom for Raspberry Pi that has signature spoofing.

    I am aware of docker-lineage-cicd, but I don't have the knowledge required to combine it with the Pi sources in order to compile a rom.
    What do you want microG to do for you?
    1
    @Kingslayer9988, (before some will ask,) I checked aosp 12 release and there is no way this @Lanchon based 'kickstarter' could work due to heavy changes in targeted PackageManagerService.java. We'll have to wait first for @MaR-V-iN or @maxwen (OmniRom) to finalize new aosp java patches.
    (Any help welcomed on https://gerrit.omnirom.org/q/microG...)
    I've seen reports of LSPosed fakegapps working on android 12
    1
    @Kingslayer9988, (before some will ask,) I checked aosp 12 release and there is no way this @Lanchon based 'kickstarter' could work due to heavy changes in targeted PackageManagerService.java. We'll have to wait first for @MaR-V-iN or @maxwen (OmniRom) to finalize new aosp java patches.
    (Any help welcomed on https://gerrit.omnirom.org/q/microG...)

    Almost the same as in 11 :)
  • 37
    PicsArt_01-03-06.20.51.jpg


    How to get Signature Spoofing working on Android 11 (R) Roms that have no support for Signature Spoofing?

    In my Case here I use a Samsung Galaxy S8 with an unofficial LineageOS 18.1 (Android 11) by stricted

    I use TWRP recovery but this should not matter !

    First of all Flash your ROM and Magisk (you need to download the latest version to get Magisk working on Android 11)

    Link for my ROM in case anyone needs it:

    dreamlte(s8): https://images.stricted.net/test/18.1/lineage-18.1-20201231-UNOFFICIAL-dreamlte.zip

    dream2lte(s8+): https://images.stricted.net/test/18.1/lineage-18.1-20201231-UNOFFICIAL-dream2lte.zip

    greatlte(n8): https://images.stricted.net/test/18.1/lineage-18.1-20201231-UNOFFICIAL-greatlte.zip

    Magisk Link: https://github.com/topjohnwu/Magisk/releases/tag/v21.2

    Click on Build number (7x) to enable Developer Options

    After that enable ADB-Debugging and Root-ADB-Debugging in your ROM in case of LineageOS go to Setting -> System -> Developer Options

    So Lets go this is the more complicated part. but also really easy if you done it once.

    I'm using Debian Linux but it should be possible on every OS. In Windows use the Linux Subsystem.

    You need to have ADB installed on your System tho.

    ADB link: https://adbdownload.com

    First of all you need to download this 2 Files:



    Rename "spoof\_AVDapi30.zip.ONLY'MAGISK&ANDROID-STUDIO" to "spoof\_AVDapi30.zip"

    Next Download this zip: https://gitlab.com/oF2pks/haystack/-/archive/11-attempt/haystack-11-attempt.zip

    Also download this jar file: https://github.com/DexPatcher/dexpa...nload/v1.8.0-beta1/dexpatcher-1.8.0-beta1.jar

    So now unzip the haystack-11-attempt.zip and put the dexpatcher.jar file into to Folder.

    This part I use Bash shell in Linux.

    Bash:
    adb pull /system/framework/services.jar
    
    java -jar dexpatcher-1.8.0-beta1.jar -a 11 -M -v -d -o ./ services.jar 11-hook-services.jar.dex 11core-services.jar.dex

    (After that Command you should have 4 files all named classes*.dex)
    Bash:
    mkdir repack
    
    zip -j repack/services.jar classes*.dex

    After that you should have a new services.jar in your repack Folder.

    Now You need to open the spoof\_AVDapi30.zip go in /system/framework/ and delete the old services.jar and put your own file in. that's in your repack Folder.

    Don't ruin the zip-format of the file tho because otherwise Magisk will cry while install.

    After that put your spoof-AVDapi30.zip and your microG\_AVDx86api30\_magiskMaRViN.zip on your Phone and Flash via Magisk.

    Reboot and you hopefully have Signature spoofig working. If you run in any Problems check out the GitHub Links here. there will be comments that maybe will help.

    I also want to credit the real developers of this
    on xda: Lanchon (DexPatcher & Haystack)
    https://forum.xda-developers.com/m/lanchon.4141005/

    I'm Sorry if there is ****ty English.
    The best of luck for you guys i hope this helps.
    2
    Thank you so much, worked like a charm on an unofficial LineageOS 18.1 ROM running on Lenovo K6 Power
    2
    I get a flickering screen here after reboot. And message the Playstore has been closed several times. Maybe I need to delete playstore or first?
    Playstore and everything has been still on my device, as I would just spoof it (first). But - during installation with Magisk I get a message that no playstore is available so fakestore will be installed.

    I give it a second try just install the spoof_AVDaoi30.zip. Result was exactly same as with installing NanoDroidPatcher via Magisk - Bootloop.
    I am wondering why I put the service.jar into the package and the upload the whole thing. Does this make sense? The services.jar is on device, why this should be included into the package?
    the services jar starts out on your device. it gets pulled to your pc and the other files you download from the OP make the adjustments to it for signature spoofing. Then it replaces the existing services.jar in the zip you downloaded from the OP so you can use magisk to flash it back into your device, returning to whence it came but now with adjustments.

    Don't worry about the flickering screen and all the messages, that's normal. Just try to do what you need to working around them, yes it's annoying and makes it seem like you broke something but you didn't.

    I didn't use the nanodroiod zip, the other zip the OP provided, I used the microg one from the magisk repo. I know that one works fine. I noticed the nanodroid one tries to place the apks back into the product/priv-app where the originals should go, and even the new system_ext folder for the gsf one. maybe that's not good on some devices. I couldn't get it to work and had to abandon it. The magisk microg only uses /system/priv-app and it works fine for me.

    read the instructions on the magisk microg, it tells you to put a playstore apk into /data/adb before flashing if you want to use the real store, otherwise the fake store will be installed. ( you can always debloat that one and use the app systemizer module to cram a playstore there later)

    re: bootloops, sometimes it works if you just hold the power button and kill it, then let it try again. It worked for me that way today. I had to do that a couple of times when rebooting until finally it's just back to normal now and boots as quickly as it ever did.

    good luck
    1
    Hello, I have a question, this ROM for the S8, is it in beta? or can it be used normally?
    1
    @Kingslayer9988, (before some will ask,) I checked aosp 12 release and there is no way this @Lanchon based 'kickstarter' could work due to heavy changes in targeted PackageManagerService.java. We'll have to wait first for @MaR-V-iN or @maxwen (OmniRom) to finalize new aosp java patches.
    (Any help welcomed on https://gerrit.omnirom.org/q/microG...)

    Almost the same as in 11 :)