[Q] Need some help modding APK - Verizon HTC One (M8)

I was trying to mod dotview apk to replace HTC voice assist with Google Now and maybe you can help me.
I decompiled the apk and stuck in logcats so I can follow the execution path but I cannot seem to get it to run.
First time I forgot to sign it, so that crashed.
But even once I signed it and pushed it to priv-app I couldn't boot my phone. It may be because I'm in ART... Idk.
I guess I'm a bit lost... Lol. Maybe you can help me...
How does odex/deodex affect apk modding?
Does art affect apk modding?
Do I need HTCs certificates or is the default test cert OK?
What would be the rough outline to mod an apk?
(I'm comfortable modding the smali, I just don't know how to put the apk back properly)
Thank you so much.
Sent from my HTC6525LVW using Tapatalk

David 617 said:
I was trying to mod dotview apk to replace HTC voice assist with Google Now and maybe you can help me.
I decompiled the apk and stuck in logcats so I can follow the execution path but I cannot seem to get it to run.
First time I forgot to sign it, so that crashed.
But even once I signed it and pushed it to priv-app I couldn't boot my phone. It may be because I'm in ART... Idk.
I guess I'm a bit lost... Lol. Maybe you can help me...
How does odex/deodex affect apk modding?
Does art affect apk modding?
Do I need HTCs certificates or is the default test cert OK?
What would be the rough outline to mod an apk?
(I'm comfortable modding the smali, I just don't know how to put the apk back properly)
Thank you so much.
Sent from my HTC6525LVW using Tapatalk
Click to expand...
Click to collapse
You should place the original HTC certs in the Apk. I always do.
I Have noted that ART will not allow APK's to be modded easily and have to switch back to Dalvik Execution. I had this problem with APM.
As far as rough outline to Mod an apk that is a pretty open question.
I would say, downloaded it, decompile it, edit it, re-compile it. Push it / flash it.

scrosler said:
You should place the original HTC certs in the Apk. I always do.
I Have noted that ART will not allow APK's to be modded easily and have to switch back to Dalvik Execution. I had this problem with APM.
As far as rough outline to Mod an apk that is a pretty open question.
I would say, downloaded it, decompile it, edit it, re-compile it. Push it / flash it.
Click to expand...
Click to collapse
Thanks
How did you get the original certs? Is that the meta.inf folder?
Do I need to 'Sign' the apk after recompiling or is moving meta.inf enough?
Should I worry about odex/deodex?
Sent from my HTC6525LVW using Tapatalk

Hi,
just found out your thread,
no clue on how to help you here but i'd definitely be interested in your mod!
I'm using autovoice (a plugin for tasker for voice commands)... Once you find out hew to have google now work do you think it would be possible to make a mod for autovoice as well? (I'll pay a few beers for that!)
thanks for your work on that anyway

Related

[Q] Editing more than just images in Phone / contacts apks

Howdy all,
I am wanting to kno if there is anything special about editing certain system apps, do they all need to be signed with the same keys. i think i read this somewhere.
cause when i decompile the phone.apk then recompile with no changes / or with changes, signed it with autosigner or APK-Manager, it just FC's on the phone and i cant make sence of the logs...
oh and i tried pushing the file with adb and x10 mod tool, tried in the emulator, still no joys.
been googling for hours... and i feel i am searching for the wrong things...
Thanks in advance
Pvy.
you can use 7zip to browse the apk as an archive and replace png's and .9.png's inside the drawable folders.
you wouldn't have to resign the apk this way, but i would recommend zip-aligning the apk after you replace the png's.
i would also make sure you know how to work with .9.png's before replacing them. not doing .9.png's correctly will break the app.
I have edited the pngs there is no prob there I can put all the images in.
I am editing the xmls and the manifest... I tried drag and drop but it seems to break the apk...
Thanks tho.
Sent from my X10i using XDA App
Go ahead and compile with apk manager, say yes to 'is it a system apk?'.
Then open the new apk with 7zip and pull out the xmls, etc. you changed.
After that open the original apk w/7zip and drag in the compiled xmls along with your images.
That should work.
So I did this,
compiled phone.apk chose system app when it asked.
drag and dropped the 3 pngs I modded, and a few xml files, and the modded androidmanifest.xml to the original
Pushed it to my phone, rebooted...
But it wont install.
It appears the signing breaks.
Pvy
AyDee said:
Go ahead and compile with apk manager, say yes to 'is it a system apk?'.
Then open the new apk with 7zip and pull out the xmls, etc. you changed.
After that open the original apk w/7zip and drag in the compiled xmls along with your images.
That should work.
Click to expand...
Click to collapse
Sent from my X10i using XDA App
Changing default image
I wondered if anyone could help me out with this
Many thanks
pvyParts said:
So I did this,
compiled phone.apk chose system app when it asked.
drag and dropped the 3 pngs I modded, and a few xml files, and the modded androidmanifest.xml to the original
Click to expand...
Click to collapse
My suggestion is after doing this add the now modded original .apk into a flashable.zip and use xRecovery/FreeXperiaRecovery to install the app.
If you don't know how to make a flashable.zip just use 7zip to replace the phone.apk in a theme update.zip and delete any other folders/.apks that you don't want being reinstalled (framework-res etc.).
Not sure if this will work because I haven't tried this after modding .xml files, but it works after I make any other changes, even changing .9.pngs.
Best of luck, hope this works.
nope that didn't work either... took me a while but once i figured out the update.zip i got it going. and still no joy.
thanks heaps guys for all your help, i think i must have to compile from source or something silly like that...
I'll keep at it and let you all kno how i go...

