How to spoof an app's signature? - Android Q&A, Help & Troubleshooting

Hello.
I have patched an app. The app resists to run since the app's signature is now changed.
How can I spoof the app's signature to make the app itself think that it's genuine and signed with the developer's signature?
Can I make this effect system-wide, so all apps that try to retrieve the app's signature actually gets spoofed signature?
Is there any XPosed/Magisk module that will allow me do to that?
I also saw the CorePatch XPosed module. The description says:
Code:
allow downgrade application [INSTALL_FAILED_VERSION_DOWNGRADE]
allows direct install apps after modify file in apk [ignore invalid digest error etc..]
allow overlay install apps with inconsistent signatures
Does it mean that it will allow me to install an apk with an invalid signature? For example if I somehow could copy the signature from the genuine APK to the patched APK despite the fact that the signature will not be valid.
If it does, then how can I copy the signature from the original APK to the patched APK?

okali said:
Hello.
I have patched an app. The app resists to run since the app's signature is now changed.
How can I spoof the app's signature to make the app itself think that it's genuine and signed with the developer's signature?
Can I make this effect system-wide, so all apps that try to retrieve the app's signature actually gets spoofed signature?
Is there any XPosed/Magisk module that will allow me do to that?
I also saw the CorePatch XPosed module. The description says:
Code:
allow downgrade application [INSTALL_FAILED_VERSION_DOWNGRADE]
allows direct install apps after modify file in apk [ignore invalid digest error etc..]
allow overlay install apps with inconsistent signatures
Does it mean that it will allow me to install an apk with an invalid signature? For example if I somehow could copy the signature from the genuine APK to the patched APK despite the fact that the signature will not be valid.
If it does, then how can I copy the signature from the original APK to the patched APK?
Click to expand...
Click to collapse
Hello and good afternoon, @okali
Welcome to XDA. I hope you'll always get the support you require.
However, prior to your next posting please read the guidances that are stuck on top of every forum like
Note: Questions go in Q&A Forum
If you are posting a Question Thread post it in the Q&A forum. Technical discussion of Android development and hacking. No noobs, please. Device-specific releases should go under the appropriate device forum...
forum.xda-developers.com
and the others. I've moved your thread to Android Q&A.
Thanks for your cooperation!
Regards
Oswald Boelcke
Senior Moderator

Related

modifying 2nd.zip package in root sdcardv4

I unzipped the 2nd_Albert_APP_update.zip and found the structure
\system\app and list of *.apk files.
question 1:
can I remove an apk file from 2nd_Albert_APP_update.zip in \system\app like twitter.apk without breaking the install process?
question 2:
Can I just add my own demo.apk files by simply copying them and saving the same archive and location mentioned above?
rp201 said:
I unzipped the 2nd_Albert_APP_update.zip and found the structure
\system\app and list of *.apk files.
question 1:
can I remove an apk file from 2nd_Albert_APP_update.zip in \system\app like twitter.apk without breaking the install process?
question 2:
Can I just add my own demo.apk files by simply copying them and saving the same archive and location mentioned above?
Click to expand...
Click to collapse
First of all wrong section. Second off if verification signatures are off, then you might* be able to assuming he used the package command, you might be able too.
Loglud said:
First of all wrong section. Second off if verification signatures are off, then you might* be able to assuming he used the package command, you might be able too.
Click to expand...
Click to collapse
sorry for wrong section, I was stuck between sections where to post.
I figured a metafile edit or package signing tool might be needed I did not want a simple yes response. I guess I will hijack my own post and change it a more dev type question.
Any rough steps you can give me to do this myself that I can then do searches on?
figure I'll have to
download android sdk.
examine metafile xy.z
look for section [] and edit
place apks in structure
buildpacktool.exe to look for.
any help would be greatly appreciated
thanks
rp201 said:
sorry for wrong section, I was stuck between sections where to post.
I figured a metafile edit or package signing tool might be needed I did not want a simple yes response. I guess I will hijack my own post and change it a more dev type question.
Any rough steps you can give me to do this myself that I can then do searches on?
figure I'll have to
download android sdk.
examine metafile xy.z
look for section [] and edit
place apks in structure
buildpacktool.exe to look for.
any help would be greatly appreciated
thanks
Click to expand...
Click to collapse
um sure. So first of the great thing is you really shouldn't have to do much. The basic premiss of this is that it uses a update.zip to flash via CWM, which means you shouldnt have to sign the package. Basic premiss, is I would first try unziping deleting and putting packages into ./system/app/ rezipping and then trying to flash that. That should be good enough to make your own. Second off if you really want to, you can look at the meta-data/.../update-script. There are some good guides on how to script this file.
http://forum.xda-developers.com/showthread.php?t=994940

