Re-signing with test-keys issue - myTouch 3G, Magic General

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

Related

Apktool and Rosie.apk

Okay I am trying to make some changes to my Rosie. I'm not going to ask how to make the changes I want I will hopefully figure it out myself....My question is about apktool. I keep getting FC on startup after trying to decompile and the build the rosie apk without making changes. What I've done
1) apktool d Rosie.apk
no errors ( Yes I have put the correct htc framework into apktool fw)
2)I Made no changes at all
cd Rosie
apktool b
3)I go to the build dir and the apk is there from here I have tried two different things
3a) Sign the apk using
java -jar signapk.jar testkey.x509.pem testkey.pk8 Rosie.apk your_app_signed.apk
3b)Leave the apk alone withouot signing it since it's a system app I dont think it needs to be signed, but I'm not sure
4) I put into a flashable file, in my update script I wipe dalvik cache as well, everything installs fine and I know this step isn't the issue
5) I reboot nand get constant FC so I have to pull the battery
I can't figure out why I'm getting this error so If anyone can help I would appreciate it alot....Thanks
it's not just Rosie I cant get to work....It's any apk...I decompile and build and they dont work with non changes....any ideas?
Hey bro I just started a thread on this in the theming section I'm with you on the Rosie.apk can't get it to work.
I haven't done system apps before, but I have successfully used apktool. There is (if it's different or maybe I'm just losing my mind) and additional tool called apk manager that utilizes the apk tool. That's what I've used that's so successful. It basically just gives you a list of choices with what to do with your apk. All you do is place the apk in the specific folder where the script can reach it and then run he script, make your choices, and bam. You have what you want. That could be either a system apk, regular apk, or a folder that's been decompiled. (I used a tool after that called j2gui that let's you take the .classes file and see a near perfect reproduction of the original java code).
Jack Attack!
I have had my fair share of dealings with Rosie, but apktool can do the job.
Everything up to Step 3 is good, although I don't 'cd' into Rosie, I just run:
apktool b Rosie from the previous folder.
Anyway, system files like Rosie do not need to be signed so scrap that route. The issue you have is with the new Rosie.apk that's been compiled not containing the original META-INF folder so won't be accepted by the system.
Check out this post that describes in full what I am trying to say. You'll want to focus on Step 3 and onwards in that post
i'm trying to do the same thing and i'm having a ton of different problems.
I believe about a month ago I checked the Apktool website and checked their list of bugs. There is a really nasty bug in the newest version (at the time I read it) where if you generated your .apk, then some things would be written incorrectly and of course would be the reason why your apps no longer work.
I'm gonna suggest you all check what versions you have and go to the previous version which worked great, or they might have fixed that already.

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.

[Q] [Help] Need help about decompiling apk's

Well, I was developing a little game, some days ago I formatted my pc and forgot to make a backup of my projects, fortunately I have .apk file in my dropbox account, so I tried to decompile using APKtoJava and browser decompiler.
I got res files, every XML file it's ok but, the src part is not fine at all.
Most of .java files can't compile, those files have errors, and reading the code I found variable names changed, strange code lines added, etc.
I could fix lines but last time modified files was on august (stopped development due to exams, etc), so I don't remember too much what I have done, in fact, expected to remember what I did reading code, but with those modified lines can't expect to remember fine.
I ask you for help, is there another way to get the code exactly I have made? or at least with no errors?
Thanks.
Well this happened to me too once, fortunately it was just a learning project for me, nothing important. But still I can understand how you feel. Try this -
Try decompiling from apk to java without selecting the smali code option. If you select smali code the whole code generally messes up. Also do not select the Convert to Eclipse Project option (although it could work in your case, never worked well for me). This way you will at least get your source files. Then use Virtuous Ten Studio, it will decompile everything perfectly except for source files. And then try to put them back together piece by piece, although it's easier said than done.
Good Luck with it :thumbup:
Sent from my Galaxy Nexus using Tapatalk

Can't decompile SecSettings ApkTool

