Decompiling and recompiling Maps APK - Java for Android App Development

Hi,
I wanted to decompile, modify XMLs only of the Google Maps app and add one asset, and recompile the APK (only for personal use). I don't need to edit any of the source code. I already tried this process but the package will not install on my Galaxy S5. I just added an extra permission (may not be used since the code doesn't use it) and when I try to install the new APK it tells me that it requires the new permission (which is good), but when I click 'install' it tries to do it but ultimately says "app not installed."
Does anyone have any idea as to what is going on? I understand that once I sign the package with my own keystore, the Google API will stop working. I tried to create my own Google API key that is linked to my keystore, but that didn't seem to resolve the issue. I would appreciate any help from someone who has done this previously.
Thank you very much!

i'll do and tell you the results ...
Sent from my MI 4LTE using Tapatalk

Related

Re-signing with test-keys issue

I have been breaking my head on this one for a while, so hopefully someone can give me some pointers...
I'm having troubles re-signing a stock ROM with testkeys.
When I re-sign ALL apk files (in app and the one in framework) with test-keys I get the error : "ERROR/Sync(125): Google login service not found." at boot.
When I don't sign anything the ROM boots fine...
Code:
08-17 20:48:39.326: ERROR/Sync(125): Google login service not found
08-17 20:48:39.326: ERROR/Sync(125): com.google.android.googlelogin.GoogleLoginServiceNotFoundException: The Google login service cannot be verified.
08-17 20:48:39.326: ERROR/Sync(125): at com.google.android.googlelogin.GoogleLoginServiceBlockingHelper.checkGoogleLoginServiceVerificationLocked(GoogleLoginServiceBlockingHelper.java:271)
08-17 20:48:39.326: ERROR/Sync(125): at com.google.android.googlelogin.GoogleLoginServiceBlockingHelper.getLoginService(GoogleLoginServiceBlockingHelper.java:260)
08-17 20:48:39.326: ERROR/Sync(125): at com.google.android.googlelogin.GoogleLoginServiceBlockingHelper.getAccounts(GoogleLoginServiceBlockingHelper.java:347)
08-17 20:48:39.326: ERROR/Sync(125): at com.google.android.googlelogin.GoogleLoginServiceBlockingHelper.getAccounts(GoogleLoginServiceBlockingHelper.java:329)
08-17 20:48:39.326: ERROR/Sync(125): at com.google.android.providers.AbstractGDataSyncAdapter.onSyncStarting(AbstractGDataSyncAdapter.java:1178)
08-17 20:48:39.326: ERROR/Sync(125): at com.android.providers.contacts.ContactsSyncAdapter.onSyncStarting(ContactsSyncAdapter.java:1219)
08-17 20:48:39.326: ERROR/Sync(125): at android.content.TempProviderSyncAdapter$SyncThread.sync(TempProviderSyncAdapter.java:236)
08-17 20:48:39.326: ERROR/Sync(125): at android.content.TempProviderSyncAdapter$SyncThread.run(TempProviderSyncAdapter.java:210)
You don't need to resign the APK's.
The full update.zip should be enough =)
Though it is still quite a mystery why the Google Login won't work when signed with a test-key.
maxisma said:
You don't need to resign the APK's.
The full update.zip should be enough =)
Click to expand...
Click to collapse
That is correct, the ROM works fine when I sign the full update.zip
I just would like to know why this it is giving problems when you resign everything... I would be nice to know the exact reason behind this issue.
Is there any advantage to signing all the apks, or is this just an academic exercise? I tried (and obviously failed) when messing with the T-Mobile stock ROM but like you said it works fine without.
Amon_RA did you ever find away to get this to work? I'm asking because I've tried re-signing all the apk's in /system/app & /system/framework on my Rogers build so I could include irrenhaus' Advanced Launcher v17 as a HTCLauncher replacement. If it's flashed as an "update" after the the rom is setup, running, etc. It works fine. But as soon as you wipe, you start getting boot loops. When you resign every apk, it'll flash in the build fine, but you can't access the market or sign into google. It's not only me, but Soulife & Enomther have spent quite a bit of time looking into this also. So, before someone say's just throw it into the /system/app directory & re-sign the update.zip, you can't it because it won't work properly. Any suggestions would be appreciated! Thanks.
kb7sqi said:
Amon_RA did you ever find away to get this to work? I'm asking because I've tried re-signing all the apk's in /system/app & /system/framework on my Rogers build so I could include irrenhaus' Advanced Launcher v17 as a HTCLauncher replacement. If it's flashed as an "update" after the the rom is setup, running, etc. It works fine. But as soon as you wipe, you start getting boot loops. When you resign every apk, it'll flash in the build fine, but you can't access the market or sign into google. It's not only me, but Soulife & Enomther have spent quite a bit of time looking into this also. So, before someone say's just throw it into the /system/app directory & re-sign the update.zip, you can't it because it won't work properly. Any suggestions would be appreciated! Thanks.
Click to expand...
Click to collapse
Some of the google apps have a "Signature" that is checks against itself to see if it's been modified - you'd need toedit that to make them work
Amon_RA said:
That is correct, the ROM works fine when I sign the full update.zip
I just would like to know why this it is giving problems when you resign everything... I would be nice to know the exact reason behind this issue.
Click to expand...
Click to collapse
its because it needs a release keys signature to login not test keys ;-)
idk where i read it but i do believe it originated it in a thread by stericson having to do with theming android and why test keys wont sign some apps or files for them to work they need to be signed with a release keys version like the actual Google signature not their open source signature they give us to sign apk's etc
Hello everyone - I do development on the myTouch Slide, but I have a question related to this post: how do we re-sign the HTC resources file (com.htc.resources.apk) with test keys? I've essentially decompiled it and built it back (using apktool), then signed the resulting APK with signapk.jar using the test keys, but when Android is being loaded it's unable to find the 'Resources'. (I haven't even arrived at this so-called 'Google Login' error - the GUI won't even load due to an error in HTCLockScreen not finding the resources).
The reason this all came about is because I'm looking for an easy way to edit the file and perform any changes I want to it. The 7-zip method is hackish and is specific to Windows - I am looking for a way where I can go as far as to edit the XML files in the package, but the 7-zip method doesn't work for that (because the XML files are compiled).
Any ideas? Can people link posts related to this? Thanks.
EDIT: Ok, some people are probably going to point out that I can hex edit the file through 7zip, but I would rather not do that, especially since I do not run Windows for my Android development.
I've actually discovered that the reason 7zip works is because it technically doesn't follow zip format specifications. Once you edit a file from within 7zip and save the changes 7zip doesn't calculate the CRC of the new (updated) file. Android proceeds to load the APK because the CRC hashes in the zip file are still "correct", but really they're not.
While this doesn't answer my original question, it does provide a possibility of extending other (non-Windows) utilities with the sole intended function of hacking APKs.
EDIT: I'm not entirely sure this is correct information as I'm still trying to sort through the different actions that various programs (Android included) take on an APK, plus I can't find a specification of an APK file (other than people simply saying its "similar to a zip").
I been looking at this as well and hopefully can help. First look at my signature for a release key maker for those that wanna know. okay so this is just all theory but I been looking to resign all apks with the same signature my signature. Reason being is I'm helping to port froyo sense to sprint hero and there's alot of smali editing and resigning of apks. I have noticed while doing this that some proprietary apks have this in there android manifest xml "androidprotection:signature". I'm not a genious but i'm guessing that is what checks the signature or rathere requires it.
I also noticed that there is a keystore file in /system/bin (at least in sense roms ).
That might be where the signature is kept. But I'm thinking that if you disable the requirement for a signature in the android manifest you might be able to resign the apks I haven't tried this yet since I'm sure someone has some feedback annd it's 348 in the morning i'm going to bed