[Q] APKTool Question for Infuse

I am trying to modify gtg465x's version of TouchWiz30Launcher.apk. All I am doing is modifying launcher:iconColumnCount to 5 in both layout-land\launcher.xml and layout-port\launcher.xml.
It builds fine. I am using both framework-res and twframework-res in APKTool.
When I copy onto my phone it doesn't launch at all.
If I am in way over my head, don't be shy just tell me. Otherwise any guidance would be appreciated.
camoto said:
I am trying to modify gtg465x's version of TouchWiz30Launcher.apk. All I am doing is modifying launcher:iconColumnCount to 5 in both layout-land\launcher.xml and layout-port\launcher.xml.
It builds fine. I am using both framework-res and twframework-res in APKTool.
When I copy onto my phone it doesn't launch at all.
If I am in way over my head, don't be shy just tell me. Otherwise any guidance would be appreciated.
Click to expand...
Click to collapse
You compiling as system apk?
gtg465x said:
You compiling as system apk?
Click to expand...
Click to collapse
Is that an option? I don't completely understand your question.
camoto said:
Is that an option? I don't completely understand your question.
Click to expand...
Click to collapse
Oh sorry, thought you were using APK Manager. Anyways, use APK Manager. It's sort of a front end for APKTool and will be easier.
camoto said:
Is that an option? I don't completely understand your question.
Click to expand...
Click to collapse
you don't sign system apks...i think thats what he's trying to get at. Try using apk manager 4.9. it is a dos-based gui that makes apktool do your bidding...including warning you that system apks do not need to be signed.
EDIT: Lol. jinx
Can you make app drawer to continuously scroll instead of paging, but I think it is better scrolling continuously sideways instead of scroll up and down. Because sideways scroll. You see more app right? Or may be a bad idea? I hope they can make an app like the Go SMS PRO where you can switch the paging of app to wave, roll, cube etc.
Sent from my SAMSUNG-SGH-I997 using XDA Premium App
thanks for the tips!
OK compiled as system, did NOT sign and still it won't launch... /headscratch
camoto said:
thanks for the tips!
OK compiled as system, did NOT sign and still it won't launch... /headscratch
Click to expand...
Click to collapse
try this:
* open the original .apk with WinZip or whatever zip opener you like
* drop the changed files into the zip without unziping.
* push to the phone and try it.
i did try to edit the resources.. it won't work also (with apktool). I did try just d and then b. same problem. not showing on launcher
May need to remove data and odex, repush to system/app, and logcat the startup and information that it provides with attempted system installation. If you want more eyes, feel free to push me a PM with a link to your apk and when I receive my infuse later this week, I'll take a crack at it.

Ways to make a rom