Can't download any apk file

Hello people, first i'm sorry if i'm on the wrong forum. My problem is in the title, i can't download any .apk file, when i try to download an apk from chrome, it shows me an unknown error, when i try to download an apk from firefox it's the same error, and if i try to transfer the file from my pc to my phone, i get an error installing the app, it's like my phone accepts everything except apk files, i have no anti-virus or task killer, no firewall or something, help me please
Thread Closed as its already posted here :- https://forum.xda-developers.com/android/help/download-apk-t3692223/post74240507
Kindly avoid creating duplicated threads/posts
https://forum.xda-developers.com/android/help/download-install-apk-file-t3691970#post74248744
5. Create a thread or post a message only once.
As a large forum, we don't need unnecessary clutter. You're free to edit your message as you like, so if you do not receive an answer, revisit your message and see if you can describe your problem better. Not everyone is online at the same time so it might take a while before you receive an answer.
Click to expand...
Click to collapse
Thanks
XDA Staff.

Error installing Launcher extracted from the ROM of an android gamebox

Hello
First of all I want to say that I use BLISS OS x86 7.1.2 system on the mini pc Alfawise X5
then extract a LAUNCHER.apk from the GEMBOX F500 device at this link: https://forum.xda-developers.com/showthread.php?t=2692843&page=69
but I can not install it because I have the error "app not installed the package conflicts with an existing package". The problem is that this launcher has never been installed on my device, this error occurs with other applications that were made exclusively for satelite android receivers of my country, already tried to install and the same error occurs, but they were never installed on my device, someone knows the can I do to install LAUNCHERf500.apk ??????
Sorry for my english I'm using google translate, thanks for the attention !!
Decompile the apk and change its package name in the Android manifest
Or
Use an app cloner that might be able to do it for you
However doing this may cause problems eg some features may not work or app may force close
You can also find out what the package name is & try uninstalling it via adb so you can install the apk with the same package name
Also Iv no idea why you have posted this in the mx player xda section as it's nothing to do with it so I'll get it moved
TheFixItMan said:
Decompile the apk and change its package name in the Android manifest
Or
Use an app cloner that might be able to do it for you
However doing this may cause problems eg some features may not work or app may force close
You can also find out what the package name is & try uninstalling it via adb so you can install the apk with the same package name
Also Iv no idea why you have posted this in the mx player xda section as it's nothing to do with it so I'll get it moved
Click to expand...
Click to collapse
I already did this but did not install apk
I already cloned, and changed the package name.
is there a lock, or a way of knowing that apk is being installed on hardware other than GEMBOX F500 ???
Can I change the application to install on my device?
or changing Build.prop ??
Sorry for posting in the wrong place, I'm not familiar with the site
dividafox said:
I already did this but did not install apk
I already cloned, and changed the package name.
is there a lock, or a way of knowing that apk is being installed on hardware other than GEMBOX F500 ???
Can I change the application to install on my device?
or changing Build.prop ??
Sorry for posting in the wrong place, I'm not familiar with the site
Click to expand...
Click to collapse
Since it's a launcher I assume you are rooted and placing the apk in system/priv-app (system/app if pre lollipop) and giving it the correct permissions then restarting the device
Some launchers are only designed to work on certain devices & would require porting to work on others
Anyway - best to actually post in your device forum or the general if your device does not have its own forum
Iv asked the mods to move this as it has nothing to do with mx player

Where is the system upgrade within the filesystem?

