[HOW TO] Decompile + Recompile SecPhone Jellybean 4.1.1 + 4.1.2 - Galaxy S III General

This will show you how to Decompile and Recompile SecPhone.apk (Deodexed) for Jellybean 4.1.1 and 4.1.2
Tools Needed:
This zip file: http://www.mediafire.com/?0b2ad2ow254ou3a
Java jdk and environment variables set correctly (if you don't know how, Google it)
Notepad++
7Zip
Decompile:
1. Download attached files and unzip folder to Desktop.
2. Place SecPhone.apk in Tools folder you just downloaded.
3. Hold Shift and right click inside of folder then click "Open command window here". Make sure no files are selected or it will not show.
5. Type apktool d SecPhone.apk and hit enter. This will create a folder called SecPhone.
6. You’re done you have decompiled the apk.
Recompile:
1. Hold Shift and right click inside of folder then click "Open command window here".
2. Type apktool b SecPhone nSecPhone.apk and hit enter. This will error and look something like this:
{
"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"
}
3. Now look at the code. If you look you will see there are 3 errors like this: Desktop\Tools\SecPhone\res\values-es\strings.xml:195: error: (they might look slightly different with your apk).
4. The things you need to fix this are right here (values-es) refers to a folder in the apk Desktop\Tools\SecPhone\res\ and strings.xml refers to an xml file inside that folder. Also if you read the whole line you will see it is some sort of format error. So go to Desktop\Tools\SecPhone\res\values-es\strings.xml and open it with Notepad++.
5. Now refer back to the error log and you will see values-es\strings.xml:195 the 195 refers to the line in the file that is causing the error. Scroll to that line, it says something like "%1$d% del ciclotranscurrido. So what’s the error? Let’s find out. Copy the code between the "" in this case its throttle_time_frame_subtext.
6.Now go to Desktop\Tools\SecPhone\res\values\strings.xml and open that with Notepad++ and search for code you just copied throttle_time_frame_subtext and compare the two files. You can see the difference error code has this %1$d% and the correct code has %1$d٪ so correct the code and save the file. Now do this for all 3 errors.
7. Now with all errors fixed we can Recompile so type apktool b SecPhone nSecPhone.apk and press Enter. This time it will complete without errors.
8. Open original SecPhone.apk with 7zip and open new nSecPhone.apk with 7zip and copy META-INF and AndroidManifest.xml from originalapk to new apk. Rename new apk to SecPhone.apk and its ready to be flashed. Don't forget to Zipalign. DONE!
If this helps you please don't forget the thanks button

Reserved

Thanks for this mate.. I was wondering for a long time on this error
sent from here, there, somewhere!!

Thanks for your work!

Related

[HOW TO] Use and install APKtool

So, here i'm again porting a tutorial based on DSM_'s Tut
What do you need:
JRE (Java Runtime Environment)
Install:
Windows:
Download apktool
Download apktool-install-windows
Unpack both pakages you will get three files, copy those files to your Windows directory i.e. C:\WINDOWS
Decoding files:
Open Command. Run>cmd
Type-
Quote
apktool d file.apk [directory]
Example - apktool d D:\nfsshift.apk D:\nfsshift
Done!
{
"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"
}
FrameworkFiles
Apktool needs the framework files to decode and build apks.
Standard framework is embedded into apktool, so you don't need to do anything for most apk files. But some manufacturers, for example Samsung, add their own framework files and use them in system apps. To use apktool against such apps, you must pull framework from a device and install/register it to apktool.
For Example, you want to decode TouchWizLauncher.apk from Android v2.2 of Galaxy 5. If you try to do that, you will get an error message:
You need to install framework in apktool Type-
apktool if [framework location]
I have the got the framework-res.apk & twframework-res.apk by extracting the ROM. You can also copy it from your phone. But take care you must copy framework.apk from that ROM in which you got the Application file.
Then try again
Now is working.
How to build decoded files:
Just type
apktool b [directory in which you have decoded the files]
Example - apktool b D:\nfsshift
Done!
You will find the apk file inside the decoded directory, like I found it in - D:\nfsshift\dist\nfsshift.apk
Now you need to sign your APK file.
How to Sign APK files:
When publishing an application or a custom rom you need to sign the .apk or .zip files with a certificate using a private key. The Android system uses the certificate to identify the author of an application and establish trust relationship between applications. The classic way of doing this was to use keytool then sign it with jarsigner. In this tutorial i’ll explain an alternative method which is relatively easy to use for most people using a tool called SignApk.jar.
First download the SignAPK tool - http://www.mediafire.com/?rw57ftajd6nm81s
Extract them to a directory you will remember. I have put them in C:\SignApk
Now just open cmd and type -
Quote
cd C:\SignApk
java -jar signapk.jar certificate.pem key.pk8 your-app.apk your-app-signed.apk
Example - java -jar signapk.jar certificate.pem key.pk8 D:\nfsshift\dist\nfsshift.apk D:\nfsshift\dist\nfsshift-signed.apk
Your APK is signed and can be installed.
●๋•ηι¢є ιηƒσ●๋•
Sent from my GT-S7500 using xda app-developers app
I know this is an old post but I need some help. I have the apktool, dex2jar and jd-gui in a folder on my Desktop
I installed the framework-res.apk and it installs into a different folder. Do I need to have the Framework folder into the same folder as the other files or will it be able to locate the framework files no matter where they are.
The reason I ask is because even though I have installed the framework, I am still getting error message when attempting apktool d filename.apk. Any ideas would be helpful, thank you

[Guide] Noobs To Change The Clock & Notification Colour in StatusBar

While I was searching for how to change the clock & notification colour in statusbar
there i got so many guide with lot of way....
I tried them tooo...
But soory to say that very few of them works for mee...actualy
those guide support few devices not for all...
Then one of my friend(Abhishek Kumar Singh) gave me a guide which is a perfect one..
but there also few changes to be done......as the guide is totally messed..
so Here I am going to make a guide for all those who want to change there clock & notification colour.
Requirements:-
1)ColorChange.jarv3.1 [Download]
2)Rootes Android Phone
3)Sdk Installed
4)Little knowedge on Messing with Cmd
Processsss/Working:-
1)Plug in your phone( make sure that usb debugging is ticked on)(Dont't mount the sdcard)
2) open command prompt from Pc..(To open=> click start->run->type cmd->ok)
3) Navigate to the android sdk platform tools folder..
4) Type this commands:
adb remount
adb pull /system/framework/services.jar services.jar
adb pull /system/framework/framework-res.apk framework-res.apk
5)Now extract the colorChangev3.7z & paste the extracted file colorChangev3.jar in platform tools folder
6)Now make a folder called 'framework' inside Platform tools folder & move the services.jar into that folder
7)Create a zip file of the framework folder and name it theme.zip
(steps 7 & 8 shuld be done correctly or u will get errors)
8)Type this commands....
java -Xmx512M -jar colorChangev3.jar theme.zip clock=FFb4ff00 date=FFffffff
(definetly 'FFb4ff00' denotes the clock colour & 'ffffffff' denotes the date colour)
9) When its done it will leave a theme-new.zip in platform tools folder,take the new service.jar file out
& put that in platform tools folder.
10) Its almost done....Now you can take the new services.jar make flashable zip & flash...If you don't know how to make flashable zip then do this.
11) Type this command in already opened cmd
Commands:
adb remount
adb push services.jar /system/framework/
adb push framework-res.apk /system/framework/framework-res.apk
adb shell reboot
That's all you are done now.......:good:
One think you should note that you shouldn't get any error while following this whole process otherwise it will not wrk....
Basically this above process doesn't harm your mobile...But if anything wrong happend with you..Then you can't blame me..
Credits
milrtime83 for his guide​
Please Dont forget to Hit The Thanks Button.......... :good::good::good:
Reserve
{
"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"
}
Resreve

