[Q] Recompiling modded Framework - Streak 5 Q&A, Help & Troubleshooting

I'm doing a theme for DSC and I'm having some trouble recompiling the framework. I'm using AutoAPKTool, and most of the tutorials I've seen recommend starting off with a stock, not modded framework, to prevent errors when recompiling. DSC uses a modded framework, and I'm not sure a 407 stock framework would work with DSC.
So can anyone tell me what should I do to properly recompile the framework? If I attempt to recompile it just after decompiling, without performing any other modifications, the log says something about some strings not having a default translation, if I remember correctly.

Strings not having default translations isnt a critical issue, it'll still work if that's the only error it's giving.

It's ok, simply ignore that, as I used translation fron Nexus S ROM (mostly) and it's not a perfect match

I use apktool 1.4.2 for decompile and apktool 1.4.3 to recompile, make sure you have latest aapt from android sdk.
If you want edit the value and xml use notepad++ but do not copy paste as I always have issue when recompile it, just edit manually use compare plugin.
Sent from my PC36100 using Tapatalk 2

Thanks guys. Apparently there were other problems as well, but they all went away when I deleted everything and reinstalled the latest version of autoapktool. Now it finally outputs the recompiled framework.

Related

[Q] how to modd .xml files of a theme ?

Hi all,
I'd like to modify some .xml files in the Gingerbread Theme that are in the resources.arsc file. I'm using Apk Manager 4.9 and I'm unable to compile twframework-res and framework-res: a lot of errors appears and resources.arsc isn't rebuild. It seems that it's a problem of dependencies. What file(s) I need ? Is there a way ?
I have a lot of errors like this :
"......\public.xml:172: error: Public symbol drawable/ic_menu_account_list declared here is not defined."
I tried with all the 38 themes and it's the same thing.
Note: When i use apk manager with an app it works and resources.arsc is rebuild.
Thanks in advance
clarkkov said:
You should discuss this with the app developer, this is obviously app specific issue - and who is most likely to know this app the best(?). I think that framework.apk(s) depend on more .apk(s) inside the OS, i.e. they are not independent like the 3rd party apps.
Click to expand...
Click to collapse
Yes. It's strange because when I use apk manager with a stock framework apk (JPM for example) there are no errors and resources.arsc is rebuild. So there is no dependencies with the OS...
And all the modded themes are uncompilable ...
thx !
I found the reason :
The framework-res.apk contains corrupted .9.png's images files ...
And every theme posted around there were modified with the sames .9.png's corrupted files ! Someone forgot to use the tools to mod this king of files or forgot to compile them ...
So, to solve this and to be able to compile all the framework-res.apk you have to get back the non corrupted .9.png's files from stock ROM.
I think the same problem is also present in twframework-res.apk; I will see later.
cheers.

Recompling an apk questions

Trying to modify contacts.apk to make the dialer multi-dpi compatible. Did that and it works.
My issue is recompiling the apk. Everytime I recompile the apk with apktool it looses over a megabyte in size. In my case went from 4.49MB to 3.19MB after rebuilding. Only file modified was dialer_app.xml and it's size stayed about the same.
I've brought framework-res.apk and twframework.apk into apktool. After copying the resulting contacts.apk back to the device it is not recognized.
I've also tried copying the META-INF directory from the original apk over to the new one. Still no luck. I'm new to this and if anyone has some help for me it would be greatly appreciated!
Did you sign your new apk after recompiling it ?
Do you have classes.dex and resources.arsc files in your new apk ?
since its a system apk I've read it shouldn't be signed. Only thing I did was copy the META-INF folder to the new apk. In the new apk I do see classes.dex and resources.arsc. All the files appear to be there but the apk has shrunken in size.
I'm guessing I'm missing something simple here. But I'm new to this. Been at it for a few hours haven't had any luck.
I am new in development field. I have two questions 1. Is there same meaning for building and recompiling using apk tool? 2. I know framework-res.apk is needed for apktool d com, but where and the what is the use of twframework.apk file. Please explain anyone .
Recompiled apks will be quite a bit smaller as they will have more compression applied, this is normal, just be careful as if the tool compresses it to much you will get fc's. But it should work fine.
idhbar said:
I am new in development field. I have two questions 1. Is there same meaning for building and recompiling using apk tool? 2. I know framework-res.apk is needed for apktool d com, but where and the what is the use of twframework.apk file. Please explain anyone .
Click to expand...
Click to collapse
Read the apktool website for info about framework files, as far as which one to use, if you are decompiling a la2 or la4 base use a kl2 or kk5 framework without jkays built in as the laX frameworks are kinda buggy.
Sent from my GT-I9100 using Tapatalk

modifying system APK's for the atrix?