My Realme 7 has a notification which reads:
"New system version downloaded. Install now!
RMX2155_11_A.78"
Where is it located within the filesystem?
Is it somewhere I can copy from on an unrooted device?
I'm assuming Magisk can use this to get it's 'boot.img' file & others may be interested in a copy too.
@alanthehat THREAD CLOSED as you've already created a similar one minutes ago:
I have a 'system upgrade', where is it?
My Realme 7 has a notification which reads: "New system version downloaded. Install now! RMX2155_11_A.78" Where is it located within the filesystem? Is it somewhere I can copy from on an unrooted device? I'm assuming Magisk can use this...
forum.xda-developers.com
XDA Forum Rules (excerpt):
...
5. Create a thread topic or post a message only once, this includes external links & streaming media.
As a large forum, we don't need unnecessary clutter. You're free to edit your message as you like, so if you do not receive an answer, revisit your message and see if you can describe your problem better. Not everyone is online at the same time so it might take a while before you receive an answer.
You can bump your unanswered question once every 24 hours
Duplicate threads and posts will be removed
Always post in an existing thread if a topic already exists, before creating a new thread.
Use our search function to find the best forum for your device.
Links to an external source are only allowed if relevant to the topic in hand. A description must be included, no copy & pasting from the original source.
Self-promotion is forbidden, this includes blogs, social media and video channels etc. Random links will be removed.
...
Click to expand...
Click to collapse

Need step by step instructions how to automatically add files to the APK in Android Studio

I am trying to do this very trivial task, but I cannot find any complete instructions on how to do it.
So far, I gathered that
APK is just an archive that files can be added to using aapt add MyApp.apk file1 file2 ...
Or the files must be added to the assets folder
The APK must be less than 100mb to be allowed on the APP store
The files must be signed
The problem is that I am finding these one-line answers in Stack Overflow questions, and not in any official instructions from Android Studio developers, and they leave a lot of necessary steps out. Which I have to guess, like where to put the files, where are they getting stored on the device. If adding files to the assets folder, I need to know Which assets folder? app/build/intermediate? Do I need to add something to Gradle scripts? Are there any other steps?
This is a very basic thing that probably every android app needs to do, and I am baffled that there is not an option or support in the IDE to import and sign the files being used by the application.
So far I had to resort to manually uploading these files (YOLO ONNX models, label text files, test images, etc) to my phone and the emulator for testing.
I am looking for some clear and concise step by step instructions to how someone can add something like a text or image file to their APK, sign it, and make it deploy to the phone or emulator automatically when building, running, or debugging the app.
Can someone please help point me to such a resource?
Thank you,
dmitryengr said:
I am trying to do this very trivial task, but I cannot find any complete instructions on how to do it.
So far, I gathered that
APK is just an archive that files can be added to using aapt add MyApp.apk file1 file2 ...
Or the files must be added to the assets folder
The APK must be less than 100mb to be allowed on the APP store
The files must be signed
The problem is that I am finding these one-line answers in Stack Overflow questions, and not in any official instructions from Android Studio developers, and they leave a lot of necessary steps out. Which I have to guess, like where to put the files, where are they getting stored on the device. If adding files to the assets folder, I need to know Which assets folder? app/build/intermediate? Do I need to add something to Gradle scripts? Are there any other steps?
This is a very basic thing that probably every android app needs to do, and I am baffled that there is not an option or support in the IDE to import and sign the files being used by the application.
So far I had to resort to manually uploading these files (YOLO ONNX models, label text files, test images, etc) to my phone and the emulator for testing.
I am looking for some clear and concise step by step instructions to how someone can add something like a text or image file to their APK, sign it, and make it deploy to the phone or emulator automatically when building, running, or debugging the app.
Can someone please help point me to such a resource?
Thank you,
Click to expand...
Click to collapse
Hello and good afternoon, @dmitryengr
Welcome to XDA! I hope you'll always get the support you require.
However, prior to your next posting please read the guidances that are stuck on top of every forum like
Note: Questions go in Q&A Forum
If you are posting a Question Thread post it in the Q&A forum. Technical discussion of Android development and hacking. No noobs, please. Device-specific releases should go under the appropriate device forum...
forum.xda-developers.com
and the others. I've moved your thread to Android Q&A.
Thanks for your cooperation!
Regards
Oswald Boelcke
Senior Moderator

Categories

Resources