By any chance could someone tell me the best way to make a rom, I have a droid 3 and really want to make a rom but I don't know where to start, thanks in advance
Sent from my DROID3 using XDA App
The best roms start with 3 eggs and little bit of milk to make them fluffy. Whisk briskly!
If you want to jump in, this is a good place to start http://source.android.com/source/index.html
If you just want to dip your toe in the water, then you could start with modding roms, such as adding/removing apks, theming, writing update scripts.
Find a rom and unzip it. Look inside, poke around. Don't be shy-take things apart. Peel back the layers until you find xml and png files. Then, put it all back together and see if you can get it to flash.
Thanks
Sent from my DROID3 using XDA App
thanks so much for the info!
If you download a rom and unzip it, there will be a META-INF folder- look in here- there will be some crypto certs and a com/google/android/ folder which will have the updater-script and update-binary. The script is how the phone knows what to do with the rom. Read through the script and try to decipher what it is actually doing. It will be different for some roms. For example, the cyanogen roms will back up some system apps and replace them after flashing.
You might also come across a boot.img in the root directory of the rom. If you do, there will be some instructions in the updater-script for what to do with it.
Next look in the system/app directory- you'll find a bunch of apk files. These are actually in zip format, so you could unzip them to see what is inside.
A basic test would be to add or remove an apk to the system apps and then get it to flash. Of course you'll need a rooted phone and maybe jarsigner or signapk. Signing a rom will put all those CERT.RSA files back into the META-INF/ folder, which contain crypto hashes of all the files and the names of the files. Some recoveries will allow you to flash an unsigned rom, but you might as well figure out how to sign them. It's in the android link I posted earlier.
Good luck!
Thank you for that also this is very helpful I was kinda confused on where to start with aosp, also that the droid 3 has a locked bootloader
Sent from my DROID3 using XDA App
By any chance would you know how to do some theming? If I understand right it has to do with decompiling the framework-res and systemui apks, and replacing some pngs and xmls with others right?
Sent from my DROID3 using XDA App
I just got started with this so I am by no means an expert. I think you'll want to start by deodexing a rom so that you can make changes to the res, xml, etc. I think most stock apps come as a two part package- an .apk file and an .odex file, both with the same names. Find a stock app and look in the framework and app folders. De-odex-ing takes the odex file, de-compiles it, and then recompiles it into a classes.dex file that is put back into the apk or jar file. This configuration will should allow you to make changes without having to compile the rom from scratch... at least that is my understanding.
Find an apk that doesn't have an odex file and look for the classes.dex file inside. Then take a peak in the res folder in the apk. In the res folder you'll find all sorts of xml and png files.
To get started with decompiling, you'll want baksmali http://code.google.com/p/smali/wiki/DeodexInstructions
Take a look at the issues. JesusFreke wrote some interesting comments in issue 61.
I think there are a few other packages that will do the same thing, and there are certainly a few scripts that will work too.
I ran into some issues with deodexing honeycomb- I outlined the process here http://forum.xda-developers.com/showthread.php?t=1324653.
This is also a good source http://wiki.sdx-developers.com/index.php/How_to_deodex_a_ROM
Good info, thanks.
thank you you have been extremely helpful, im gonna try to get my rom out by sometime this week thank you
I just did some mini-theming. I have an ASUS Transformer- the stock rom has it's own back/menu/home buttons. I wanted a more complete honeycomb look, so I grabbed the stock honeycomb versions from a xoom rom, and added them into my deodexed stock ASUS SystemUI.apk. Oddly enough, if I signed the apk, it wouldn't work, but if I left it unsigned, it works fine.
thats odd, i thought you needed to sign it for it to work

How to make a theme?

