[Q] Help with ApkTool and WhatsApp - Android Q&A, Help & Troubleshooting

Hi people!!
I followed some tutorials to try to customize my WhatsApp app, just wanted to change the icon to start.
I'm doing this, I put whatsapp.apk inside apktool directory and this to cmd:
Code:
apktool.bat d WhatsApp.apk app
this makes a folder app that inside have de decompiled code of whatsapp and works ok.
Then, i go to res, and open icon.png, make a color change, and then save changes.
So, when I'm trying to recompile with:
Code:
apktool.bat b c:\apktool\app whats.apk
fails and shows this:
Code:
I: Building resources...
c:\apktool\app\res\layout-large\abs__action_mode_close_item.xml:5: error: No res
ource identifier found for attribute 'textAllCaps' in package 'android'
.....
And more errors.
It's the first app I'm trying to decompile, i have the latest android sdk-apktool and java jdk.
Thanks You.

Related

[GUIDE] Complete For Beginners And Chefs

HOW TO: APKTOOL​
Firstly, the most basic thing you will need to learn how to use if Apktool, without it modding apks is more or less impossible. Read the following:
What is Decompiling?
Android apps are basically made up of Java codes and XML files. After compiling the app, these files cannot be viewed. Decompiling is a process which decompiles the binary form of XMLs and .Java files into readable form. The XML files can be retained as it is, but the .java files are converted into smali files, a totally different language.
What is Recompiling?
Recompiling is simply a way to convert the XML and smali files back into the binary form and building up of the APK with the changes made. All apps after recompiled have to be signed (except system apps).
Now, pick your operating system and let's get started.​
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Firstly, you will need to download Apktool from here and it's depidencies and helpr script from here finally install Java from here.
Install Java before continuing.
Next, create a folder in your main drive and label it 'apktool' for easy access and extract the files in the above packages there.
Now your mainly set up, congrats. Now you can add the apks you may want to modify in the folder. But note, when modifying system apps from a rom you will need to install its framework-res.apk first, or decompile / compiling will give errors.
If you want to modify, open up the apktool folder you create, in it, hold shift and right click, then choose 'open command window'. In the cmd window these are the commands you will want to use.
Installing framework-res.apk.
Code:
apktool if framework-res.apk
Decompiling apk. (Replace name_of_app, with the name of the apk you are trying to decompile).
Code:
apktool d name_of_app.apk
Compiling apk. (Replace name_of_folder with the the name of the folder in which your apk was decompiled, don't add .apk extension here)
Code:
apktool b name_of_folder
Install Java, by running the following commands in Termianl, one by one.
Code:
sudo add-apt-repository ppa:ferramroberto/java
sudo apt-get update
sudo apt-get install sun-java6-jre sun-java6-plugin
sudo apt-get install sun-java6-jdk
Next download Apktool from here and Linux specific dependencies from here.
Extract them to the desktop and open up Terminal and cd to the Destkop
Code:
cd ~/Desktop
Once there, run the following commands one by one to set permissions. (Replace emwno with your username and hit enter after every command)
Code:
chown -R emwno '/home/emwno/Desktop/apktool.jar'
chown -R emwno '/home/emwno/Desktop/
chown -R emwno '/home/emwno/Desktop/apktool
Next make all 3 files executable by doing the same thing one at a time pressing enter after each command. (Replace emwno with your username)
Code:
sudo chmod +x '/home/emwno/Desktop/apktool.jar'
sudo chmod +x '/home/emwno/Desktop/aapt'
sudo chmod +x '/home/emwno/Desktop/apktool'
Next we need to move these files to the bin folder. Run the following in the same terminal.
Code:
gksudo nautilus
A new window should pop up, from the left navigate to "filesystem/usr/local/bin drag all three files from your Desktop into the bin folder and then close it.
Congrats, now your set up to use Apktool, from the Terminal!
Now, if you want to modify an apk. Open up Terminal, cd to the apks directory and run the following accordingly. But note, you will need framework-res.apk when modifying system apps from a specific rom.
Installing framework-res.apk.
Code:
apktool if framework-res.apk
Decompiling apk. (Replace name_of_app, with the name of the apk you are trying to decompile).
Code:
apktool d name_of_app.apk
Compiling apk. (Replace name_of_folder with the the name of the folder in which your apk was decompiled, don't add .apk extension here)
Code:
apktool b name_of_folder
Before continuing, install java from here.
Next download Apktool from here and MacOS specific dependencies from here.
Unpack both to /usr/local/bin directory (you must have root permissions to do so).
Congrats, now your set up to use Apktool, from the Terminal!
Now, if you want to modify an apk. Open up Terminal, cd to the apks directory and run the following accordingly. But note, you will need framework-res.apk when modifying system apps from a specific rom.
Installing framework-res.apk.
Code:
apktool if framework-res.apk
Decompiling apk. (Replace name_of_app, with the name of the apk you are trying to decompile).
Code:
apktool d name_of_app.apk
Compiling apk. (Replace name_of_folder with the the name of the folder in which your apk was decompiled, don't add .apk extension here)
Code:
apktool b name_of_folder
Configuring sdk and adb
HOW TO: SDK / ADB ​
The Android SDK, provides the necessary tools for building apks, as well as providing API's. And the ADB! Is a mean of connect to the device via root stoarge, thus modifying system files, this is a must for devs, who would like to test out their new frameworks etc.
Now, pick your operating system and let's get started.​
Before we continue, you will require ADB drivers for your device, use this to download them.
Then extract it's components to your main drive, for example C:\android-sdk
After extracting, open the folder, then navigate to platform-tools. There open the command prompt, by holding shift key, then right clicking, then hit 'Open command window here'.
Type 'adb' in command prompt. If adb executes means u have successfully setup adb.
If not already, open up the Android SDK, CHECK Android SDK Tools and Android SDK Platform-Tools and download them.
Download the Android SDKTools for Linux, keeping in mind which bit you have, for example 32bit or a 64bit system.
Next extract the folder in your home directory (/home/username).
Now to be able to run the SDK you need to make it executable. First of all go to home/username/android-sdk-linux/tools/ (Where's it's your username and android-sdk-Linux is the extracted folder. Right click on a file called 'android' then hit properties! Then in the new window, goto the permissions tab. CHECK 'Allow executing file as program'. Once done, close it and double click the android file. And select 'Run in Terminal'.
Once done, check Android SDK Tools and Android SDK Platform-Tools and download them.
Now that you have the SDK, let's configure ADB for ease of access. Open up Terminal and type the following:
Code:
sudo gedit ~/.bashrc
Next in the newly opened window, paste this to the very bottom of the file, save and close.
Code:
# Android tools
export PATH=~/android-sdk-linux/platform-tools:~/android-sdk-linux/tools:$PATH
Now just simply reload your bashrc, by entering this in Terminal.
Code:
source ~/.bashrc
Download the Android SDKTools for Mac.
Next extract the folder in your home directory (/home/username).
Now to be able to run the SDK you need to make it executable. First of all go to home/username/android-sdk-linux/tools/ (Where's it's your username and android-sdk-Linux is the extracted folder. Right click on a file called 'android' then hit properties! Then in the new window, goto the permissions tab. CHECK 'Allow executing file as program'. Once done, close it and double click the android file. And select 'Run in Terminal'.
Once done, check Android SDK Tools and Android SDK Platform-Tools and download them.
Now that you have the SDK, let's configure ADB for ease of access. Open up Terminal and type the following:
Code:
nano ~/.bash_profile
The above command will open a file in a text editor, now add the following line in the end of that file.
Code:
export PATH=${PATH}:~/android-sdk-linux/platform-tools:~/android-sdk-linux/tools
Save the file and close it. Now run this in the Terminal window:
Code:
source ~/.bash_profile
Congrats, you have successfully set up SDK and ADB on your Mac!.
Enable 'USB Debugging' on your phone. Now to check if your phone is connected, run the following command in Terminal or CMD.
Code:
adb devices
Then you should see something like: (Where abc is your devices number)
Code:
list of attached devices
abc device
Next, to pull things from your device, you need to run the following command
Code:
adb pull (Directory of the file you want on phone)
-----For Example-----
adb pull /system/app/systemui.apk
To push things to your phone, you will need to run the following command:
Code:
adb push (Directory of file on your PC) ( Directory to where you want to push the file on phone)
-----For Example-----
adb push C:\users\emwno\flymeos.zip /sdcard/roms
You can also install APK's form your PC directly to phone by using these commands:
Code:
adb install (Directory of the apk on your PC)
-----For Example-----
adb install C:\users\emwno\apk\mms.apk
BASIC MODDING​
Firstly, you will need Apktool setup, if you haven't set it up, refer to Post # 1.
Choose you manufacturer for the next step:
-SONY
Sony device will have to instal, both framework-res.apk and SemcGenericUxpRes.apk before compiling or decompiling apks to avoid errors.
-SAMSUNG
Samsung device users will have to install both framework-res.apk and twframework.apk to avoid errors while compiling or decompiling.
-HTC
Htc device users will also have to install both framework-res.apk and framework-htc-res.apk to avoid errors (NOTE: Name of HTC framework may vary)
To edit or modify XMLs in a decompiled apk,
-Windows Users should use this.
-Mac and Linux users won't need any special editor.
—————————————————————————————————————————
Now pick your poison and get started!​
> Changing Carrier Label
First you need to decompile your SystemUI.apk.
Open up res/layout/status_bar_tracking.xml and find this:
Code:
<com.android.systemui.statusbar.phone.CarrierLabel android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:textColor="#ff33b5e5" android:gravity="center" android:layout_gravity="bottom" android:paddingBottom="20.0dip" android:layout_width="fill_parent" android:layout_height="wrap_content" />
And replace it with this:
Code:
<textView android:text="@string/carrier_label" android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:textColor="#ff33b5e5" android:gravity="center" android:layout_gravity="bottom" android:paddingBottom="20.0dip" android:layout_width="fill_parent" android:layout_height="wrap_content" />
Save and close.
Now open up res/values/strings.xml and add this line in the end above </resources>.
Code:
<string name="carrier_label">ENTER_DESIRED_LABEL_HERE</string>
Now replace 'ENTER_DESIRED_LABEL_HERE', with the carrier label you want to keep. Then save it, and close the editor.
Now rebuild systemui with Apktool. No your not done yet.
Open up the newly built systemui.apk and the previous one with either WinRAR or 7zip and copy over the META-INF folder form the previous one to the newly built one. Then read Post # 2 and push the apk to /system/app.
> Semi-Transparent Notification drawer
Firstly decompile systemui.apk
Then navigate to smali\com\android\system ui\statusbar\phone then find and open PhoneStatusBar$FastColorDrawable.smali.
Find this line:
Code:
iget v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$FastColorDrawable;->mColor:I
And replace it with:
Code:
const v0, 0x7a000000
Recompile systemui. But your not done yet. Open up the newly built systemui.apk and the previous one with either WinRAR or 7zip and copy over the META-INF folder form the previous one to the newly built one. Then read Post # 2 and push the apk to /system/app.
Extra res for future guide requests
Last one.
Great guide!
EDIT2: U can extract more ideas like clock centering from here those are useful, hope it helps
EDIT3: Same error for me again edditing carrier name....
1. from platform-tools I extracted systemUI.apk, framework-res.apk and SemcGenericUxpRes.apk
Code:
adb pull systemUI.apk
adb pull framework-res.apk
adb pull SemcGenericUxpRes.apk
2. I moved them to C:/apktool
I installed sources
Code:
apktool if framework-res.apk
apktool if SemcGenericUxpRes.apk
3. I decompiled
Code:
apktool d SystemUI.apk SystemUI
4. I eddited (as is teached in the guide step by step)
5. I recompilled
Code:
apktool b SystemUI
AND....
Code:
C:\apktool>apktool if framework-res.apk
I: Framework installed to: C:\Users\Luis\apktool\framework\1.apk
C:\apktool>apktool if SemcGenericUxpRes.apk
I: Framework installed to: C:\Users\Luis\apktool\framework\2.apk
C:\apktool>apktool d SystemUI.apk
I: Baksmaling...
testI: Loading resource table...
I: Loaded.
I: Decoding AndroidManifest.xml with resources...
I: Loading resource table from file: C:\Users\Luis\apktool\framework\1.apk
I: Loaded.
I: Decoding file-resources...
I: Decoding values */* XMLs...
I: Done.
I: Copying assets and libs...
C:\apktool>apktool b SystemUI
I: Checking whether sources has changed...
I: Smaling...
I: Checking whether resources has changed...
I: Building resources...
invalid resource directory name: C:\apktool\SystemUI\res/drawable-sw600dp-hdpi
invalid resource directory name: C:\apktool\SystemUI\res/layout-sw600dp
invalid resource directory name: C:\apktool\SystemUI\res/values-sw600dp
invalid resource directory name: C:\apktool\SystemUI\res/values-sw600dp-port
invalid resource directory name: C:\apktool\SystemUI\res/values-sw720dp
invalid resource directory name: C:\apktool\SystemUI\res/values-sw720dp-port
Exception in thread "main" brut.androlib.AndrolibException: brut.common.BrutExce
ption: could not exec command: [aapt, p, --min-sdk-version, 15, --target-sdk-ver
sion, 15, -F, C:\Users\Luis\AppData\Local\Temp\APKTOOL4843747841851029423.tmp, -
I, C:\Users\Luis\apktool\framework\1.apk, -S, C:\apktool\SystemUI\res, -M, C:\ap
ktool\SystemUI\AndroidManifest.xml]
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.jav
a:255)
at brut.androlib.Androlib.buildResourcesFull(Androlib.java:324)
at brut.androlib.Androlib.buildResources(Androlib.java:269)
at brut.androlib.Androlib.build(Androlib.java:192)
at brut.androlib.Androlib.build(Androlib.java:174)
at brut.apktool.Main.cmdBuild(Main.java:188)
at brut.apktool.Main.main(Main.java:70)
Caused by: brut.common.BrutException: could not exec command: [aapt, p, --min-sd
k-version, 15, --target-sdk-version, 15, -F, C:\Users\Luis\AppData\Local\Temp\AP
KTOOL4843747841851029423.tmp, -I, C:\Users\Luis\apktool\framework\1.apk, -S, C:\
apktool\SystemUI\res, -M, C:\apktool\SystemUI\AndroidManifest.xml]
at brut.util.OS.exec(OS.java:83)
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.jav
a:253)
... 6 more
C:\apktool>
Any idea?
Hmm. What an auspicious wall of writing xD
Sent from Xperia Arc S
best guyde to install Android sdk for linux
-Android SDK:
Download the SDK here: http://developer.android.com/sdk/index.html
Extract the SDK and place it in your home directory.
I renamed my SDK to android-sdk to make it easier to navigate to.
Go to your home folder, press Ctrl+H to show hidden files, and open up your .bashrc file.
Add these lines at the bottom of the file:
Code:
# Android tools
export PATH=${PATH}:~/android-sdk/tools
export PATH=${PATH}:~/android-sdk/platform-tools
export PATH=${PATH}:~/bin
Find your .profile file and add this at the bottom of the file:
Code:
PATH="$HOME/android-sdk/tools:$HOME/android-sdk/platform-tools:$PATH"
You have now successfully installed the Android SDK.
To check for updates issue this into your terminal:
Code:
$ android
luiseteyo said:
Any idea?
Click to expand...
Click to collapse
i got that once. fix it by updating the tools: apktool.jar, aapt
n1kolaa said:
best guyde to install Android sdk for linux
Click to expand...
Click to collapse
i guess so.
emwno said:
i got that once. fix it by updating the tools: apktool.jar, aapt
Click to expand...
Click to collapse
But the ones provided by u are the last ones. Where can I update them? here?
luiseteyo said:
But the ones provided by u are the last ones. Where can I update them? here?
Click to expand...
Click to collapse
sorry, i meant to say that try an older version.
emwno said:
sorry, i meant to say that try an older version.
Click to expand...
Click to collapse
What version do u use for ICS apks.?? There is people that uses 1.4.2 for decompile and 1.4.3 to recompile...
luiseteyo said:
What version do u use for ICS apks.?? There is people that uses 1.4.2 for decompile and 1.4.3 to recompile...
Click to expand...
Click to collapse
i uae 1.4.2 for everything, on ics.
Still don't working... I don't understand anything... if u or jader could guide me.. would be very grateful
luiseteyo said:
Still don't working... I don't understand anything... if u or jader could guide me.. would be very grateful
Click to expand...
Click to collapse
try this aapt. http://www.mediafire.com/?0q52u6v8vdkpq1i
Still nothing... using 1.4.2 to decompile and recompile or either using 1.4.3 to recompile... I am going to suicide
I'm using apktool v1.5.0 and Fast AAPT. Works like a charm!
Here are the links:
[UTIL][Sept 2 2012] Apktool v1.5.0 - a tool for reverse engineering apk files
[DevTOOL][2012-10-01] Fast AAPT (#2) - Speed up Eclipse/apktool/etc
But did u try to decompile or recompile settings or systemui? dont u have my error?
Still nothing with that configuration... It has something to do to my java environment. I am sure... Thank u!
luiseteyo said:
Still don't working...
Click to expand...
Click to collapse
http://forum.xda-developers.com/showthread.php?p=19944251#post19944251
thank you for guide. I want to add something.
-Use latest aapt (apktool.jar etc.).
-I suggest you, right click to apk via 7zip, drag&drop classes.dex to pc and delete inside it. Decompile-do your moddings-compile. drag&drop files which u changed from unsigned to signed and put classes.dex back to original apk again.
-Check log for mistakes especially .9.png errors. They causes problems while compiling.
- If u mod .smali files, check google smali & baksmali jar files. and use that..
-For latest apks apktool/manager heapsize 64mb may not be enough for larger apks. Change it to least 512MB..
-Some apk files compiling problems can be solved like editing styles.xml..
Check xda topic..
happy moddings..

Problems decompiling/compiling settings.apk in KitKat mediatek mt6592

Hi all!
I was trying to make some changes in Settings.apk from my Elephone P8, a mt6592 device with kitkat (4.4.2), when I had a problem: it's impossible to decompile/recompile this apk!!
Here, you can see a log of simple decompile-compile action, with no changes in any file
Code:
[[email protected] ~]$ cd apktool/
[[email protected] apktool]$ ./apktool if framework-res.apk
I: Framework installed to: /home/javi/apktool/framework/1.apk
[[email protected] apktool]$ ./apktool if SystemUI.apk
I: Framework installed to: /home/javi/apktool/framework/127.apk
[[email protected] apktool]$ ./apktool d Settings.apk
I: Using Apktool 2.0.0-RC2 on Settings.apk
I: Loading resource table...
W: Skipping "android" package group
I: Loading resource table...
W: Skipping "android" package group
I: Decoding AndroidManifest.xml with resources...
I: Loading resource table from file: /home/javi/apktool/framework/1.apk
I: Regular manifest package...
I: Decoding file-resources...
I: Decoding values */* XMLs...
I: Baksmaling classes.dex...
I: Copying assets and libs...
I: Copying unknown files...
I: Copying original files...
[[email protected] apktool]$ ./apktool b Settings.apk
I: Using Apktool 2.0.0-RC2 on Settings.apk
Exception in thread "main" brut.androlib.AndrolibException: brut.directory.PathNotExist: apktool.yml
at brut.androlib.Androlib.readMetaFile(Androlib.java:247)
at brut.androlib.Androlib.build(Androlib.java:266)
at brut.androlib.Androlib.build(Androlib.java:258)
at brut.apktool.Main.cmdBuild(Main.java:240)
at brut.apktool.Main.main(Main.java:89)
Caused by: brut.directory.PathNotExist: apktool.yml
at brut.directory.AbstractDirectory.getFileInput(AbstractDirectory.java:103)
at brut.androlib.Androlib.readMetaFile(Androlib.java:243)
... 4 more
[[email protected] apktool]$
What i've tried:
- Installing dependencies from: mediatek-res.apk, Systemui.apk, Settings.apk, ext.jar, etc... nothing worked ;/
- Using another tools as apk multitool, advanced apk tool, etc... not working also
- Copying original resources.asrc and classes.dex from original Settings.apk to Settings folder after decompiled. This compile Settings apk, but no encoded, so it's unuseful
- Ussing differente enviroments: BBQ linux, Ubuntu, Windows 8.1... Not working in any of them
I'v tried to do the same with another mt6952 device, the BQ Aquaris E5 FHD with similar results... so it's a mediatek kitkat common problem.
Can you help me, guys????? Any idea what can I try next??
johnnybra said:
Hi all!
I was trying to make some changes in Settings.apk from my Elephone P8, a mt6592 device with kitkat (4.4.2), when I had a problem: it's impossible to decompile/recompile this apk!!
Here, you can see a log of simple decompile-compile action, with no changes in any file
Code:
[[email protected] ~]$ cd apktool/
[[email protected] apktool]$ ./apktool if framework-res.apk
I: Framework installed to: /home/javi/apktool/framework/1.apk
[[email protected] apktool]$ ./apktool if SystemUI.apk
I: Framework installed to: /home/javi/apktool/framework/127.apk
[[email protected] apktool]$ ./apktool d Settings.apk
I: Using Apktool 2.0.0-RC2 on Settings.apk
I: Loading resource table...
W: Skipping "android" package group
I: Loading resource table...
W: Skipping "android" package group
I: Decoding AndroidManifest.xml with resources...
I: Loading resource table from file: /home/javi/apktool/framework/1.apk
I: Regular manifest package...
I: Decoding file-resources...
I: Decoding values */* XMLs...
I: Baksmaling classes.dex...
I: Copying assets and libs...
I: Copying unknown files...
I: Copying original files...
[[email protected] apktool]$ ./apktool b Settings.apk
I: Using Apktool 2.0.0-RC2 on Settings.apk
Exception in thread "main" brut.androlib.AndrolibException: brut.directory.PathNotExist: apktool.yml
at brut.androlib.Androlib.readMetaFile(Androlib.java:247)
at brut.androlib.Androlib.build(Androlib.java:266)
at brut.androlib.Androlib.build(Androlib.java:258)
at brut.apktool.Main.cmdBuild(Main.java:240)
at brut.apktool.Main.main(Main.java:89)
Caused by: brut.directory.PathNotExist: apktool.yml
at brut.directory.AbstractDirectory.getFileInput(AbstractDirectory.java:103)
at brut.androlib.Androlib.readMetaFile(Androlib.java:243)
... 4 more
[[email protected] apktool]$
What i've tried:
- Installing dependencies from: mediatek-res.apk, Systemui.apk, Settings.apk, ext.jar, etc... nothing worked ;/
- Using another tools as apk multitool, advanced apk tool, etc... not working also
- Copying original resources.asrc and classes.dex from original Settings.apk to Settings folder after decompiled. This compile Settings apk, but no encoded, so it's unuseful
- Ussing differente enviroments: BBQ linux, Ubuntu, Windows 8.1... Not working in any of them
I'v tried to do the same with another mt6952 device, the BQ Aquaris E5 FHD with similar results... so it's a mediatek kitkat common problem.
Can you help me, guys????? Any idea what can I try next??
Click to expand...
Click to collapse
Well see that's the issue. As they seldom use official software. You will have to make sure to only use the framework from you device. Make sure to install them all. Also make sure the rom is deodex or you won't be able to decompile anything.
Thank you.
All files are from the same device (elephone p8), extracted and deodexed by me and working well in a ROM.
UPDATE: I succesfullly recompiled settings.apk!!! I installed mediatek-res.apk, but apktool.yml did not use it, so I edited the file including it and ... voilá!
Thank you, friend, without your words it couldn't be possible
johnnybra said:
Thank you.
All files are from the same device (elephone p8), extracted and deodexed by me and working well in a ROM.
UPDATE: I succesfullly recompiled settings.apk!!! I installed mediatek-res.apk, but apktool.yml did not use it, so I edited the file including it and ... voilá!
Thank you, friend, without your words it couldn't be possible
Click to expand...
Click to collapse
Explain exactly how you did it?
marsapa said:
Explain exactly how you did it?
Click to expand...
Click to collapse
Hi, friend. Glad to see you here Your Roms are awesome.
You must decompile settings.apk installing framework-res.apk and mediatek-res.apk first.
Then, before recompiling, you must open apktool.yml and you'll see a line that point to used dependences. Something like "- 1". Simply add after this one a new line with "- 2" if you installed dependences using default mode. Then save the changes and compile in normal way.
johnnybra said:
Hi, friend. Glad to see you here Your Roms are awesome.
You must decompile settings.apk installing framework-res.apk and mediatek-res.apk first.
Then, before recompiling, you must open apktool.yml and you'll see a line that point to used dependences. Something like "- 1". Simply add after this one a new line with "- 2" if you installed dependences using default mode. Then save the changes and compile in normal way.
Click to expand...
Click to collapse
I'm sorry I did not understand, unfortunately I'm arguing with the framework-res.apk of 6595, I published the change that you made so I try the new soc?
marsapa said:
I'm sorry I did not understand, unfortunately I'm arguing with the framework-res.apk of 6595, I published the change that you made so I try the new soc?
Click to expand...
Click to collapse
I'm sorry, I'm with Tapatalk. This afternoon I'll post some screenshots of what I'm saying, OK?
marsapa said:
I'm sorry I did not understand, unfortunately I'm arguing with the framework-res.apk of 6595, I published the change that you made so I try the new soc?
Click to expand...
Click to collapse
ok i have solve, thaks
marsapa said:
ok i have solve, thaks
Click to expand...
Click to collapse
With the soc mediatek 6595 I have a problem installing, decompile and compile the framework-res.apk with apktool v2.0.0RC3 I can not even decompile the framework and have this error: Log For : framework-res.apk
Log Type : Decompiling
Log Recorded At : 09 2014-12- 10:03:34,86
Log Recorded By : Advanced ApkTool v4.1.0 By BDFreak
------------------------------------------------------
Exception in thread "main" brut.androlib.AndrolibException: Multiple resources: spec=0x010e0045 integer/config_mobile_mtu, config=-mcc460
at brut.androlib.res.data.ResConfig.addResource(ResConfig.java:63)
at brut.androlib.res.data.ResConfig.addResource(ResConfig.java:56)
at brut.androlib.res.decoder.ARSCDecoder.readEntry(ARSCDecoder.java:186)
at brut.androlib.res.decoder.ARSCDecoder.readConfig(ARSCDecoder.java:157)
at brut.androlib.res.decoder.ARSCDecoder.readType(ARSCDecoder.java:125)
at brut.androlib.res.decoder.ARSCDecoder.readPackage(ARSCDecoder.java:100)
at brut.androlib.res.decoder.ARSCDecoder.readTable(ARSCDecoder.java:78)
at brut.androlib.res.decoder.ARSCDecoder.decode(ARSCDecoder.java:47)
at brut.androlib.res.AndrolibResources.getResPackagesFromApk(AndrolibResources.java:606)
at brut.androlib.res.AndrolibResources.loadMainPkg(AndrolibResources.java:75)
at brut.androlib.res.AndrolibResources.getResTable(AndrolibResources.java:67)
at brut.androlib.Androlib.getResTable(Androlib.java:61)
at brut.androlib.ApkDecoder.setTargetSdkVersion(ApkDecoder.java:206)
at brut.androlib.ApkDecoder.decode(ApkDecoder.java:92)
at brut.apktool.Main.cmdDecode(Main.java:165)
at brut.apktool.Main.main(Main.java:81)
while with earlier versions it, but still not what recompile is the log: .
For the rest mediatek.res.apk installing and making the change to apktool.ylm decompilo and recompile all files including settings.apk
Tips?
marsapa said:
With the soc mediatek 6595 I have a problem installing, decompile and compile the framework-res.apk with apktool v2.0.0RC3 I can not even decompile the framework and have this error: Log For : framework-res.apk
Log Type : Decompiling
Log Recorded At : 09 2014-12- 10:03:34,86
Log Recorded By : Advanced ApkTool v4.1.0 By BDFreak
------------------------------------------------------
Exception in thread "main" brut.androlib.AndrolibException: Multiple resources: spec=0x010e0045 integer/config_mobile_mtu, config=-mcc460
at brut.androlib.res.data.ResConfig.addResource(ResConfig.java:63)
at brut.androlib.res.data.ResConfig.addResource(ResConfig.java:56)
at brut.androlib.res.decoder.ARSCDecoder.readEntry(ARSCDecoder.java:186)
at brut.androlib.res.decoder.ARSCDecoder.readConfig(ARSCDecoder.java:157)
at brut.androlib.res.decoder.ARSCDecoder.readType(ARSCDecoder.java:125)
at brut.androlib.res.decoder.ARSCDecoder.readPackage(ARSCDecoder.java:100)
at brut.androlib.res.decoder.ARSCDecoder.readTable(ARSCDecoder.java:78)
at brut.androlib.res.decoder.ARSCDecoder.decode(ARSCDecoder.java:47)
at brut.androlib.res.AndrolibResources.getResPackagesFromApk(AndrolibResources.java:606)
at brut.androlib.res.AndrolibResources.loadMainPkg(AndrolibResources.java:75)
at brut.androlib.res.AndrolibResources.getResTable(AndrolibResources.java:67)
at brut.androlib.Androlib.getResTable(Androlib.java:61)
at brut.androlib.ApkDecoder.setTargetSdkVersion(ApkDecoder.java:206)
at brut.androlib.ApkDecoder.decode(ApkDecoder.java:92)
at brut.apktool.Main.cmdDecode(Main.java:165)
at brut.apktool.Main.main(Main.java:81)
while with earlier versions it, but still not what recompile is the log: .
For the rest mediatek.res.apk installing and making the change to apktool.ylm decompilo and recompile all files including settings.apk
Tips?
Click to expand...
Click to collapse
Are you trying to decompiling for meizu mx4??? I'll tried it too, but I couldn't find the way to install framework as dependence. Same error as yours.
That's because they use files that differ from stock Android that apk tool is not set to use and the apktool dev already stated he will not add support for it.

Need Help Modifying and Recompiling Settings.APK

Hello there, as of late, I've been trying to exploit the Settings.APK on the HTC One M9 (specifically the verizon version, although the APKs are the same there is just a value on the device itself that is different which triggers the "block" on the APK), as you can see here:
http://forum.xda-developers.com/ver...verizon-enable-oem-lock-t3281994#post64568917
I've discovered that it is possible to patch/overwrite the existing Settings.APK with adb install -r -d (overwrite and downgrade), even a modified one I've worked on with APKTools (without root). However, I've run into several issues, mainly modifying the java code and getting it to recompile (with the APK Multi-Tool I'm using to compile "system APK files) WITH the apk.
What I mean to say is that when I place the java code in /src it will compile but I don't see the changes taking effect.
EDIT: Now when I try to compile I get an error.
Code:
Building Apk
I: Using Apktool 2.0.1-825476-SNAPSHOT
I: Checking whether sources has changed...
I: Building java sources...
"An Error Occurred, Please Check The Log (option 26)"
Press any key to continue . . .
java version "1.8.0_66"
Java(TM) SE Runtime Environment (build 1.8.0_66-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.66-b17, mixed mode)
A subdirectory or file modified-system-apk-files-here already exists.
Exception in thread "main" java.lang.UnsupportedOperationException: Not yet implemented
at brut.androlib.java.AndrolibJava.build(AndrolibJava.java:32)
at brut.androlib.Androlib.buildSourcesJava(Androlib.java:390)
at brut.androlib.Androlib.buildSources(Androlib.java:299)
at brut.androlib.Androlib.build(Androlib.java:282)
at brut.androlib.Androlib.build(Androlib.java:256)
at brut.apktool.Main.cmdBuild(Main.java:225)
at brut.apktool.Main.main(Main.java:84)
EDIT EDIT: Apparently I need the smali code instead. I'm going to try to convert java to smali and hopes this works. Fingers crossed!
APKTools is having an issue decompiling the resources in the first place,
Code:
C:\Program Files (x86)\Minimal ADB and Fastboot\modified settings>java -jar apktool.jar d Settings.apk
I: Using Apktool 2.0.2 on Settings.apk
I: Loading resource table...
Exception in thread "main" brut.androlib.AndrolibException: Multiple resources: spec=0x7f100000 bool/config_allow_edit_carrier_enabled, config=[DEFAULT]
at brut.androlib.res.data.ResConfig.addResource(ResConfig.java:63)
at brut.androlib.res.data.ResConfig.addResource(ResConfig.java:56)
at brut.androlib.res.decoder.ARSCDecoder.readEntry(ARSCDecoder.java:223)
at brut.androlib.res.decoder.ARSCDecoder.readConfig(ARSCDecoder.java:191)
at brut.androlib.res.decoder.ARSCDecoder.readType(ARSCDecoder.java:159)
at brut.androlib.res.decoder.ARSCDecoder.readPackage(ARSCDecoder.java:116)
at brut.androlib.res.decoder.ARSCDecoder.readTable(ARSCDecoder.java:78)
at brut.androlib.res.decoder.ARSCDecoder.decode(ARSCDecoder.java:47)
at brut.androlib.res.AndrolibResources.getResPackagesFromApk(AndrolibResources.java:544)
at brut.androlib.res.AndrolibResources.loadMainPkg(AndrolibResources.java:63)
at brut.androlib.res.AndrolibResources.getResTable(AndrolibResources.java:55)
at brut.androlib.Androlib.getResTable(Androlib.java:65)
at brut.androlib.ApkDecoder.setTargetSdkVersion(ApkDecoder.java:197)
at brut.androlib.ApkDecoder.decode(ApkDecoder.java:96)
at brut.apktool.Main.cmdDecode(Main.java:165)
at brut.apktool.Main.main(Main.java:81)
which leaves me with a resources.arsc presumably containing many files I need. I've downloaded APKtoJava_RC2, and managed to decompile it into java code using that (and I'm not sure if the classes.dex matters), and modify the APK to where I can enable the OEM unlock feature, but I need to recompile it. I'm trying to recompile the thing, but I'm running into issues (I've tried putting the modified java in src and deleting the resources.arsc when compiling) when installing.
EDIT EDIT EDIT: I've just been trying to edit the SMALI code to let me access the OEM unlock, I guess it's going to be trial and error for me. :v
So, here's what I need to do, in all essentiality:
1. Decompile Settings.APK to the point where I can modify it.
2. Recompile Settings.APK with the same signature.
I'm not sure if this is possible (editing the java while keeping the same signature), but root is NOT an option.
If anyone is willing to give me some insight, I'd really appreciate it.
Ok, so I know how to modidy the .smali, everything would work fine, if not for this final step.
I'm getting [INSTALL_PARSE_FAILED_UNEXPECTED_EXCEPTION] when I extract the .smali files from the classes.dex, and then recompile the .smali files into my own classes.dex-- EVEN IF I DON'T MODIFY THE .SMALI files. There is either an issue with extraction or compilation (maybe both)-- and I've tried several programs, and several methods.
EDIT: http://leonjza.github.io/blog/2015/...re-into-android-reversing-and-smali-patching/
Shows me that it has something to do with the signature. I'll see what I can do.
EDIT EDIT: Further research shows http://www.herongyang.com/Android/Project-META-INF-Files-Digest-Signature-and-Certificate.html that I MIGHT have to somehow get the certificate to work with the modified file properly. God help me now. I assume I'm not the first person to run into the certificate roadblock. Must find a way.
For all the heavens I can't seem to find a way to edit the .dex file in a way that leaves the certificate intact-- I suppose this is why the system was developed in the first place. Back to square one again, I suppose. (Or to giving up and buying a XTC 2 Clip)

[Question] How to remove the Discover page on Snapchat ?

Hello,
I would like to remove Snapchat Discover and stories.
I found that it might be possible by reverse engineering Snapchat's code, so I installed apktool, dex2jar and jd-gui and I converted the apk to a jar file, but I ran into issues that I couldn't fix :
- can not merge I and Z (best solution I found, but I don't know how to modify the dex by hand or modify the dex2jar code)
- and when I tried to decompile the apk using apktool, the command prompt displayed this :
I: Using Apktool 2.5.0 on Snapchat.apk
I: Loading resource table...
Exception in thread "main" brut.androlib.AndrolibException: Invalid chunk type: expected=0x00000200, got=0x00000203
at brut.androlib.res.decoder.ARSCDecoder.checkChunkType(ARSCDecoder.java:544)
at brut.androlib.res.decoder.ARSCDecoder.readTablePackage(ARSCDecoder.java:88)
at brut.androlib.res.decoder.ARSCDecoder.readTableHeader(ARSCDecoder.java:82)
at brut.androlib.res.decoder.ARSCDecoder.decode(ARSCDecoder.java:48)
at brut.androlib.res.AndrolibResources.getResPackagesFromApk(AndrolibResources.java:790)
at brut.androlib.res.AndrolibResources.loadMainPkg(AndrolibResources.java:67)
at brut.androlib.res.AndrolibResources.getResTable(AndrolibResources.java:59)
at brut.androlib.Androlib.getResTable(Androlib.java:66)
at brut.androlib.ApkDecoder.setTargetSdkVersion(ApkDecoder.java:236)
at brut.androlib.ApkDecoder.decode(ApkDecoder.java:118)
at brut.apktool.Main.cmdDecode(Main.java:179)
at brut.apktool.Main.main(Main.java:82)
Click to expand...
Click to collapse
All in all... I have no idea what I'm doing and since I'd rather not waste time with trial and error, I would really appreciate it if someone could tell me if this is even possible and give me some advice.
Thanks in advance, cheers

apk editor studio windows problem

I also tried just opening the file and getting a return without changing anything, there is still an error, does anyone know what to do???
Notice the error, maybe you can help
I: Using Apktool 2.6.0
I: Copying C:\Users\Dell\Downloads\השני\APK Editor Studio v1.6.0\data\temp\apk\{d93e5e27-07ec-4265-9445-652ff8c32818} classes.dex file...
I: Building resources...
W: C:\Users\Dell\Downloads\השני\APK Editor Studio v1.6.0\data\temp\apk\{d93e5e27-07ec-4265-9445-652ff8c32818}\res: error: failed to open directory: The system cannot find the file specified. (2).
brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [C:\Users\Dell\AppData\Local\Temp\brut_util_Jar_157343248198856642849171772449824828501.tmp, compile, --dir, C:\Users\Dell\Downloads\����\APK Editor Studio v1.6.0\data\temp\apk\{d93e5e27-07ec-4265-9445-652ff8c32818}\res, --legacy, -o, C:\Users\Dell\Downloads\����\APK Editor Studio v1.6.0\data\temp\apk\{d93e5e27-07ec-4265-9445-652ff8c32818}\build\resources.zip]

Categories

Resources