hey all, i'm starting to get into modding my atrix and i have some questions about modifying the system APK's. i've already deodexed /system/app and /system/framework with xUltimate. i'm using APK Manager in linux to decompile the APK's that i want to mod.
the problem comes when i compile the new APK and upload it to /system/app. the stock APK's are signed seemingly with a specific signature that the phone is looking for. APK Manager says to not sign the APK's that you intend to install to /system, but if you do choose to sign it, the certs that are used are not what the atrix is expecting. when i look for errors in logcat, its indicating that the package changed and that its trying to look for the matching cert within /data/secure.
how does one modify these system APK's, and keep the original signature intact? it looks like the manifest contains a sha1-digest signature of each file, which makes just copying/pasting the META-INF into the new APK not an option.
thanks in advance!
What I do is decompile to change xml's etc and then recompile without signing and then just drag the edited files from the new APK to the old one.
Sent from my MB860 using XDA
so does that mean it doesn't really matter that the sha1 signatures of the changed files dont get updated in the manifest?
is there not an agreed-upon method to do this that doesn't seem so "hacky" ?
Sent from my MB860 using XDA
I'm not sure mate. That's the way I found out how to do it and I've done translations and a few themes and framework-res systemui and settings have worked fine doing it the way I do it.
Sent from my MB860 using XDA

[Dev Help][Emergency]Regarding Modifying AndroidManifest.xml and signing system apps

I am trying to modify AndroidManifest.xml of settings.apk
But as we all know, if we modify that AndroidManifest.xml, we have to sign the apk so when I modify the AndroidManifest.xml and sign the settings.apk and push it then it doesnt get installed and I get a error in logcat saying there is a mismatch in signatures of the apk and system uid.
Then I tried restoring stock signatures but it still doesnt get installed and in log it says the apk has no signatures because I modified AndroidManifest.xml.
Do anyone have solution for this to sign system apps properly or any other workaround?
I came to know that every system apk and framework apk must be batch signed incase of editing the manifest xml.
I don't think that every apk needs to be re-signed. I've never done this, but my thought was that any apk that has an AndroidManifest.xml with the same original modified dates (you can check the dates with 7-zip) need to re-signed together. Won't it mess up some other apks that don't need to be re-signed if you were to re-sign everything? Please let me know if I am way off..
Also, note that there are other ways to invert the colors in apks besides editing the AndroidManifest... (i.e. edit the /values/styles.xml, /layout/*.xml, etc... can be a pain, but it works) - Sorry, but I guess I am assuming that that's what you are going after by editing the AndroidManifest in the Settings.apk... again, anyone feel free to correct me if I'm wrong on anything here - I am all for learning and sharing!
^^No I dont want to theme it or colorize it
I am adding new functionality for which some new permissions and activity declaration is needed in Manifest file
But if I modify Manifest and use stock signature files it doesnt install and if I resign it then it say signature mismatch with system uid.
Bump!!
I have edited the AndroidManifest.xml in the Settings.apk (for theme color change), and I did not re-sign it after compiling, I retained the originals.
And, it worked fine when I put it on my phone alone (with a flashable zip package), BUT (this is a big but), - it did not get installed when I put it in a ROM package together with all the system files. That's when the signatures become an issue... you need to then re-sign all, or nearly all apps and framework.
At least that's my experience...
Check out this thread.. http://forum.xda-developers.com/showpost.php?p=28475720&postcount=63
Sent from my phone's mind
Oh then I have to sign all system apks
Any other way?
Do you know how to sign with system key which will match system uid?
Only for AOSP ROMs you can resign and apks work. Samsung use closed source.....how could you ever match signatures? Also don't change the Manifest. Leave it. Who says you have to change it?
Note that its via the public.xml that you need to add these listings as to what the apk is now doing. No the manifest. Is it going to market? No so don't change manifest simple. If it is then it shouldn't really be a system app. Also you can disable signature checking within your ROM if that is all you are worried about. I have signed apks from the market that I have themed and then installed them to system and they work fine. Its the apks you use that have dependencies that WON'T work. I.e. apks like Samsung TWiz apks that listen for the system vold boot complete proprietary to Samsung or say an ASOP apk that is trying to chime into something that is framework related in a non-asop ROM.....this then becomes a permissions issue
---------- Post added at 05:09 AM ---------- Previous post was at 05:05 AM ----------
PS: I have edited androidmanifest anyway and apks still work fine.... upgraded the SNS apk to ensure it was fit for use above and beyond SDK 10
varun.chitre15 said:
I am trying to modify AndroidManifest.xml of settings.apk
But as we all know, if we modify that AndroidManifest.xml, we have to sign the apk so when I modify the AndroidManifest.xml and sign the settings.apk and push it then it doesnt get installed and I get a error in logcat saying there is a mismatch in signatures of the apk and system uid.
Then I tried restoring stock signatures but it still doesnt get installed and in log it says the apk has no signatures because I modified AndroidManifest.xml.
Do anyone have solution for this to sign system apps properly or any other workaround?
Click to expand...
Click to collapse
Did you figure out in the end? Still stuck with same problem as you

[Q] Modifying APKs - wont install

I'm looking for a little bit of guidance. I want to modify some apps but when I do I can't seem to get them working on devices.
I am happy with the use of APK tool and zipaling, and have successfully modified my SystemUI.apk but when I try to mod apps it does not work.
I have tried modding the apk in data/app and just replacing the file and tried modding the downloaded apk and try to install.
My process:
Decompile (APKtool)
Mod
Recompile (APKtool) - with errors
I add the files from the original APK that errored during recompile with 7zip
Zipaling
Transfer back to the device
Devices
Samsung S3 mini & Nexus 7 - both running stock rooted JB 4.1.1
You need to sign the apk before you can install them. Get the signapk.jar and either get the test keys or make your own keys. Once the zip is final (after 7zip) sign the apk and then do a zipalign.
Unless you are sure that the compilation errors are serious, consider fixing them.

Categories

Resources