Help decompile recompile apk

{
"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"
}
What programs do I need? Leave link. Thank you!
try VTS studio,
google it,
best android development suite
Are you trying to decompile a system app from a ROM? If yes then do this:
You need the following:
1. framework-res.apk and twframework-res.apk from the ROM which you took the apk from
2. Probably administrator privilege
You need to do the following:
1. Navigate to Desktop and look for user name folder.
Example: Desktop/Carl/
2. Navigate to user name folder and look for "framework" folder inside "apktool" folder
Example: Desktop/Carl/apktool/framework/
3. Open apktool folder and inside you will see a bunch of frameworks in .apk folder
4. Leave that folder open and take the framework-res.apk and twframework-res.apk from the ROM which you took the apk you're trying to decompile/compile
5. Rename framework-res.apk to: 1.apk and twframework-res.apk to: 2.apk
6. Copy 1.apk and 2.apk to Desktop/<username>/apktool/framework/
Example: Copy 1.apk and 2.apk to Desktop/Carl/apktool/framework/
Once you're done, close and apk tool that you're using and try decompiling/compiling again. If still the problem exist, restart your computer.
Hope this helps.
PS. Sorry for late reply, kinda busy at work.
CarlDeanCatabay said:
Are you trying to decompile a system app from a ROM? If yes then do this:
You need the following:
1. framework-res.apk and twframework-res.apk from the ROM which you took the apk from
2. Probably administrator privilege
You need to do the following:
1. Navigate to Desktop and look for user name folder.
Example: Desktop/Carl/
2. Navigate to user name folder and look for "framework" folder inside "apktool" folder
Example: Desktop/Carl/apktool/framework/
3. Open apktool folder and inside you will see a bunch of frameworks in .apk folder
4. Leave that folder open and take the framework-res.apk and twframework-res.apk from the ROM which you took the apk you're trying to decompile/compile
5. Rename framework-res.apk to: 1.apk and twframework-res.apk to: 2.apk
6. Copy 1.apk and 2.apk to Desktop/<username>/apktool/framework/
Example: Copy 1.apk and 2.apk to Desktop/Carl/apktool/framework/
Once you're done, close and apk tool that you're using and try decompiling/compiling again. If still the problem exist, restart your computer.
Hope this helps.
PS. Sorry for late reply, kinda busy at work.
Click to expand...
Click to collapse
THANKS! Carl, is sucess!
vitorhugo said:
THANKS! Carl, is sucess!
Click to expand...
Click to collapse
Place solved in title k
Sent from my Titan TV S320 using xda premium

