Decompiling/Recompiling Launcher2.apk [HELP!] - Android Software Development

Hey everyone. I'd like to decompile/recompile the Launcher2.apk from Paul (MoDaCo)'s rip of the Gingerbread system. I'm trying to fix the annoying fade time on the 2D app drawer for the launcher. However, I'm running into problems.
Here's my process:
apktool d -f com.modaco.android.launchergb-1.apk
Move through the com.modaco.android.launchergb-1 folder to res/values/integers.xml
Change fade in and fade out time to "300" instead of "700".
apktool b -f com.modaco.android.launchergb-1
Copy build/apk/resources.arsc to the original com.modaco.android.launchergb-1.apk using WinRAR.
Attempts to install all fail. When I try "adb install" I get this error: Failure [INSTALL_PARSE_FAILED_NO_CERTIFICATES]

You try ApkManager by daneshm90?
Sent from my phone

tnpapadakos said:
You try ApkManager by daneshm90?
Click to expand...
Click to collapse
Doesn't seem to work either.

You need to sign the package first.
jarsigner -verbose modradio.apk mykey
Check the METAINF/ folder in the apk of the newly built one and delete the extra files from the original one. Then you need to resign the edited apk. I think there should just be MANIFEST.MF, delete the CERT.* files. And when you resign it it should make new ones, in this case above it would be MYKEY.RSA and MYKEY.SF. Not too familir with it, but try that out.
Keep in mind that you have to resign it after any modifications, so do it last and it should work.
This thread does a good job guiding you though compiling/decompiling an apk.
http://forum.xda-developers.com/showthread.php?t=725870

trimeijer said:
You need to sign the package first.
jarsigner -verbose modradio.apk mykey
Check the METAINF/ folder in the apk of the newly built one and delete the extra files from the original one. Then you need to resign the edited apk. I think there should just be MANIFEST.MF, delete the CERT.* files. And when you resign it it should make new ones, in this case above it would be MYKEY.RSA and MYKEY.SF. Not too familir with it, but try that out.
Keep in mind that you have to resign it after any modifications, so do it last and it should work.
This thread does a good job guiding you though compiling/decompiling an apk.
http://forum.xda-developers.com/showthread.php?t=725870
Click to expand...
Click to collapse
Thank you so much for the help. In the thread you mentioned, I'm stuck at this point:
now type the following commands in this order:
this command changes all occurances of htc/fm to htc/modradio in your xml and .java files.
find ./ -type f | xargs perl -pi -e 's/htc\/fm/htc\/modradio/g'
this command changes all occurances of htc.fm to htc.modradio
find ./ -type f | xargs perl -pi -e 's/htc.fm/htc.modradio/g'
Click to expand...
Click to collapse
If my filename is com.modaco.android.launchergb-1 and the application name is com.modaco.android.launchergb, what do I do to make these commands work.
Would it be:
find ./ -type f | xargs perl -pi -e 's/modaco\/launchergb/modaco\/launchermod/g'
??

Related

[tip] install, sign apk, ..etc on right click (windows)