Hi
I try to decompile SecSettings by apktool and i get this:
Code:
C:\apktool>apktool d secsettings.apk SecSettings23
I: Baksmaling...
I: Loading resource table...
Exception in thread "main" brut.androlib.AndrolibException: Multiple resources:
spec=0x7f020052 drawable/avatar_default_6, config=-hdpi
at brut.androlib.res.data.ResConfig.addResource(ResConfig.java:65)
at brut.androlib.res.data.ResConfig.addResource(ResConfig.java:58)
at brut.androlib.res.decoder.ARSCDecoder.readEntry(ARSCDecoder.java:196)
at brut.androlib.res.decoder.ARSCDecoder.readConfig(ARSCDecoder.java:165
)
at brut.androlib.res.decoder.ARSCDecoder.readType(ARSCDecoder.java:130)
at brut.androlib.res.decoder.ARSCDecoder.readPackage(ARSCDecoder.java:10
5)
at brut.androlib.res.decoder.ARSCDecoder.readTable(ARSCDecoder.java:82)
at brut.androlib.res.decoder.ARSCDecoder.decode(ARSCDecoder.java:48)
at brut.androlib.res.AndrolibResources.getResPackagesFromApk(AndrolibRes
ources.java:315)
at brut.androlib.res.AndrolibResources.loadMainPkg(AndrolibResources.jav
a:50)
at brut.androlib.res.AndrolibResources.getResTable(AndrolibResources.jav
a:43)
at brut.androlib.Androlib.getResTable(Androlib.java:44)
at brut.androlib.ApkDecoder.getResTable(ApkDecoder.java:148)
at brut.androlib.ApkDecoder.decode(ApkDecoder.java:98)
at brut.apktool.Main.cmdDecode(Main.java:128)
at brut.apktool.Main.main(Main.java:65)
What to do ??
Thanks
Please any help?
Same issue here
osherdadon said:
Please any help?
Click to expand...
Click to collapse
Using a Note 3 from T-Mobile, I pulled the file with the adb command, with root explorer, and extracted it from the stock ROM file all giving me the same error. For some reason I also don't get any smali files out of my SystemUI.apk which has been driving me crazy. I can't seem to find any working answers yet... Fail...
Basically bumping this thread a half a year later...
SOMEONE HELP US
You have the relevant frameworks installed and java in your path?
Learned a lot in 24 hours
DSA said:
You have the relevant frameworks installed and java in your path?
Click to expand...
Click to collapse
Summary/Lessons Learned in the last 24 hours:
I must have been too tired, went to sleep got up again and went at it. I realized a few things, main thing was deodexing, I learned all about that. Converting the .odex file to a class.dex file inside the SystemUI.apk and SecSettings.apk so decompiling would work properly (I was originally missing the smali folder without deodexing my app). Second I needed to pull all the framework files from my device instead of just the two I had, then I used "apktool if framework-res.apk" then "apktool if twframework-res.apk" then "apktool d SystemUI.apk" then "apktool d SecSettings.apk". This time it actually worked, I proceeded to try and re-compile them just to test. The SystemUI.apk worked flawlessly but the the SecSettings.apk had errors then I realized I needed to copy the AndroidManifest.xml and resources.arsc from the original app to the decompiled folder and the SecSettings.apk compiled with no issues. I had to get the original file out of the stock ROM, it had gotten damaged somehow with zipping/raring/7zipping so quicktip no one should be zipping the files you're about to work on get it fresh from the ROM.
Current Issue:
Now that all that's done I'm onto what I was trying to get at when I started this whole project. I need to modify both of these apps which are now perfectly deodexed and on my stock device. Every time I try to modify these files I lose my status bar and my settings stop working, I'm obviously breaking it, this is the XDA guide I was following.
Any help or redirection on where to post would be greatly appreciated, thanks
Easiest thing - put your mod back in and get the status bar to disappear/fc whatever
Then, pull a log (catalog from appstore works fine)
Post that log at pastebin and link it here
We won't be able to solve your issue without knowing what it is, in the first place
Like this?
This was before I restarted: Log 1
Then I recorded for a little after I restarted probably pointless but that's where the error would have been: Log 2
DSA said:
Easiest thing - put your mod back in and get the status bar to disappear/fc whatever
Then, pull a log (catalog from appstore works fine)
Post that log at pastebin and link it here
We won't be able to solve your issue without knowing what it is, in the first place
Click to expand...
Click to collapse
Not sure exactly how to record it and send it to you, I pressed record but when the phone finished rebooting CatLog was closed so I reopened it and it keeps scrolling endlessly.
Research progressed a little
I came across a post here in the Flashlight Mod development thread which made me realize I'm not getting the ID's correct. They suggest compiling the modded SystemUI.apk to get the ID's into the apk file under the /res/values/public.xml file, then decompiling it to read the ID values. I'm missing a step or doing something wrong, I can't replicate it to find the ID values I need so I can add them to the .smali file and recompile a final time. I'm sure this is the only reason for the missing status bar and the force closes. I guess I need help understanding, a different set of instructions or just more detailed?
I can't post in that thread yet so I'm getting my posts up over here, I already posted in the Q&A thread but no one has responded yet, any help is greatly appreciated!
I get this when decompiling the modded apk: Modded SystemUI ApkTool Decompile
All these errors look like the file is broken now or something, I'm just lost at this point. I tried ApkTool 1.5.2 and 2.0 as well.
EDIT:
Additional info below for troubleshooting purposes since it seems my issue recompiling at the end to get the values for my public.xml
STEPS:
1. deodex (universal deodexer v5)
2. decompile (apktool 1.5.2 & 2.0 separate tests)
3. modify (add flashlight .png's and .smali file from 4.4kk flashlight mod files)
4. recompile (apktool)
5. decompile (apktool)
=
Errors <<<<< These errors solved in edit below
EDIT:
I forgot to use "apktool if SystemUI.apk" when loading "framework-res.apk" & "twframework-res.apk" now I get through decompiling and recompiling like I thought I should be and I even located the values int he public.xml, replaced them in the .smali and everything went peachy. Only problem is I never get the status bar after I reboot, not really getting any FC's but the status bar, if my goal were to get it to be invisible I would be so happy omg lol If you're curious I've also tested by signing and even another test with zipalign, nothing zip/zero/zilch...
EDIT... Again I know still no sleep, durp durp:
So my main issue was not using apktool v1.5.2 to decompile and v2.0 to compile EVERY SINGLE TIME, NO EXCEPTIONS. When I followed that simple rule I get it onto my device and she has no status bar... Hmmmmm..... And a logcat for anyone smart enough to help me
EDIT:
Maybe I'm in the right direction with an error I saw in the log at this post? I thought it was so I installed the DisableSignatureVerification Mod from the Xposed Modules and still nothing.
Calling All Developers
It's been like 2 weeks just curious if anyone has even looked at this, I haven't been able to make any progress so I started learning how to develop apps. I made two small apps basic flashlight and a counter app but I really want to know why I'm totally unable to mod a file on my phone. I can't get the ink effect to work with finger input either I've been really trying to get this flashlight mod and the ink effect for months. If I could get pointed in the direction of a developer that can actually help me I don't see why I couldn't donate like $10 or $20 to the one who helps me. I'm on android 4.4.2 (NK3) on my Note 3 from T-Mobile.

Decompiling and recompiling Maps APK

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

Categories

Resources