[How To] enable CRT Animation for [2.3.x]

CRT Animation On/Off running any GB rom (2.3.x)
Here is the screen Off/On animations mod. An awesome tweak which makes your phone's sleeping animations like old tv's shutting down.
Lets Begin.
[NOTE: Im not responsible for any bricked devices.]
Things needed
1. JAVA - Click Here
2. APK MANAGER - Click Here
3. Notepad++ - Click Here
Procedure
1. Download all the above applications.
2. Open APKMANAGER folder and place your roms "framework-res.apk" in "place-apk-here-for-modding" folder.
(framework-res.apk is placed in "/system/framework/here")
{
"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"
}
3. Open APKMANAGER folder and open "Script.bat".
4. Open "script.bat" and press "9" and hit enter. (this decompiles your framework-res.apk)
5. If sucessful, close this script and go to "APKMANAGER"/"projects"/"framework-res.apk"/"res"/"values" folder. Open "bools.xml"
6. Change
"<bool name="config_animateScreenLights">true</bool>"
to
"<bool name="config_animateScreenLights">false</bool>"
7. Again open script.bat and click on "11". (It will compile the application)
8. It will ask whether it is a system application or not, type "y" and hit enter.
9. It will show
"Aside from the signatures, would you like to copy over any additional files that you didn't modify
from the original apk in order to ensure least # of errors (y/n)
Press "y" and hit enter!
10. It will do the extracting. DO NOT PRESS ANY KEY NOW.
11. Open "APKMANAGER" folder, there will be a new folder "keep". Delete "resources.arsc" file from there.
12. Now open script and hit enter.
And the most IMPORTANT part.
After flashing framework go to settings>Display>Animations, select "All Animations".
AND if you dont want the animation simply change
"<bool name="config_animateScreenLights">false</bool>"
to
"<bool name="config_animateScreenLights">true</bool>"
CREDITS
Daneshm90 for the APKMANAGER
me for the guide
worked on micromax a87
:thunbup:

[Tutorial] Set Default Theme When Building Rom

This tutorial is for people building roms based on CyanogenMod only !
This tutorial will explain how to use a custom CyanogenMod apk theme as the default when building roms
Things you will need
1. Java JDK and Java JRE installed
2. ApkTool - Download
3. Notepad++ - Download
4. Theme apk file
5. Your custom rom
Step 1
Download and extract apktool into a folder on the root of you drive, call the folder apk
Once extracted you you have three files like this
{
"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"
}
Step 2
If you have already packaged your rom use something such as WinRAR to extract it to a folder.
Once extracted it should look similar to this
Step 3
In your rom folder navigate to system/framework and look for the framework-res.apk file
It should look like this
Step 4
Copy the framework file to your apktool folder
Your apk tool folder should now look like thisView attachment 2484553
Step 5
Now copy your theme into the same folder
The folder should now look like thisView attachment 2484556
Step 6
Run command prompt and enter the following commands
Code:
cd C:\apk
Code:
apktool if framework-res.apk
Code:
apktool d <whatever your theme apk is called>.apk
Your CMD windows should now look like this
Step 6
Go back to your apktool folder and now you should have a folder called <your theme name>.apk
It will look like this View attachment 2484571
Step 7
Go inside that folder and open AndroidManifest.xml with Notepad++
Step 8
Once you open this file you need to look for two strings, they should look similar to these ones
Step 9
Once you have found these strings minimize the Notepad++ window and navigate back to your rom folder
Now navigate to system and open build.prop with Notepad++ and add these two lines
Code:
persist.sys.themeId=~~~~~~
persist.sys.themePackageName=+++++++++
Replace "~~~~~" with theme id from AndriodManifest.xml
Replace "+++++" with package name from AndroidManifest.xml
Mine would look like this
Now save build.prop
Step 10
Go to your rom folder and navigate to system/app and copy your theme apk inside of this folder
Now zip your rom back up and flash it
When your rom boots you should now see you custom theme
Note
If you cant get apktool to work and it keeps saying something along the lines of "java is not an exacutable command"
Make sure you have installed the Java SDK and Java JRE and navigate to C:\Program Files (x86)\java
and you should see a folder called "jdk1.7.0_45" or "jdk" with different numbers after it
Now go to control panel and on the right hand side click "Advanced System Settings"
Then click "environment variables"
Under "system variables" create a new variable and call it JAVA_HOME
In variable value put the path of your java sdk folder so it would be
C:\Program Files (x86)\Java\jdk<what ever numbers are here on your pc>
Or 32 bit users
C:\Program Files\Java\jdk<what ever numbers are here on your pc>
Now before you save the environment variable put the path in speech marks like this
Now save and reboot
And for CM12.1 its possible? Or CM11?? I try but not work :/

Categories

Resources