I've been hesitating on posting this for a while now (as its quite simple) but It may save you a ton of time like it continues to save for me.
1) write a batch file to do what you want, %1 is the file name+path argument passed to it
2) associate .apk files with the batch file. right click on apk-> open with-> choose program ->select the batch file
Many possibilities:
sign, install, decompile etc
here is the code for install.bat which I keep at x:\android-sdk\tools (same folder as adb)
Code:
adb install -r %1
pause
For sign: (creates a new .apk with -signed appended at the same location)
Code:
cd "x:\path\to\signapk.jar\"
java -jar signapk.jar testkey.x509.pem testkey.pk8 %1 %1-signed.apk
pause
For decompile: (decodes to a new folder with the same name+"-decoded" as the .apk
Code:
cd x:\path\to\apktool.jar\
java -jar apktool.jar d %1 %1-decoded
pause
thats pretty neat, nice tip
I'm dumb. I didn't read the first part of what you typed, figured the rest didn't work, searched google to come up with my own routine, figured out yours is extremely easy once you actually read it haha.
Oh well, at least I learned a little more DOS.
APK install bat with a prompt:
Code:
@echo off
set /p userinp=Do you want to install %1 y/n:
if "%userinp%"=="y" goto ADBINSTALL
exit
:ADBINSTALL
adb install -r %1
pause
EDIT: Forgot to say thanks.
yeah simple dos batch files can automated lot of monotonous tasks, I use them a lot for work

Burtcom's keymap for Desire Z

Thought I'd share my hardware keymap for Desire Z, which may come in handy for programmers and shell users
WARNING: INSTALL AT YOUR OWN RISK. REQUIRES ROOT, RW-MOUNTED SYSTEM AND USE OF ADB
(If you don't know what that means, search the forums)
WARNING2: You will lose the British Pound and Euro keys, as well as the use of the "user-programmable" keys
WARNING3: The supplied keypad files are for the Desire Z -- the G2 names its keypad files differently, so you'll probably have to rename the attached files appropriately to get this to work. Search the forum...
(USER1 is the "programmable" key just to the right of the period key, and USER2 is just to the right of USER1 )
[email protected] types \
shift-? types |
FN-Z types < (got rid of British Pound)
FN-X types > (got rid of Euro)
USER1 types [
shift-USER1 types {
FN-USER1 types ^
USER2 types ]
shift-USER2 types }
FN-USER1 types ` (this is the backtick character)
Unzip the attached file, and you'll find two files. vision-keypad-wwe.kcm.bin and vision-keypad-wwe.kl. Put these somewhere where you can push them with ADB
adb push vision-keypad-wwe.kcm.bin /sdcard/vision-keypad-wwe.kcm.bin
adb push vision-keypad-wwe.kl /sdcard/vision-keypad-wwe.kl
Now open a shell
adb shell
su -
Make sure you get a root prompt # then lets make a backup of the current files JUST IN CASE
cp -f /system/usr/keychars/vision-keypad-wwe.kcm.bin /system/usr/keychars/vision-keypad-wwe.kcm.bin.orig
cp -f /system/usr/keylayout/vision-keypad-wwe.kl /system/usr/keylayout/vision-keypad-wwe.kl.orig
(now the .orig files can be put back in place in case you don't like the keymap)
cd /sdcard
cp -f vision-keypad-wwe.kcm.bin /system/usr/keychars/
cp -f vision-keypad-wwe.kl /system/usr/keylayout/
Now change the permissions on the copied files...
cd /system/usr/keychars/
chmod 644 vision-keypad-wwe.kcm.bin
cd /system/usr/keylayout/
chmod 644 vision-keypad-wwe.kl
This should take effect immediately -- if it doesn't try a reboot.
Any chance of a quick [how to] for those interested?
Thanx for the share though, sure it will be useful for many out there.
Some members were asking if it would be possible to add extra characters into the sym key?.... reckon you could work some magic?
ddotpatel said:
Any chance of a quick [how to] for those interested?
Click to expand...
Click to collapse
FOR ADB, check out this thread
ddotpatel said:
Some members were asking if it would be possible to add extra characters into the sym key?.... reckon you could work some magic?
Click to expand...
Click to collapse
No idea -- we'd have to find out what file stores these chars.
Sorry,.I meant a how to do the remapping yourself? Software needed?.stuff like that.
Sent from my HTC Vision using XDA App
ddotpatel said:
Sorry,.I meant a how to do the remapping yourself? Software needed?.stuff like that.
Click to expand...
Click to collapse
Oh that stuff I gleaned from this thread
Excellent,... Good job...
Thank you so much for doing this! Really!
Two problems I had.
1) I had to do adb remount before being able to copy over the new keyboard files.
2) Although no reboot is needed afterwards, if you have connectbot open beforehand and then try to do pipe keys etc. they don't seem to work. But a restart fixed this.
Yay!

[Tool\Script] Sign, Zipalign and adb push apk's

Sign, Zip align and ADB push Apk's
What's different about this script?
*It's simple, easy to understand
*It can be used with any JDK. All that is required is replacing the PATH
This was intended to be used on HTC Skins; however, it can be used for any APK.
About
I wrote this batch file because the tools currently on XDA seem very complex or are based on JDK 7. People like myself that prefer to use JDK 6 are at a loss. This batch file assumes you already know how to sign APK's, Zipalign and ADB push Apk's. I've included some of my other threads below if you need further instructions.
Other threads a noob might need
Noobs guide to signing an APK
Noobs guide to installing and running zipalign
****All that is required to make this run, is replacing the directory paths with YOUR OWN Directory paths.
Source Code below, below that is the Multi to the .bat file.
Code:
@ECHO OFF
C:
CD\
CLS
cd c:\Program Files\Java\jdk1.6.0_26\bin (This can be replaced with whatever JDK you're using. Simply, replace the path)
jarsigner -verbose -keystore skin.keystore -signedjar C:\Users\Reynolds\ANDROID\SKINS\Rezound\Pitch_Black\dist\New-Pitchblack.apk C:\Users\Reynolds\ANDROID\SKINS\Rezound\Pitch_Black\dist\Pitchblack.apk [B]REPLACE-THESE-CAPS-W-YOUR-ALIAS[/B]
DEL C:\Users\Reynolds\ANDROID\SKINS\Rezound\Pitch_Black\dist\New-Pitchblack.apk
C:
CD\
CLS
cd C:\Users\Reynolds\ANDROID\SKINS\Rezound\Pitch_Black\dist
zipalign -fv 4 New-Pitchblack.apk Pitchblack.apk
cd c:\android-sdk-windows\platform-tools
C:
CD\
CLS
cd c:\android-sdk-windows\platform-tools [B](Your directory might be different)[/B]
adb install -r C:\Users\Reynolds\ANDROID\SKINS\Rezound\Pitch_Black\dist\Pitchblack.apk [B]( This Path can be replaced with whatever your apk is located in order to push the apk to your device[/B]
Media Fire DL Link: http://www.mediafire.com/?c3f0thcv6cmdwws

Checking the new (6+) CWM backups blobs integrity (solution inside)

I wanted a way to validate the SHA256 of the files in the new CWM backups, yet couldn't find anything readily available to do this, ending up creating a simple bat file, combining a dir command to list the blobl files, sed with regex to parse the hashes and the normal sha256deep hash checker to do this.
Just in case someone else may need this, here it is:
Code:
@echo off
echo Listing blobs...
dir blobs /a-d /s /b | sed -nr "s/^.*([0-9A-Fa-f]{3})\\([0-9A-Fa-f]{61})$/\1\2 \1\/\2/p" > blobsck.txt
echo Checking blobs SHA256, listing bad blobs below...
sha256deep -j1 -r -x blobsck.txt blobs/*
Attached: The bat file (with comments) + win32 version of sed and sha256deep. Just unpack into the copied clockworkmod directory, next to the blobs dir, and run the bat.
@moderatorshttp://forum.xda-developers.com/member.php?u=1662773 - I know the S3 forum probably isn't the right place for this, but since i use it with my S3, only tested it on S3 backups and don't know any better place to put this in, i am posting here. Feel free to move wherever you find appropriate.

Amazfit 1.2.8 source code app/priv-app (decompiled)

Last night I decided to decompile all the apps of our beloved amazfit, I started to look at the source to find some interesting information. (Like how to turn off the standby mode or as add new watchfaces with even the standby mode)
I found interesting information but I have to do many tests and I don't have too much time at the moment, I leave the link to download all sources divided by folders (Gradle project)
Amazfit 1.2.8 decompiled apps
Enjoy!
Cracklydisc said:
Last night I decided to decompile all the apps of our beloved amazfit, I started to look at the source to find some interesting information. (Like how to turn off the standby mode or as add new watchfaces with even the standby mode)
Amazfit 1.2.8 decompiled apps
Enjoy!
Click to expand...
Click to collapse
Hi @Cracklydisc, which toolchain are you using to decompile amazfit system apps? baksmali 2.2.0 fails to deodex:
Code:
java -jar ../tools/smali/baksmali/build/libs/baksmali.jar deodex HuamiWatchFaces.odex -b framework/
Exception in thread "main" org.jf.dexlib2.DexFileFactory$UnsupportedOatVersionException: Unsupported oat version: 45
Tried also https://github.com/pxb1988/dex2jar, which gives smali files, but they fail to re-compile with apktool:
Code:
apktool b HuamiWatchFaces
I: Using Apktool 2.2.1
I: Checking whether sources has changed...
I: Smaling smali folder into classes.dex...
HuamiWatchFaces/smali/android/support/v4/media/MediaMetadataCompat.smali[73,45] Error for input '@': Invalid text
HuamiWatchFaces/smali/android/support/v4/media/MediaMetadataCompat.smali[73,39] mismatched input 'vtable' expecting VTABLE_INDEX
[...]
Many thanks in advance!
drbourbon said:
Hi @Cracklydisc, which toolchain are you using to decompile amazfit system apps? baksmali 2.2.0 fails to deodex:
Code:
java -jar ../tools/smali/baksmali/build/libs/baksmali.jar deodex HuamiWatchFaces.odex -b framework/
Exception in thread "main" org.jf.dexlib2.DexFileFactory$UnsupportedOatVersionException: Unsupported oat version: 45
Tried also https://github.com/pxb1988/dex2jar, which gives smali files, but they fail to re-compile with apktool:
Code:
apktool b HuamiWatchFaces
I: Using Apktool 2.2.1
I: Checking whether sources has changed...
I: Smaling smali folder into classes.dex...
HuamiWatchFaces/smali/android/support/v4/media/MediaMetadataCompat.smali[73,45] Error for input '@': Invalid text
HuamiWatchFaces/smali/android/support/v4/media/MediaMetadataCompat.smali[73,39] mismatched input 'vtable' expecting VTABLE_INDEX
[...]
Many thanks in advance!
Click to expand...
Click to collapse
Project ref:
- https://forum.xda-developers.com/and...batch-t2980857
- https://github.com/skylot/jadx
i use this 2 software for extract the source code.
How?
0. Extract from Amazfit the directory /app /priv-app /framework
adb pull /app
adb pull /priv-app
adb pull /framework
1. Create dir System and put the 3 dir inside.
2. Rename all mips dir in arm (one dir for any apk and one dir for framework )
3. Use JoelDroidLollipopBatchDeodexer.exe, select dir System and click start process (the software changes original file!)
4. Use Jadx for decompile apk in source code
example
jadx.bat -e app/Alipay/Alipay.apk -d decompiledApp/Alipay
If you have any questions please ask
Thank you for your suggestions @Cracklydisc !
I ended up doing things manually with oat2dex, apktool and smali/baksmali.
My idea is to replace one existing system watch face from HuamiWatchfaces.apk (and HuamiWatchfaces.odex) by replacing the relevant smali files with my custom compiled smali classes (with same java package name) in it. For example:
Code:
SunriseDigitalSlptClock.smali
SunriseDigitalWatchFace$1.smali
SunriseDigitalWatchFace$Engine$1.smali
SunriseDigitalWatchFace$Engine$2.smali
SunriseDigitalWatchFace$Engine$3.smali
SunriseDigitalWatchFace$Engine$4.smali
SunriseDigitalWatchFace$Engine$5.smali
SunriseDigitalWatchFace$Engine.smali
SunriseDigitalWatchFace.smali
I am struggling with basic permission and signing issues that I am sure have already been solved by you guys, so that I ask you for basic directions.
Here's the steps I made to decompile and recompile back everything in order to test the process. This results in "HuamiWatchFaces stopped" after reboot .
adb pull /system/framework
adb pull /system/app
java -jar oat2dex.jar -a 22 odex HuamiWatchFaces.odex
java -jar baksmali.jar d odex/HuamiWatchFaces.dex -o Faces
apktool d -c HuamiWatchFaces.apk
cp -r Faces HuamiWatchFaces/smali
(here relevant smali files will be replaced with custom ones in HuamiWatchFaces/smali)
apktool b -c HuamiWatchFaces/
adb push HuamiWatchFaces.apk /system/app/HuamiWatchFaces/HuamiWatchFaces.apk
delete /system/app/HuamiWatchFaces/mips/HuamiWatchFaces.odex from adb shell (apk is now deodexed)
rm /data/dalvik-cache/mips/[email protected]@HuamiWatch*
adb reboot
drbourbon said:
Thank you for your suggestions @Cracklydisc !
I ended up doing things manually with oat2dex, apktool and smali/baksmali.
My idea is to replace one existing system watch face from HuamiWatchfaces.apk (and HuamiWatchfaces.odex) by replacing the relevant smali files with my custom compiled smali classes (with same java package name) in it. For example:
Code:
SunriseDigitalSlptClock.smali
SunriseDigitalWatchFace$1.smali
SunriseDigitalWatchFace$Engine$1.smali
SunriseDigitalWatchFace$Engine$2.smali
SunriseDigitalWatchFace$Engine$3.smali
SunriseDigitalWatchFace$Engine$4.smali
SunriseDigitalWatchFace$Engine$5.smali
SunriseDigitalWatchFace$Engine.smali
SunriseDigitalWatchFace.smali
I am struggling with basic permission and signing issues that I am sure have already been solved by you guys, so that I ask you for basic directions.
Here's the steps I made to decompile and recompile back everything in order to test the process. This results in "HuamiWatchFaces stopped" after reboot .
adb pull /system/framework
adb pull /system/app
java -jar oat2dex.jar -a 22 odex HuamiWatchFaces.odex
java -jar baksmali.jar d odex/HuamiWatchFaces.dex -o Faces
apktool d -c HuamiWatchFaces.apk
cp -r Faces HuamiWatchFaces/smali
(here relevant smali files will be replaced with custom ones in HuamiWatchFaces/smali)
apktool b -c HuamiWatchFaces/
adb push HuamiWatchFaces.apk /system/app/HuamiWatchFaces/HuamiWatchFaces.apk
delete /system/app/HuamiWatchFaces/mips/HuamiWatchFaces.odex from adb shell (apk is now deodexed)
rm /data/dalvik-cache/mips/[email protected]@HuamiWatch*
adb reboot
Click to expand...
Click to collapse
Why do you want to replace a native Watchface?
They have implemented the wfz engine and with the current dev version you can create both analog and digital Watchface and change shape to widgets.
Cracklydisc said:
Why do you want to replace a native Watchface?
They have implemented the wfz engine and with the current dev version you can create both analog and digital Watchface and change shape to widgets.
Click to expand...
Click to collapse
Good question
Even thought configurable watch faces are nice and powerful, coming from the Pebble world I'd like to open up the option to former Pebble developers to deliver radically custom watch faces like https://apps.getpebble.com/en_US/application/533966299820be90ed0000c5?hardware=chalk, https://apps.getpebble.com/en_US/application/52de476d6094ff6bf0000046?hardware=chalk or https://apps.getpebble.com/en_US/ap...5e1c8000118?hardware=chalk&section=watchfaces
Thank you for the decompiled version!!
I have a question for you, on the version you decompiled, could you please guide me to the file path/method used for the GATT profile to access the raw data from the device?
Thank you again!
Best,

Categories

Resources