Rename an apk so you can install it twice

I've been looking for a way to do this for the past couple days with no luck. Just to get any suspicions out of the way, I am not using this to steal someone else's work, it's for a workaround for a game that I'm trying to accomplish using two save files. I've tried going into the android manifest, editing the package name, and then resigning the apk with no luck (i just get parsing errors when I try to install). Is there any way that this can be done? or am I missing something?
It is not a simple matter.
APKs are managed by package name, not by file name, but you can't simply change the package name in the manifest of a compiled APK.
Even assuming you manage to do it without messing up the file, which is not a simple task, there will still be code referring to the package name, so the app will crash.
To put it simply, you would be better off getting your device rooted (if you don't already have root) and playing with the application data files if you want to cheat at some game.

How to keep signature after modify apk

How to keep signature after modify apk?
Google said just replace the classes.dex and some files.
But I cant install the apk.
You cannot. And that limitation is there for a reason! That way nobody else than the developer himself can insert code and therefore malware into an app's code. The user will be notified that there's something wrong with the apk. It's more secure for the user and for the developer.
If you want to install your app though, uninstall the app and then you'll be able to install the new, modified apk.
If you happen to be using Eclipse, there is a setting to automatically uninstall the old app if they have different signatures. As somebody who bounces back and forth between computers (each use a different signature when running debug), as well as the live version of my app, this is incredibly helpful, as it saves about 20 seconds of having to go into settings and uninstalling.
You can keep the signature bynot modyfying the manifest. Also theres an window app taht called VTS. that can preserve the signature sir.

[APKTOOL] Package couldn't be installed ... base.apk code is missing

Hi,
today Samsung published the Beta Browser and the Edge panel for opening web pages does not work anymore as the package name of the browser changed.
I decompiled the sbrowseredge app, changed the app name as well as the hardcoded part (in cocktail_widget.xml) to the beta, compiled it again with apktool 2.2.2 and signed without problems. However, I'm not getting it installed.
Failed to install Internet panel_2.0.14\dist\Internet panel_2.0.14.apk: Failure [INSTALL_FAILED_INVALID_APK: Package couldn't be installed in /data/app/myapp.sbrowseredge-1: Package /data/app/myapp.sbrowseredge-1/base.apk code is missing]
Click to expand...
Click to collapse
I installed the Nougat framework-res.apk for apktool. What else do I miss?
I still use jarsigner and thus v1 signing, however, my own apps (not Samsung related) do install without any problems.
(I tried as well just to decompile, change name only and compile/sign again with the same result.)
Thank you!
Andreas
andiling said:
Hi,
today Samsung published the Beta Browser and the Edge panel for opening web pages does not work anymore as the package name of the browser changed.
I decompiled the sbrowseredge app, changed the app name as well as the hardcoded part (in cocktail_widget.xml) to the beta, compiled it again with apktool 2.2.2 and signed without problems. However, I'm not getting it installed.
I installed the Nougat framework-res.apk for apktool. What else do I miss?
I still use jarsigner and thus v1 signing, however, my own apps (not Samsung related) do install without any problems.
(I tried as well just to decompile, change name only and compile/sign again with the same result.)
Thank you!
Andreas
Click to expand...
Click to collapse
I just tried and it works... here... https://www.sammobile.com/apk/samsung-internet-beta/samsung-internet-beta-5-4-00-3/
S7 Edge Powered By Echoe

How to change and layout xml file from apk and repack it

I have a following APK of JIO tv app Reddit Thread
APK Mirror Link
Problem:
I have installed it on my Mi Box android Tv. It works flawless. But on every restart, it ask for username and password.
The person who shared this apk has already filled the login details, which is in res/layout/fragment_details.xml.
I want to change the login details there, so that I don't have to type username and password every time, I start Mi Box.
I tried using apktools and Android studio to decompile and repack it with modified xml.
But, modified APK give error, Not installed.
Thanks in advance.
Hi, did u find a solution?
Did you try signing the apk?

Categories

Resources