I'm pretty handy with Photoshop (I do graphic design) and I was wondering how I would go about making a theme. I am on Melvins stock ROM and I don't use a launcher. It was so simple on the iPhone, so is there a method similar to that of the iPhone?
Hey I'm in the same boat as you being design graduate myself. Its pretty easy actually you just need to get to know all the apk files and what goes where. The framework-res.apk, systemUI.apk house the majority of the files overall that you will most likely wanna mod. Then you have app specifics. Anyway here is a little vid to get you started very basic like. Its the dev M&S from the Tmob thread. His themes are super slick
http://www.youtube.com/watch?v=RSB8iQvpU9k
That is exactly what I needed. Thank you so much. It's actually fairly easy, and I'm glad I don't have to use winSCP anymore.
Quick question though, what do I download to get the script and all that? And the SDK part?
I downloaded the APK manager and I have no idea how to get the framework into the script. Any ideas?
well you should watch the video! if you don't wanna watch than.
Copy framwork-res.apk from system>framework folder.
Past it in the apk folder where it says "Put here for Modding" and than you can open up the command prompt and go from there!
Hope this helps!\
Make sure to do nandroid because messing with framwork will give you softbrick and you will be F*****!
MAGiK9 said:
I downloaded the APK manager and I have no idea how to get the framework into the script. Any ideas?
Click to expand...
Click to collapse
appdroid said:
well you should watch the video! if you don't wanna watch than.
Copy framwork-res.apk from system>framework folder.
Past it in the apk folder where it says "Put here for Modding" and than you can open up the command prompt and go from there!
Hope this helps!\
Make sure to do nandroid because messing with framwork will give you softbrick and you will be F*****!
Click to expand...
Click to collapse
lol I was like the vid shows it too! And also you will need to do a search on how to mod .9 png files. They have code in them so if you mod them in photoshop ( I did this at first) they end up all warped and busted. At first I recommend the "extract" for starters in APK manager. Gives you access to all the png files and such. Once you get more familiar then choose "decompile" so you can edit the xml files (change text color etc). Hope that helps
I will be closely following this thread as I am learning to theme as well, let's help each other!
Does anyone know how to do the videos first part in "apk multi tool"?
Actually nvm I figured it out
I did watch the video. There are some steps he skips, however. Like selecting the framework, he never tells you how to get it in the folder. I figured it out, eventually.. but I still don't know how to get it onto my phone using the SDK that he uses. That is my question.
Ive been at this for about an hour lol. I figured out how to push the file but I couldnt do it from /tools/ so I tried pushing the apk from /platform-tools/ and it worked the only problem is that I edited the battery colors just to test and see if it would work. They were supposed to be red but their still the same color.
Btw to the above post, go to cmd and type "cd c:/" and then wherever your sdk is located. Unless thats not what your talking about then idk =/
Update: It worked...but...bootloops so I had to push the original frameworkres and it booted up and when I re-pushed the one I edited it still gives me a bootloop
I've started building themes. Everything has worked fine so far. I themed my gmail apk blue. And have been working on framework-res.apk and SystemUI.apk and twframework-res.apk. Far from done but I've made changes to all three and pushed them to my phone no problem. Im using pirateghosts stock Rom space_pirate i believe is the Rom name
Sent from my SAMSUNG-SGH-I727 using xda premium
I'm using alien 5.5 and I'm still getting bootloops trying to push my modded framework-res apk.
The cake is a lie.

Can I override CM 11 theme with Xstana navigation bar mod

I like my custom Xstana module nav bar but my android L theme replaces it and I can't overwrite it.
Also I don't particularly like the keyboard of the android L theme and I can't seem to customise it back to normal?
You can replace the keys within the .apk manually through a computer.
For the keyboard, same thing. You can also download an alternative keyboard, if you're using the Google Keyboard, there are many that look like it, and so on.
Curiousn00b said:
You can replace the keys within the .apk manually through a computer.
For the keyboard, same thing. You can also download an alternative keyboard, if you're using the Google Keyboard, there are many that look like it, and so on.
Click to expand...
Click to collapse
Oh alright I'll give it a ****, how do I browse them on my computer? Android SDK?
lopuandroid said:
Oh alright I'll give it a ****, how do I browse them on my computer? Android SDK?
Click to expand...
Click to collapse
If you pull the theme.apk from your phone, you can explore the APK with Win-RAR/7-zip, and whatever else.
But since you plan on reinstalling, I recommend checking APKTool. You need to decompile, edit, then recompile the APK.
Curiousn00b said:
If you pull the theme.apk from your phone, you can explore the APK with Win-RAR/7-zip, and whatever else.
But since you plan on reinstalling, I recommend checking APKTool. You need to decompile, edit, then recompile the APK.
Click to expand...
Click to collapse
Thanks a bunch
Please do not post non development related threads in the development section
Questions belong in the Q&A section
Thread moved
Curiousn00b said:
If you pull the theme.apk from your phone, you can explore the APK with Win-RAR/7-zip, and whatever else.
But since you plan on reinstalling, I recommend checking APKTool. You need to decompile, edit, then recompile the APK.
Click to expand...
Click to collapse
You don't need to decompile / recompile to swap images. You can do this in winrar and 7zip, as long as you delete the old images first and add the new images with no compression (store)
You only need to decompile if you're adding new images (not swapping) and editing XML
Sent from my Nexus 5 using Tapatalk

Categories

Resources