[BUG REPORT] oat2dex breaks OpenGL/Play Store SOLVED! - Sony Cross-Device General

EDIT: The latest oat2dex solves this issue altogether.
WTF IS THE PROBLEM?
The OpenGL and Google Play Store refuse to work because baksmali inside the oat2dex tool misinterprets some fields in a single smali file and breaks "services.jar" when deodexing, and the main problem it causes is mistakenly setting your OpenGL version to 0 (instead of 3), basically disabling it.
oat2dex, for some reason, flips just a few specific fields (name and type) when deodexing, as if there is an ambiguity between 2 fields on the same offset.
When you flash the deodexed services.jar back to your phone and clear dalvik-cache, Android re-optimizes it (takes the "classes.dex" inside your new JAR file, does dex2oat on it, and saves it in /data/dalvik-cache/arm/). The deodexed file is broken, so that optimized file is broken too.
You take that broken odex file from dalvik-cache and deodex it again. Since it contains those flipped field names, this time it flips them again but to the correct fields.
The result DEX file you get by that second deodexing is a properly working DEX file, and if you rename it to "classes.dex" and replace "classes.dex" inside your broken "services.jar", you'll get a working "services.jar" and all your OpenGL and Google Play Store problems will disappear immediately.
HOW TO QUICKLY GET A WORKING DEX?
* Extract classes.dex from the JARs, rename them to framework.dex and services.dex.
* Copy them to your internal SD.
* Enable "USB debugging" in Developer options.
* Connect your device to your PC and open Command Prompt:
Code:
[B]adb shell[/B] (confirm ADB on your device)
[B]su[/B] (confirm SU on your device)
[B]dex2oat --dex-file=/sdcard/framework.dex --oat-file=/sdcard/framework.odex[/B]
[B]dex2oat --dex-file=/sdcard/services.dex --oat-file=/sdcard/services.odex[/B]
* Copy these odex files to your PC and deodex them again with oat2dex.
* Rename the new framework.dex and services.dex to classes.dex and add them to their JARs, replacing the broken classes.dex.
JARS AFFECTED BY THIS BUG
framework.jar/classes.dex --- only a single non-critical error in NumberPicker.smali (classes2.dex is fine)
http://forum.xda-developers.com/attachment.php?attachmentid=3338076&d=1432918042
services,jar/classes.dex --- Total of 8 errors, described below...
http://forum.xda-developers.com/attachment.php?attachmentid=3335118&d=1432772056
BUG REPRODUCTION
Requirements:
1) Java installed
2) oat2dex_bug.zip
ZIP contents:
* baksmali.jar
* oat2dex.jar
* boot.oat --- taken from /framework/arm/
* services.dex --- this is "classes.dex" from the deodexed "services.jar" (which breaks OpenGL)
* services-from-dcache.odex --- this is the odex file taken from "/data/dalvik-cache/arm/" that was created by Android after flashing the broken deodexed "services.jar" and clearing dalvik-cache
Reproduction steps:
1) Open "oat2dex_bug" folder, right-click inside it and then select "Open command window here".
2) Write the following lines exactly as follows:
java -jar oat2dex.jar boot boot.oat
java -jar oat2dex.jar services-from-dcache.odex odex
java -jar baksmali.jar -o services-from-dcache services-deodex.dex
java -jar baksmali.jar -o services services.dex
3) With WinMerge, compare folders "services" and "services-from-dcache".
You'll see that only one file has differences, and it's "ActivityManagerService.smali", that's the file you need to fix.
{
"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"
}
In the above images are the only affected areas you need to fix.

Holy @#%. Well done! This issue was a real pain. Thanks

What about fixing framework.jar ? Play store compatibility ?
Sent from my C6903 using XDA Free mobile app

dstrikersZ1 said:
What about fixing framework.jar ? Play store compatibility ?
Sent from my C6903 using XDA Free mobile app
Click to expand...
Click to collapse
framework.jar has only 1 error in NumberPicker.smali, and it's not very critical. Has nothing to do with the Play Store bug. After you've fixed services.jar by deodexing it twice, Play Store is fixed.

IaguCool said:
WTF IS THE PROBLEM?
The OpenGL and Google Play Store refuse to work because baksmali inside the oat2dex tool misinterprets some smali files and breaks "services.jar" when deodexing, and the main problem it causes is mistakenly setting your OpenGL version to 0 (instead of 3), basically disabling it.
oat2dex, for some reason, flips just a few specific fields (name and type) when deodexing, as if there is an ambiguity between 2 fields on the same spot.
When you flash the deodexed services.jar back to your phone and clear dalvik-cache, Android re-optimizes it (takes the "classes.dex" inside your new JAR file, does dex2oat on it, and saves it in /data/dalvik-cache/arm/). The deodexed file is broken, so that optimized file is broken too.
You take that broken odex file from dalvik-cache and deodex it again. Since it contains those flipped field names, this time it flips them again but to the correct fields.
The result DEX file you get by that second deodexing is a properly working DEX file, and if you rename it to "classes.dex" and replace "classes.dex" inside your broken "services.jar", you'll get a working "services.jar" and all your OpenGL and Google Play Store problems will disappear immediately.
JARS AFFECTED BY THIS BUG
framework.jar/classes.dex --- only a single non-critical error (classes2.dex is fine)
services,jar/classes.dex --- described below
BUG REPRODUCTION
Requirements:
1) Java installed
2) oat2dex_bug.zip
ZIP contents:
* baksmali.jar
* oat2dex.jar
* boot.oat --- taken from /framework/arm/
* services.dex --- this is "classes.dex" from the deodexed "services.jar" (which breaks OpenGL)
* services-from-dcache.odex --- this is the odex file taken from "/data/dalvik-cache/arm/" that was created by Android after flashing the broken deodexed "services.jar" and clearing dalvik-cache
Reproduction steps:
1) Open "oat2dex_bug" folder, right-click inside it and then select "Open command window here".
2) Write the following lines exactly as follows:
java -jar oat2dex.jar boot boot.oat
java -jar oat2dex.jar services-from-dcache.odex odex
java -jar baksmali.jar -o services-from-dcache services-from-dcache.dex
java -jar baksmali.jar -o services services.dex
3) With WinMerge, compare folders "services" and "services-from-dcache".
You'll see that only one file has differences, and it's "ActivityManagerService.smali", that's the file you need to fix.
And here are the only differences you find in the file (notice especially the first one and the last one):
Click to expand...
Click to collapse
java -jar baksmali.jar -o services-from-dcache services-from-dcache.dex
Click to expand...
Click to collapse
Error: "Can´t find the file services-from-dcache.dex"
There is no such file in the zip either - only services-from-dcache.odex, but with this file it did not work

moonryder said:
Error: "Can´t find the file services-from-dcache.dex"
There is no such file in the zip either - only services-from-dcache.odex, but with this file it did not work
Click to expand...
Click to collapse
Then you made a mistake somewhere.

IaguCool said:
Then you made a mistake somewhere.
Click to expand...
Click to collapse
tried it again, step 1 and 2 without problems, but step3 the same error as mentioned before
there is a new file in the folder called "services-deodex.dex"

moonryder said:
tried it again, step 1 and 2 without problems, but step3 the same error as mentioned before
there is a new file in the folder called "services-deodex.dex"
Click to expand...
Click to collapse
Ahh I see that oat2dex renames the file for some reason. I fixed line 3 to
java -jar baksmali.jar -o services-from-dcache services-deodex.dex
You could figure that out yourself, you know... by looking inside the folder, I don't see why you repeat every step like a robot uncritically.

IaguCool said:
...I don't see why you repeat every step like a robot uncritically....
Click to expand...
Click to collapse
cause i am not a programmer and a noob in this field contrary to you (maybe you are a genius and i am a little user :angel: )

moonryder said:
cause i am not a programmer and a noob in this field contrary to you (maybe you are a genius and i am a little user :angel: )
Click to expand...
Click to collapse
So basically it's like pushing a screwdriver into a wall socket without knowing what electricity is... I don't get why people that don't develop even try to deodex themselves in the first place. Deodexing is meant for developers, not "little users"...

so its must to be writen GL_ES_VERSION:I
its i/1/L ?

Alvian_P said:
so its must to be writen GL_ES_VERSION:I
its i/1/L ?
Click to expand...
Click to collapse
It's "I" for Integer. Seriously what are you people doing here? It's for *developers*, normal users have nothing to gain from this process.

That's how I have fixed it too, well done
Take care that mWentToSleep must also be fixed.
Both lines are inverted.
Edit: nevermind, your method is inverting both... I did it manually.

Please tell what command compiles the folder "services" into file "services.dex" back?

Bazooka Joe said:
Please tell what command compiles the folder "services" into file "services.dex" back?
Click to expand...
Click to collapse
Google for "smali-2.0.5.jar" for that. baksmali only decompiles.

IaguCool said:
It's "I" for Integer. Seriously what are you people doing here? It's for *developers*, normal users have nothing to gain from this process.
Click to expand...
Click to collapse
@laguCool
1. thx for discovering that problem and its solution
2. all devs began once upon a time, so i think threads like this one are very helpful for users who want to learn and become a dev in future too. So
3. please be soft with all of them who asks questions here.
Thx again for your excellent work and knowledge.
m.

moonryder said:
@laguCool
1. thx for discovering that problem and its solution
2. all devs began once upon a time, so i think threads like this one are very helpful for users who want to learn and become a dev in future too. So
3. please be soft with all of them who asks questions here.
Thx again for your excellent work and knowledge.
m.
Click to expand...
Click to collapse
Well, being soft isn't my thing, it's against my nature...
Anyways, if a person doesn't know what "I" means in Dalvik opcode, they are doing the learning process wrong. They need to be familiar with Dalvik datatypes beforehand.

IaguCool said:
It's "I" for Integer. Seriously what are you people doing here? It's for *developers*, normal users have nothing to gain from this process.
Click to expand...
Click to collapse
just look around , anyways my college is IT
ah sorry if this thread not open for normal users

IaguCool, Big, big Thanks!!! OpenGL worked now! :good:
There is a more simple way for obtain dirty odex from dirty dex file. Just copy deodexed services.dex to sdcard and type in terminal
dex2oat --dex-file=/sdcard/services.dex --oat-file=/sdcard/services.odex
Then copy created /sdcard/services.odex to PC and deodex them again to obtain correct services.dex.

_SIL_ said:
IaguCool, Big, big Thanks!!! OpenGL worked now! :good:
There is a more simple way for obtain dirty odex from dirty dex file. Just copy deodexed services.dex to sdcard and type in terminal
dex2oat --dex-file=/sdcard/services.dex --oat-file=/sdcard/services.odex
Then copy created /sdcard/services.odex to PC and deodex them again to obtain correct services.dex.
Click to expand...
Click to collapse
Thank you I rarely use the terminal so I missed that. I actually copied all /framework/ odex files from dalvik-cache to see if there are more JARs affected by this bug, will add them to the list if I find any.

Related

[FM TRANSMITTER] (dev needed)

this is an older tutorial i found for the evo way back. it needs to be updated..
this could possibly work on other android htc phones to that have the fm transmit capability....
the evos Broadcom chip has a built in fm receiver and also a transmitter.
according to some threads and diagrams ive seen the transmitter does have a power source, it just doesnt have and software code to actually work.
like hdmi the hardware was there but there was no code set up, therefore we didnt have full hdmi out. it had to be built from scratch.
the hardware for the fm transmitter is there we just need some one to build the code for it.
some one please take this on!!
This tutorial was originally posted in > android development and hacking > android software development.
i am reposting it here in the evo forums for guidelines
its a nice tutorial but its old. i think it was for android 2.0 ive followed the tutorial but i couldnt get it working, and i by no means have the experience to switch things up and get it working.
[TUTORIAL] Reverse engineering HTC FM Radio for noobs (on EVO 4G)
Okay, I'm writing this because I want to help any other newbies trying to learn how to reverse engineer. The technical details involved in this are extremely daunting, so the purpose of this tutorial is to first explain in layman terms exactly what you're trying to accomplish and what to expect. Then we'll go over the details. That way you're not completely blind going into this. I'm fairly new to the scene, so I'm not as knowledgeable as everyone else. If you see any errors in my post, let me know so I can change. I'm going to assume you know a little bit of Java, can find your way around a computer, and know nothing about Android. The techniques used should work with other Android phones. For this tutorial I'm using Windows 7, Cygwin, and my stock (not rooted) EVO 4G mobile phone.
The FM tuner for the Evo is run by a Broadcom chip: BCM4329. This chip is pretty amazing in that it does wireless, bluetooth, and it has an FM receiver/transmitter. We're interested in the FM receiver / transmitter.
Now, all android phones are based on a Linux kernel. Basically they're Linux running computers. The Android operating system is then installed onto the linux system. Every app is then run off of Android.
Android is based on Java but it is not a Java system. It uses a virtual machine called Dalvik. Google did this to get around licensing issues with Sun Microsystems. So they pretty much invented their own machine language (called byte code) for the Java language. This makes things complicated for the reverse engineer because from what I've read, once Java is converted into this machine language or byte code, it can't be converted back.
So let's rehash.
If you were programming strictly in Java, you would see these extensions:
Java source code = .java
Compiled Java source code = Java byte code = .class
Compressed file to package your program = .jar (Java Archive)
But since you're programming in Android and Dalvik, you will see these:
Java source code = .java
Compiled Java source code = Dalvik byte code = .dex
Compressed file to package your program = .apk
(I haven't mentioned this, but HTC further Optimizes their .dex code)
Optimized Dalvik byte code = .odex
I'm writing all of these down because it's very easy to get confused with all of the extensions. (for me at least!). remember how I said once you go dex, you can't go back to java? That's where JesusFreke comes in. He's a senior member of XDA, and he created "baksmali" and "smali", two programs that can convert the Dalvik code back into a human readable format. These files have extensions of .smali
Decompiled Dalvik byte code = .smali
But what can you do with .smali files? That's where this other senior member, brut.all comes in: He developed apktool. apktool takes JesusFreke's work to the next level. This program in conjunction with NetBeans, actually lets you trace through any program using the .smali code taken from JesusFreke's programs!
apktool does this by converting those .smali files into "fake" .java files that can be used by the NetBeans (program that compiles and makes java programs) IDE. I say "fake" because apktool embeds the .smali code into java files as comments. However, once you attach a debugger to NetBeans, you'll see that the debugger will follow line by line every execution statement found in the smali code!
So...... you can take the program you want, plug it into Net Beans using a debugger (using the default ddms command provided by Android SDK), and you can trace everything you do in the program. I have it connected to my phone, so whenever I push a button while running my HTC FMRadio app or unplug my headphones,I see the corresponding response to the HTCFMRadio code I have loaded in NetBeans. I can now see in real-time how the program operates from my own interactions... JAM.
Technical Aspects: How to get from ground zero to tracing HTCFMRadio?
1.) Download Android SDK - Go to google development site and follow instructions: Make sure to download the latest Java JDK. Once that is installed, download NetBeans 6.8. Unfortunately, smali debugging does not work with the lastest versions of NetBeans.
Download the "Java SE" version for minimal space
http://netbeans.org/downloads/6.8/index.html
You can follow the rest of Google walkthrough and download Eclipse and ADT plugin, but it's not pertinent to this. You're going to be using adb and ddms from the android SDK extensively, so make sure the path for </android SDK/tools> is included in the PATH variable in your ENVIRONMENT SETTINGS. To get here, right click My computer, click properties, Advanced Settings, ENVIRONMENT SETTINGS.
2.) Search for 7z and download it. It is an awesome and free compression tool that will be extremely useful. It can be used to "unzip" .jar, .apk, and other compressed formats.
3.) Get the Radio app. You can do this by going to "shipped-roms" website, downloading the latest Supersonic image, and following the directions in the unlockr tutorial for HTC kitchens at the unlockr website... (once you have extracted the files from the image, you can look in the system/app and system/framework directories to get the files listed below) or:
you can pull the following files from your phone:
Using the command prompt type (and with phone plugged in, and with USB debugging enabled on phone):
adb pull /system/app/HtcFMRadio.odex
adb pull /system/app/HtcFMRadio.apk
adb pull /system/framework ./framework
This will put HtcFMRadio.odex and HtcFMRadio.apk in the current directory and create a framework directory with more files. A couple of the files in the framework are needed for the HtcFMRadio app, but for simplicity, we're just going to pull the whole directory.
Now that we have the files, we have to make a few changes to make the app installable and to be viewable by the debugger. To do this we have to decompile the .odex format into a human readable format we can edit. That brings us to:
3.) Download baksmali and smali from Project Hosting on Google Code (google search smali).
Usually an Android application is made up of one file, an apk file. Inside the apk file is an AndroidManifest.xml file, a classes.dex file (compiled Java code for the program), and other folders. The other folders contain either graphics or other .xml files that tell the program how it should look to the user. We don't have to worry about those for now. This is important because APKTOOL only opens programs set up this way. But wait up? We didn't download one .apk file, we downloaded an .apk file and an .odex file! What gives? Well, if you right click the apk file and open it (using 7z), you'll see that it's missing the classes.dex file. The dex file for the app is actually the HtcFMRadio.odex file we downloaded. So, to make this system app more like a nominal app, we have to find a way to convert the HtcFMRadio.odex to a classes.dex file. That's easy with baksmali and smali!
Once you download goto command prompt and type:
java -jar baksmali-<version>.jar -d framework -x HtcFMRadio.odex
(Remember to match baksmali-<version>.jar with the filename of baksmali you downloaded)
If done correctly, you should see a newly created \out directory
This creates an out\com\htc\fm directory with many .smali files.
Now let's reverse the process and put it back as a dex file. Type at command prompt:
java -jar smali-<version>.jar out -o classes.dex
If done correctly you'll see a newly created classes.dex.
now, right click on HtcFMRadio.apk (select 7z and open). Drag classes.dex into the file. Say yes to the prompt. Now you have a normal apk file APKTOOL can read!
4.) Download APKTOOL from Project Hosting on Google Code and the helper apps for your OS. (If you're extracting files for windows OS you should have apktool.bat and aapt.exe). Extract (again using 7z, don't you love this program?) apktool.jar (keep it as a jar file, don't extract the stuff inside of it), apktool.bat, and aapt.exe to the directory you're working on. To make things neat, you can also delete HtcFMRadio.odex (you don't need it anymore) and classes.dex (make sure you put it in the HtcFMRadio.apk file first!)
If this is the first time you're using apktool, then you have to install the htc framework so apktool can baksmali the Radio app. You only have to do this once:
apktool if ./framework/com.htc.resources.apk
Alright, at the command prompt:
apktool d -d HtcFMRadio.apk
This extracts the contents of HtcFMRadio.apk and places them in the HtcFMRadio directory. However, there are two major differences between this content and the content created in step 3. If you go into the smali directory you'll see that instead of .smali files, you'll see .java files. And if you go back and edit the AndroidManifest.xml file, you will also see that it's in text! Android applications convert their xml files to binary format. Now that APKTOOL has converted everything to an IDE friendly format, we can use NetBeans to edit everything. The first thing we're going to do is edit AndroidManifest.xml (using notepad) and add the following:
android:debuggable="true" to the Application tag.
IT should now look like this:
<application android:theme="@android:style/Theme.Black.NoTitleBar" android:label="@string/fm_app_name" android:icon="@drawable/fm_radio" android:taskAffinity="android.task.fmradio" android:description="@string/htc_corp" android:allowTaskReparenting="true" android:debuggable="true">
This permission lets the debugger watch the program while it's running on the phone.
We are going to run into two problems if we try to install this program. One is that Android doesn't let you install more than one copy of a system app. The second issue is that if we change the signature of our system app, then we'll have to change the signatures of our other system apps as well! Ahh.... So, to get around that, we're going to trick Android into thinking we have a completely new program. We're going to do that by renaming the com.htc.fm class to com.htc.modradio class. Next step:
5.) Cygwin (or Linux virtual machine)
The easiest way that I can think of to replace strings in multiple files is by using linux. You can most definitely do it in WIndows, but I dont know how. If you let me know how, I can put it in this tutorial.
(update: you can use Notepad++ to easily find/replace strings in multiple files for Windows. You still, however, want to download Cygwin if you're going to develop with Android-NDK.)
For now, just search for Cygwin (Cygwin is a program that lets you run Linux commands from a command prompt using your Windows directories), and install it. Make sure to have the Perl option selected. You'll need Perl to make the following commands work.
Once you get Cygwin up and running
cd <to your HtcFMRadio directory>
in my case it's
cd /cygdrive/c/Users/Jerry/Desktop/HtcFMRadio
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'
If you don't follow this order, your source code will get messed up.
If using cygwin, a bunch of .bak files will be created. Using windows search, find all .bak files in your HtcFMRadio directory, then select them all and delete them (Make sure they are only files with .bak!)
Now just rename the fm directory to modradio. It is located in HtcFMRadio/smali/com/htc
Now go to your windows command prompt and type:
apktool b -d .\HtcFMRadio modradio.apk
Now sign and install modradio.apk on your phone.
adb install modradio.apk
If you have never signed before, then you need to use keytool and jarsigner. These two files are in your JDK directory, so make sure you include your JDK directory in the PATH variable of your ENVIRONMENT SETTINGS. (To get here, right click on My Computer, click Properties, Advanced Settings, Environment Variables. Once you make change, open up a new COMMAND prompt to see changes).
cd to the directory which has modradio.apk
now type:
keytool -genkeypair
Answer all questions, then use the same password for all password prompts.
Next type:
jarsigner -verbose modradio.apk mykey
Type in the password you created in the above step. Your apk should now be signed.
Next install:
adb install modradio.apk
Success!
6.) Testing the app on phone
Go to your phone and you'll now see a new FMRadio icon next to your first. Click on it and watch it open. It should now be able to play music. Keep it open.
7.) Using Netbeans
Go into HtcFMRadio and delete the build directory created by APKTOOL.
Now open up Net Beans and click on File, New Project, Select Java Project with Existing Sources, click on Next
Select HtcFMRadio directory for Project Folder, rename Project Name to whatever you want. Let's type in ModRadio. click on Next
Next to "Source Package Folders" click on "Add Folder" and select the smali directory.
Click Finish. For a quick tutorial by Brut.all, search APKTOOL in youtube and click on: Apktool Demo 2 - Smali improvements
Right click on Libraries. Click on "Add Jar / Folder". You want to add Android.Jar. Since I have Android 2.1 loaded I went to /platforms/android-7 located in my android SDK directory.
Your project is now ready for editting!
8.) Running the Debugger to trace through program.
Next go back to Windows command prompt and type ddms. This runs the Dalvik Debug Monitor. A window should open up. In the left hand side you should see com.htc.modradio. That's our app! To the right you're going to see 2 numbers, you're interested in the one to the right, 4 cells away from com.htc.modradio. This number is a port number, and you're going to use it to communicate with NetBeans. (In my case it is 8603)
Go back to NetBeans and click on Debug, Attach Debugger.
In the host field type: localhost
In the Port field: type in the second number you saw. (8603)
If everything is working you'll see a bug appear next to com.htc.modradio in the Dalvik Debug Monitor. Look at the bottom bar of NetBeans for feedback. If you get errors make sure the numbers match, or try port 8700 and make sure you select com.htc.modradio in the Dalvik Debug Monitor. Port 8700 is the default port used for whatever program you select in Dalvik Debug Monitor.
9.) Setting a breakpoint
I'm making this a seperate step because it is completely arbitrary. When creating a break point be sure to follow this rule:
You must select line with some instruction, you can't set breakpoint on lines starting with ".", ":" or "#".
Rather than looking for a spot to breakpoint, though, I'll tell you where to put one so you can quickly see how the debugger traces through the code. You aren't "REQUIRED" to do the next step, but if you want to trace you have to put a breakpoint somewhere.
In Net Beans click on the Project tab, click on Source Packages, com.htc.modradio, and then doubleclick on BroadcomFMTuner.java
We're going to insert a breakpoint. Scroll down to line 3226 and on your keyboard press: CTRL-SHIFT-F8, select line in dropdown box and hit ok. (To keep it simple, I usually look for "invoke" instructions to set breakpoints at)
Now go to your phone and click on the physical "back" button on your phone. This will clear the radio,(you should still be able to listen to music). Drag your status bar down. You should see a radio icon. Click on it again. The radio backgroudn will appear, but you wont' see any text or anything. Now go back to your netbeans application. You should now see debug options highlighted! Click on Step Over (F8) to step through!
{
"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"
}
i found a few things.
http://pdf.eccn.com/pdfs/Datasheets/Broadcom/BCM4329.pdf
http://www.broadcom.com/products/Bluetooth/Bluetooth-RF-Silicon-and-Software-Solutions/BCM4329
I didn't read all of this but I have to mention that byte code is not a type of machine code..
byte code is what is created when you compile a java file. The JVM or dalvik-VM in this case, then converts this byte code to machine code at run time.

[Guide] Make your first custom Rom- easiest way

Newbies Thinks to make custom rom.. but dunno how
But when forever king's guide here NO prob!​
Things we Need-
1 winrar or winzip
base rom
Brain
notepad ++
Things You will find in Rom (when will you extract-:
1- Boot.img (in some roms not)
2-System
3- Meta-inf
No need to touch Boot.img, Meta inf as i will tell later on
So open system folder
Open Build.prop in system folder and open with notepad++
Open this page
tweaks by forever king
See open build.prop tweaks
And open build.prop and scroll to last....
Press enter
and type
"#Tweaks"
Now add all tweaks in that Webpage
Mods
You can add many mods like
1 Beats Audio (2.3+)
2 Adrenaline Engine (2.3+)
3 SlaidyBoost (2.3+)
4 Megabassbeats (2.2+ need$ xloud)
U need to port them to ya fone , dont ask me as i also dunno l0l
Adding tweaks to ya rom (build.prop)
Open build.prop (system folder)
find line ' ro.build.id=xxxxxxx '
Now change this to ' ro.build.id=yournameorwhatever '
Adding Apps to your Rom
1 Open system>app (folder)
Add .apk files to it (copy n paste xD)
2 Adding Init.d tweaks (if your base rom having init.d support in boot.img)
Open this webpage
tweaks by forever king
Scroll down (lil bit)
and see init.d tweaks
Add like this
Make new file and paste any script
like
"echo "2048,3072,6144,15360,17920,20480" > /sys/module/lowmemorykiller/parameters/minfree"
this and save this file (no extention , save without .txt or any)
3 Adding bootanimation
Replacing bootanimation
-download bootanimation u want to use and rename it to "bootanimation.zip"
-delete animation u find in /./"rom"/system/media and then paste bootanimation u downloaded
Now modifying framework (u see statubar in rom and many tweaks)
Using UOT kitchen
Thanks to "CallMeVentus" for guide
Finnaly Done... will add more when i am freek xD >.<
Now Compress it in .zip
Now sign the Rom Signer
Open and see how
now flash Rom and test.....
if workeD then coool
Never say 'thanks' , hit it ​
Advance for N00bs
Never say thanks,hit it ​
How to make Rom transparent
See my guide = http://forum.xda-developers.com/showthread.php?t=1799373
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
How to decompile android app , u need this TUT for making rom transparent or editing apps..
See my guide= http://forum.xda-developers.com/showthread.php?t=1772220
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
How to add powermenu on your Rom
http://forum.xda-developers.com/showthread.php?t=811532
Thanks untermensch
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Some tweaks making Rom fast
http://www.mediafire.com/?t8rsdmedu5w2vo5 (by me)
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
How to Deodex Rom and >odex back
Things nEeded
Code:
backsmali.jar
* smali.jar
* custom java.awt.jar
* dexopt wrapper
* recent version of busybox
Download this
Open CMD CD to folder extracted those scripts and type
1 Deodexing Framework files-
Code:
java -Xmx1024m -jar baksmali.jar -c :core.jar:bouncycastle.jar:ext.jar:framework.jar:android.policy.jar:services.jar:core-junit.jar -x android.policy.odex
(i am taking android.policy.jar as example , if framework.jar or whatever just change 'android.policy.jar' to 'framework.jar' and 'framework.odex'
This will make out folder
now smali that out folder by
typing
Code:
java -Xmx1024m -jar smali.jar out -o classes.dex
in CMD
HTML:
open android.policy.jar with 7zip without extracting
push the classes.dex created in the 7zip window in the root folder
close the 7zip windows and here is your deodexed android.policy.jar
2 Deodexing any App file i am taking systemUI.apk as example
Code:
java -Xmx1024m -jar baksmali.jar -c :am.jar:android.policy.jar:android.test.runner.jar:bmgr.jar:bouncycastle.jar:com.android.location.provider.jar:com.google.android.maps.jar:com.samsung.device.jar:com.yamaha.android.media.jar:core.jar:core-junit.jar:ext.jar:framework.jar:ime.jar:input.jar:java.awt.jar:javax.obex.jar:libvtmanagerjar.jar:monkey.jar:pm.jar:sec_feature.jar:seccamera.jar:sechardware.jar:secmediarecorder.jar:services.jar:sqlite-jdbc.jar:svc.jar:twframework.jar -x SystemUI.odex
Again out folder created now make it smali
by typing
Code:
java -Xmx1024m -jar smali.jar out -o classes.dex
in CMD
open SystemUI.apk with 7zip without extracting
push the classes.dex created in the 7zip window in the root folder
close the 7zip windows and here is your deodexed SystemUI.apk
Click to expand...
Click to collapse
3 Now we will learn to odexing back
1/ backup your original files (apk jar and odex) to /sdcard/Mod/
2/ copy modified deodexed files (.apk and .jar) in /system/framework/
3/ open a CMD prompt in the folder of adb.exe (usualy /android-sdk-windows/platform-tools/)
4/ type command :
Code:
adb shell
su
## for .JAR file :
dexopt-wrapper /system/framework/XXX.jar /system/framework/patched_XXX.odex /system/framework/core.jar:/system/framework/bouncycastle.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/android.policy.jar:/system/framework/services.jar:/system/framework/core-junit.jar
response must be :
--- BEGIN '/system/framework/android.policy.jar' (bootstrap=0) ---
--- waiting for verify+opt, pid=7194
--- would reduce privs here
--- END '/system/framework/android.policy.jar' (success) ---
## for .APK file :
dexopt-wrapper /system/framework/XXX.apk /system/framework/patched_XXX.odex /system/framework/core.jar:/system/framework/bouncycastle.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/android.policy.jar:/system/framework/services.jar:/system/framework/core-junit.jaradb shell
su
## for .JAR file :
dexopt-wrapper /system/framework/XXX.jar /system/framework/patched_XXX.odex /system/framework/core.jar:/system/framework/bouncycastle.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/android.policy.jar:/system/framework/services.jar:/system/framework/core-junit.jar
response must be :
--- BEGIN '/system/framework/android.policy.jar' (bootstrap=0) ---
--- waiting for verify+opt, pid=7194
--- would reduce privs here
--- END '/system/framework/android.policy.jar' (success) ---
## for .APK file :
dexopt-wrapper /system/framework/XXX.apk /system/framework/patched_XXX.odex /system/framework/core.jar:/system/framework/bouncycastle.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/android.policy.jar:/system/framework/services.jar:/system/framework/core-junit.jar
It will makepatched_apknameyouodexing file now remove (renaming) "patched_" line so it will be "apknameyouodexing.odex"
Now copy Signatures- (in same CMD)
Code:
# if not already done ...
adb shell
su
# copy the original .odex and .jar in system/framework (not .apk) :
cp /sdcard/MOD/original.XXX.odex /system/framework
cp -f /sdcard/MOD/XXX.jar /system/framework # where XXX.jar is the original odexed .jar
# give all permissions to XXX.odex files :
chmod 777 /system/framework/original.XXX.odex
chmod 777 /system/framework/patched_XXX.odex
# copy signature :
busybox dd if=/system/framework/original.XXX.odex of=/system/framework/patched_XXX.odex bs=1 count=20 skip=52 seek=52 conv=notrunc
response must be :
busybox dd if=/system/framework/original.XXX.odex of=/system/framewor
k/patched_XXX.odex bs=1 count=20 skip=52 seek=52 conv=notrunc
20+0 records in
20+0 records out
20 bytes (20B) copied, 0.002042 seconds, 9.6KB/s
Done now odex/deodex your Rom , so easy!
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Changing splash Screen (bootsccreen before bootanimation)
Ok. 1st of all i dont maDe this script and i dont know who made it xD but i would day 'thanks' to Him
http://www.mediafire.com/?sr6lso6w7vj21o6
How to use this!! >>??
Decompile boot.img Scroll down to see HoW to decompile it/use DSIXDA kitchen
Ramdisk>initlogo.rle (make new folder and paste initlogo.rle into it)
now extract that downloaded kit in it
1 Now open CD to location and type
Code:
convert_image to rle.bat initlogo.rle
(if u named .rle file to 'yourfilename'
then type
Code:
convert image to rle.bat yourfilename.rle
2 the filename.raw file and filename.rle file will be created at the same location as filename.rle
Now yoU will see filename.png edit it like what you Want xD
3 For compiling filename.png to .rle , CD to that folder having dose files!
typE
Code:
convert rle to image.bat filename.png
Use this if you see Decompiled .rle Burred-
Code:
@bin\convert -depth 8 -size 333x774 rgb:initlogo.raw initlogo.png
(take your phone's size i just took which my mind told xD)
4 Now you will see new file named
filename.png.rle rename it to filename.rle
Done now replace it into your extracted boot.img and repack it
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Decompilng Boot.img
I didnt made this Script http://www.modaco.com/topic/340710-tool-edit-bootimg/ is originall thread thanks to him
Download Boot.img tools
So easy to use
Just extract it in folder
Now place boot.img also in it
Now open 'start.bat'
* Press 1 to decompile the boot.img
* replace the ramdisk.gz (if you want)
* replace the kernel (if you want)
* Press 2 and it will compile the boot.img again!
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Modifying updater-script (found in /META-INF/com/google/android)
Open with Notepad++
Now you can see in this pic theres written 'Welcome to Cm installer....'
{
"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"
}
How to make this!
open updater-script
you will see 1st line ! make enter so you can add 1 line (at first)
Now add
Code:
ui_print("your text anything");
Code:
package_extract_dir("system", "/system");
tells extract directory system to system (in android)
Code:
mount("system");
tells mount specific directory like u can change location to dev folder
Code:
unmount("/system");
means unmount from where you mounted ! before
Code:
show_progress(0.200000, 5);
tells us that show progress like you can see when installing Rom yellow lines comes (CWM) u can control by this. its by Seconds..
Code:
symlink("busybox", "/system/xbin/fold");
means make symbolic link to that file at folder 'xbin'
Code:
format("MTD", "system");
means format mounted system folder
Code:
delete("/data/local");
Tells that delete /data/local folder
Code:
set_perm(0, 0, 0777, "/system/bin/chka2sd");
set pem means setting permission like chka2sd permission rww-rww-rww
Code:
assert(package_extract_file("boot.img", "/tmp/boot.img"),
write_raw_image("/tmp/boot.img", "boot"),
delete("/tmp/boot.img"));
it means flash boot.img make raw file (image) at tmp/boot (afterwards android do which i dunno) and delete that file!
Now save this file
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Modifying settings.apk
Creed$ rom!
you can see 'author name' which is not in our normal settings!
how he D!d?
Decompile apk by apkmanager ( i wont tell again xD , not by apktool )
1 goto res>xml open "device_info_settings.xml"
2 scroll to last and add line before "</PreferenceScreen>" line
3 add this line
Code:
<Preference android:title="Rom name (or whatever" android:summary="My rom name (what ever)" style="?android:preferenceInformationStyle" />
you can add many of them
4 Now compile from apkmanager when ask delete any file from 'keep folder' delete this file from keep folder and Install apk
too easy!
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Enabling CRT animation on 2.3x
CRT animation is dam cool animation effect when locking phone so see how to make in your rom
But what is it?
1 Decompile framework-res.apk
2 goto res>values>bools.xml
3 Change "<bool name="config_animateScreenLights">true</bool>" to "<bool name="config_animateScreenLights">false</bool>"
Done.
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Swipe to clear notifications
http://forum.xda-developers.com/showthread.php?t=1483193
thanks hansip87
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
When i do something (just that thing which i moded) i got bootloap/loop!
1 Open that think you will get loop
2 open terminal
3 type
Code:
su
logcat>sdcard/logcat.txt
So end. i will add more if i got any in mind/guidE xD
A nice guide for the noobs, but I think all of this is a little basic. But if you keep adding onto this, then it will be a great guide.
Nice
asvantypography said:
Nice
Click to expand...
Click to collapse
thanks button dere
invasion2-- adding sooon!!
Is it possible to deodex from terminal emulator?
-XoRoX- said:
Is it possible to deodex from terminal emulator?
Click to expand...
Click to collapse
sooory dude! but u can thru fone.... I saw app' odex me ' or maybe it was 'deodex me' I dunno it works/not
Thanks for your work!
john9 said:
Thanks for your work!
Click to expand...
Click to collapse
button there >.< read....this..every user commenting btw welcome!
Thanks for this guide! I assume no linux dev environment is needed, cuz I can't, at least that's what happened with dsixda kitchen
Sent from my HTC_Amaze_4G using Xparent Green Tapatalk 2
eggydrums said:
Thanks for this guide! I assume no linux dev environment is needed, cuz I can't, at least that's what happened with dsixda kitchen
Sent from my HTC_Amaze_4G using Xparent Green Tapatalk 2
Click to expand...
Click to collapse
press thanks n welcome...I will add sooon its long so its future plan xD
modifying settings tut is wrong.
we have to edit xml in strings and public also
lol ur wrong
Avilove.Cullen said:
modifying settings tut is wrong.
we have to edit xml in strings and public also
Click to expand...
Click to collapse
ps. I am not editing settings.xml!
its lyk this! I made it dude! public.xml?
which entry? of Icon? no Icon needed!
Well its comprehensive and noob proof
Just a side note: Always mention the link to original article of any forum especially the deodexing part!
Secondly as Avilove.cullen said the tutorial for modification in Settings is incomplete as you also have to kang up the respective strings in strings.xml
And FYI we need not modify public.xml only when you put icons or images
varun.chitre15 said:
Well its comprehensive and noob proof
Just a side note: Always mention the link to original article of any forum especially the deodexing part!
Secondly as Avilove.cullen said the tutorial for modification in Settings is incomplete as you also have to kang up the respective strings in strings.xml
And FYI we need not modify public.xml only when you put icons or images
Click to expand...
Click to collapse
ok... will makE comlelty fr noobs !
dude I sa!d credits to dere devs ok will add link soon xD
fr icons u r wrong
decompile microfire 2's rom decompil settings.apk lol seee fire icon deres entry in public.xml Icons- which sum roms having coloured icons ! seee I can calll aksh too he also say this!
its ofcourCe v need png entry in settings.xml (or whereva)
and 1 png of that name I'm drawable-xxx
For adding strings, adding those strings in string.xml and public.xml is not necessary.... u cat do that too... but it works without adding too... i checked it ma self.... just remv "@string\" and "your_text".....
When adding a new menu item you need to edit the layout right?
Sent from my LG-E739 using Tapatalk 2
mistere372002 said:
When adding a new menu item you need to edit the layout right?
Sent from my LG-E739 using Tapatalk 2
Click to expand...
Click to collapse
Actually this isn't fundamental
It depends on the original developer where he defines it
In case of settings.apk it is with xml folder.
varun.chitre15 said:
Actually this isn't fundamental
It depends on the original developer where he defines it
In case of settings.apk it is with xml folder.
Click to expand...
Click to collapse
OK so say you wanted to add a list item called start clock. You would add the preferencescreen code and specify the target in settings.XML only? You wouldn't add lines to Id.XML or strings.XML and values.XML and then specify where in the layout folder of the appropriate XML in that folder?
Sent from my LG-E739 using Tapatalk 2
Who knows the reason for always apps optimizing in my custom Rom in every reboot?( always android is upgrading)
Sent from my SK17i using xda premium

[GUIDE] Beginners/Ref Guide to Making Roms.

Hi guys! I see many people trying to learn how to make roms, Here i show the easiest and shortest way on how anyone can begin making roms for the Galaxy S3. ​
Requirements:
Prepared CWM Stock Package.
Apktool
7-zip
Notepad ++
Setting Up, and Introduction​
IF you have downloaded firmware from sammobile instead of zoot1's package, use this part for Setting up and introduction: http://forum.xda-developers.com/showpost.php?p=37812381&postcount=33
OR ELSE THE EASIER WAY
To start with, Download the prepared CWM Stock Rom by zoot1 here: http://forum.xda-developers.com/showthread.php?t=1868004
I personally use firmware from sammobile, because i like to do everything myself. Though this method would be easier for beginners.
Extract the zip file to folder called "ROM".
Now lets head towards the customizing.
Thanks to Prawesome alot for this part. I took some info from his guide.
So now, open up the system folder. You'll find loads of folders in it. Here is a brief introduction to each of those folders:
1. apps
When you open this folder. You will find apk's. An apk is an install-able app package for any Android Device.
You can delete specific apps incase you want to delete. But take extra precautions on what you're deleting. As some apps are useful. You can add apps here as well in formats of apk's. But note, adding Play Store apps to the system/app folder is not recommended. For example you don't want Google Talk in your rom, you just have to delete the Talk.apk.
2. bin
Nothing really to mod in this folder. Full of advanced techy stuff. xD
3. etc
Here is where most of the tweaks come in. There is a folder called init.d where mods like the V6 Supercharger or multi-tasking fixes can be applied. Note! Don't add more than 1 or 2 scripts. Most of them usually conflict with each other.
In the gps.conf file, you can edit your gps info to make the gps more accurate. Pretty good guides about this, search them out.
Next is the hosts file. Devs use this to block sites from generating ads, and keeping their roms ad-free. Take a look at my DroidS3 hosts file, there are over 20,000 hosts blocked. You can use the same hosts file for your rom too.
4. Fonts
Very easy folder to understand. All you need to do here is replace ttf files, and you'll change the fonts.
5. Framework
Here is where the big mods come in. I'll explain further on about this. It contains the android.policy.jar, a useful element to add many mods. Framework-res is used to change wallpapers and theme the rom. I'll explain later.
6. libs
Contains all the libs needed for specific system apps to work. Don't mess here unless you're adding a mod.
7. Folders like csc, hdic, sipdb, wakeupdata, vendor, excetra..
These are the folders, there isn't much to do. Csc folder contains the feature.xml where some mods can be added. Search the forums for that. The rest contain multi-languages and more stuff.
8. xbin folder
Used to add scripts like busybox, dexdump, openvpn support. More like the bin folder but smaller.
9. Build.prop
Ever wondered how some roms have android 5.0, when it hasn't even released? All you need to change is the ro.build.version.release to any number you like. Even Android 20! Go change it, and fool some noobs out there. More mods can be added to this file. e.g:
Code:
debug.sf.hw=1
video.accelerate.hw=1
debug.performance.tuning=1
profiler.force_disable_err_rpt=1
profiler.force_disable_ulog=1
ro.config.nocheckin=1
ro.media.enc.jpeg.quality=100
ro.media.dec.jpeg.memcap=8000000
ro.media.enc.hprof.vid.bps=8000000
ro.telephony.call_ring.delay=0
ro.lge.proximity.delay=15
mot.proximity.delay=15
ro.ril.disable.power.collapse=0
pm.sleep_mode=1
ro.config.nocheckin=1
The codes listed above are for improving jpeg quality, saving some battery life, reducing call delay and more. Search for build.prop mods, you'll find loads of them. ​Now, a small explanation of the Meta-inf folder.
In Meta-Inf you'll find the updater-script.
Since this is aimed at beginners, I'll just show you how to change what text is shown during install in CWM.
Just edit what's in the quotes of the ui_print code in the file, and enter your own text. e.g:
Code:
ui_print("Hi, This message in quotes is displayed in recovery");
Modding!​
It's time for the modding to begin.
Get apktool from: http://forum.xda-developers.com/showthread.php?t=1755243
Now, first copy your framework-res from the /system/framework directory to where you extracted apktool files. Let's call this folder "apktool"
Open the folder apktool, press shift and right click. Click on "Open command window here". Type:
Code:
apktool if framework-res.apk
Now you are ready to decompile apk's.
I'm going to show you how to mod different files. Copy over:
SystemUI.apk
android.policy.jar
framework-res.apk
1. SystemUI.apk
Just showing you basic modding here. Copy over SystemUI.apk to apktool folder. In the command prompt, type
Code:
apktool d SystemUI.apk
After it's done, you should see a SystemUI folder in the apktool directory.
I'm going to show you how to make the status bar transparent, thanks to raubkatze for this part.
Navigate to res/layout/tw_super_status_bar.xml and change android:background to match the red line.
Code:
<com.android.systemui.statusbar.phone.StatusBarWindowView [B][COLOR="Red"]android:background="#00000000[/COLOR][/B]" android:focusable="true" android:fitsSystemWindows="true" android:descendantFocusability="afterDescendants"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui">
Save and close.
Then navigate to /res/values/drawables.xml
Edit to match:
Code:
<item type="drawable" name="status_bar_background">[COLOR="red"][B]#00000000[/B][/COLOR]</item>
That's it. Save and close.
Go back to your command prompt and type
Code:
apktool b SystemUI SystemUI-new.apk
After it's done, probably will take around 5-10 minutes. You'll find SystemUI-new.apk in your apktool folder. Open both SystemUI.apk and SystemUI-new.apk with 7-zip. Delete AndroidManifest.xml from SystemUI-new.apk and copy AndroidManifest.xml and META-INF from SystemUI.apk to SystemUI-new.apk
That's it. Close the zip files.
If you have adb or android-sdk push SystemUI-new.apk to your phone using:
Code:
adb remount
adb push SystemUI-new.apk /system/app/SystemUI.apk
adb reboot
If you don't have adb, just copy over SystemUI-new.apk to your phone. Rename it to SystemUI.apk and copy to system/app with root explorer. Reboot.
There you have transparent statusbar now! ​
2. android.policy.jar
Decompile android.policy.jar with:
Code:
apktool d android.policy.jar
You will find android.policy.jar.out, open it and use Cristiano Matos guide to mod the files: http://forum.xda-developers.com/showthread.php?t=2018633
After that use:
Code:
apktool b android.policy.jar.out
Open the android.policy.jar.out folder, you will find a dist folder created and inside that is your modified android.policy.jar.
You can use adb again by:
Code:
adb push android.policy.jar /system/framework
or the normal root explorer method. ​
3. framework-res.apk
Here i'll show you small mods.
Decompile it using
Code:
apktool d framework-res.apk
Navigate to res/values/bools.xml. ​Here you can add these. Thanks to DSA for this! :
4 Way Rotation:
Code:
Code:
<bool name="config_allowAllRotations">false</bool>
Change to:
Code:
Code:
<bool name="config_allowAllRotations">true</bool>
Lock Screen Rotation:
Code:
Code:
<bool name="config_enableLockScreenRotation">false</bool>
Change to:
Code:
Code:
<bool name="config_enableLockScreenRotation">true</bool>
and
Code:
Code:
<bool name="lockscreen_isPortrait">true</bool>
change to
Code:
Code:
<bool name="lockscreen_isPortrait">false</bool>
Disable Keyboard Switch In StatusBar When Typing
Code:
Code:
<bool name="show_ongoing_ime_switcher">true</bool>
Change to:
Code:
Code:
<bool name="show_ongoing_ime_switcher">false</bool>
Unplugging From USB doesn't Turn Screen On
Code:
Code:
<bool name="config_unplugTurnsOnScreen">true</bool>
Change to:
Code:
Code:
<bool name="config_unplugTurnsOnScreen">false</bool>[/indent]
Now to change wallpaper. Change the default_wallpaper.jpg in drawable-xhdpi and to change lockscreen wallpaper change keyguard_default_wallpaper.jpg.
Now recompile using:
Code:
apktool b framework-res framework-new.apk
Delete AndroidManifest.xml from framework-new. Copy AndroidManifest.xml and META-INF from framework-res.apk to framework-new.apk
To test use adb:
Code:
adb push framework-new.apk /system/framework/framework-res.apk
Or rename to framework-res.apk and copy to system/framework using root explorer. Reboot.​
Once you've added everything, your modified apks. Ui_print mods, A custom kernel (just replace boot.img) it's time to compile. Now this is really easy. Just highlight all the folders/files like system, meta-inf and boot.img. Right click. Hover over 7-zip and click Add to Rom.zip. Wait for it to be done, and copy Rom.zip to your sd card and flash. Voila! You've made your rom!!​
You can get more mods to add from here: http://forum.xda-developers.com/showpost.php?p=26583654&postcount=4
I was a beginner once, everyone was a beginner once. People helped me, and now I want to help people.
Press the Thanks button, and/or rate this thread 5 stars to show your support. ​
FAQ
- How do i add a mod?
To add a mod, just download it. Open it and copy over all the folders from the zip file EXCEPT the META-INF.
- How can i set up apktool on windows?
To set up apktool on windows, you need aapt, apktool.jar and apktool.bat
- My modified apk is not working?
Do some testing and get to know what went wrong. I'm always here. I'll be glad to help.
- Are these the only apps i can modify?
Ofcourse not! Any apk can be modified. Just decompile it, and make your changes.
- I'm looking for a guide on something i want to learn. Can you add it here?
I'll try my best.​​​
Reserved
Reserved one more.
Any feedback guys? I hope this is useful.
Forget that i had to reserve one more.
R: [GUIDE] Beginners/Ref Guide to Making Roms.
Looks interesting...when i will finish my exam i will check with more attention
Sent from my GT-I9300 using xda app-developers app
Willy89 said:
Looks interesting...when i will finish my exam i will check with more attention
Sent from my GT-I9300 using xda app-developers app
Click to expand...
Click to collapse
Thanks. Glad it's of help.
Sent from my GT-I9300 using xda premium
Thnx for making this thread.
It's always useful to read thread's like this.
Nice job.
Verzonden door mijn GT-I9300 met xda premium
Great guide, thanks, I will point Theshawty in this direction :thumbup::thumbup:
slaphead20 said:
Great guide, thanks, I will point Theshawty in this direction :thumbup::thumbup:
Click to expand...
Click to collapse
Too late old man. Not interested in building roms anymore.
Thanks guys.
If there's anything you'd like to have added.
Let me know.
AW: [GUIDE] Beginners/Ref Guide to Making Roms.
Thanks. That's it what i searched for to start. Great.
weli..this would be intersting..and will c hw thread moves...
I Need Help In Building the ROM
Hi,
I am steinert. i need your help in biulding the rom, actually i finished everything but getting the problem while flashing the rom. when i googled it. i came to know that the problem lies in updater-script. i used root explorer to find out the reason. it was like.
FINISHED EXECUTING SCRIPT FILE
EXIT VALUE:126
STDOUT:
NULL
STDERR:
SH:<STDIN>[1]:/CACHE/RECOVERY/LAST_LOG:CAN'T EXECUTEERMISSION DENIED.
I Hope that You help a NOOB like me....
Thank you in advance....
Jacqueline Steinert said:
Hi,
I am steinert. i need your help in biulding the rom, actually i finished everything but getting the problem while flashing the rom. when i googled it. i came to know that the problem lies in updater-script. i used root explorer to find out the reason. it was like.
FINISHED EXECUTING SCRIPT FILE
EXIT VALUE:126
STDOUT:
NULL
STDERR:
SH:<STDIN>[1]:/CACHE/RECOVERY/LAST_LOG:CAN'T EXECUTEERMISSION DENIED.
I Hope that You help a NOOB like me....
Thank you in advance....
Click to expand...
Click to collapse
After flashing the rom.
Check the error through Advanced > Show recovery log in recovery.
Post results here.
I : checking for entendedcommand..
I : skipping execution of extendedcommand, file not found...
Jacqueline Steinert said:
I : checking for entendedcommand..
I : skipping execution of extendedcommand, file not found...
Click to expand...
Click to collapse
Huh?
Get me a screenshot of your meta-inf/com/google/android directory.
What exactly did you modify? It should work if you left the meta-inf untouched.
masterex567 said:
Huh?
Get me a screenshot of your meta-inf/com/google/android directory.
What exactly did you modify? It should work if you left the meta-inf untouched.
Click to expand...
Click to collapse
I just removed all the apps and inserted new apps...!!
Should i send you my updater-script?
Jacqueline Steinert said:
I just removed all the apps and inserted new apps...!!
Should i send you my updater-script?
Click to expand...
Click to collapse
Removed all?
Some are core apps like SystemUI, etc.
Get me a screenshot of your rom.zip..
masterex567 said:
Removed all?
Some are core apps like SystemUI, etc.
Get me a screenshot of your rom.zip..
Click to expand...
Click to collapse
{
"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"
}
This is the screenshot of my rom..! and before also i got the same problem with out changing the system .apk's
Jacqueline Steinert said:
View attachment 1700664
This is the screenshot of my rom..! and before also i got the same problem with out changing the system .apk's
Click to expand...
Click to collapse
Highlight those 3 and in 7zip options click add to " ".zip
Sent from my GT-I9300 using xda premium

[TOOL][WINDOWS] Android Multitool

Android Multitool
Hello,
I´m glad to present my Android Multitool wich makes it easier to decompile/recompile applications + jar framework files. You can also sign your apk by easily clicking a button.
Requirements:
Winows OS XP / 7 / 8 / 8.1 / 10
Installed Java on Windows
Installed Microsoft Powerpacks
Installed .NET framework
- Easy handling: Select your apk and push the "decompile" button!
- This tool makes modding much faster and easier, no cmd handling any more.
- You can read the log which is integrated in the tool to find your mistake in the error.
- ADB inside: Push files into your file system with a few clicks
It looks like this so far:
{
"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"
}
How to use this tool?
Follow this small how to!
Here you go..
Well, first extract the AndroidMultitool folder to C:\. Otherwise it probably won´t work
-copy your framework-res.apk in the Framework-Files folder and other files you want to mod in the "Files" folder (this folder is for all your files you want to mod, don't pick files from any other location)
-Next you have to start AndroidMultitool.exe
-select your framework-res.apk and push the "install" button (check log for errors)
Decompiling and recompiling apk files:
-select the apk you want to mod/decompile and push the "decompile" button (check log for errors)
Note: You can check the "use baksmali" checkbox, then e.g. the useless .line text will be removed
-your decompiled apk will be located in C:\AndroidMultitool\Decompiled_apk"apkname" as a folder
-if you want to compile your apk again, select your decompiled folder, check the "apk" radio button and compile it again (check log for errors)
-your recompiled apk will be located in C:\AndroidMultitool\Compiled_apk"apkname"
Decompiling and recompiling jar files:
-select in the combobox ".jar" (check the "use baksmali" checkbox for deleting the useless .line comments)
-select the ".jar" file you want to mod
-push the "decompile" button
-your decompiled jar file will be locaten in C:\AndroidMultitool\Decompiled_jar"jarname"
-for recompiling you have to check the "jar" radiobutton and select the folder within your decompiled ".jar" file
-push the compile button
-your compiled jar file will be located in C:\AndroidMultitool\Compiled_jar"jarname"\classes.dex
-delete the "classes.dex" file in your ".jar" file
-copy the new "classes.dex" file you compiled in the ".jar" file
Signing apk files:
-select the ".apk" you want to sign
-push the "sign" button
-the signed apk file is located in C:\AndroidMultitool\Signed_apk"apkname_signed"
Using tags:
You want to decompile many files from different devices or different android versions / frameworks? Tagging makes it possible!
- before installing your framework type in any tag (like "hero")
- then install your framework and work normally
Android Debug Bridge
You want to push files with adb to your device? Follow these instructions:
Please klick on the "advanced" register in the tool
-push "check" to control if your device is ready
-if the device is not ready please follow the instructions, which are listed in the tool (device offline, no device...)
-if the device is ready, choose a file you want to push
-choose a path on the device, where the file should be placed later
-push the "push" Button
-alternately: press "Reboot device" to reboot your device and to let changes take effect
If there are any questions or bugs, please post them in the thread.
Follow me on Google+ : Daniel Huber
[DOWNLOAD] see next post #2
Enjoy easier apk handling!
Having issues with the program?
Try the batch version developed by @bovirus (it's also in the AndroidMultitool folder)
Questions and answers:
Q: The programm does not start, it crashes.
A: Please install Powerpacks, this one: http://go.microsoft.com/fwlink/?LinkID=145727&clcid=0x804
Q: What do you mean exactly with "!!!NOTE!!! After compiling you have to copy the AndroidManifest.xml and the META-INF folder from your old apk to your newly compiled one!! Otherwise you´ll get bootloop! " .. I don't understand.
A: You have to open your old apk (this one you selected for decompiling in the folder /files) and copy from that apk the AndroidManifest.xml and the META-INF folder to the apk you just decompiled and recompiled.
Q: I followed all steps in the startpost but I'm still getting this error: "apktool is not recognized as internal or external command"
What can I do?
A: Please refer to this post by @LasVegasRomeo: http://forum.xda-developers.com/showpost.php?p=51017662&postcount=681
Credits:
Developers (brut.all, iBotPeaches) of the base Apktool
mike_galaxy_s for his help on testing
@bovirus for batch development
------------------------------------------------------
Changelog:
v3.5.9:
updated build tools and platform-tools (aapt, adb and needed dll's)
updated 7za, apktool, smali and baksmali to latest version
added bovirus's batch version to the main directory (users can choose between gui and batch now)
added a folder (Framework-Files) for the framework-res.apk (only use this folder for the framework files from now on)
added a Help folder with all commands
v3.5.8:
updated build tools and platform-tools (aapt, adb and needed dll's)
updated apktool, smali and baksmali to latest version
v3.5.7:
updated build tools and platform-tools (aapt, adb and needed dll's)
updated apktool, smali and baksmali to latest version
v3.5.6:
fix progressbar not disappearing after decompiling
fix loop after/while compiling
save compiling path and jump into it when he starts folder browsing
update user interface
v3.5.5:
fix infinite loop on compiling when errors appeared
folderbrowserdialog (compiling): jump into /decompiled_apk default
update build tools and platform-tools (aapt, adb and needed dll's)
v3.5.4:
add option to copy AndroidManifest.xml automatically into the apk after compiling
layout cleanup
force overwrite already compiled or decompiled files when new compiling/decompiling thread started
update to apktool rc3 (mainly lollipop support)
v3.5.3:
copy AndroidManifest.xml and META-INF folder automatically into the apk after compiling
added some links
code cleanup
v3.5.2:
add more detailed log
fix decompiling/compiling/signing/installing framework multiple times sometimes
add batch decompiling (preview)
fix donation image not fitting center
add txt files with descriptions for all tools inside (thanks to @bovirus)
v3.5.1:
update all files
v3.5:
code rework
fix UI freezing on long tasks
add progress bar
many other small fixes
v3.4:
access files from all locations of the pc (you're not limeted to the /Files folder)
add version number to the tool
v3.3:
add tag support (tagging allows multiple framework support)
rework interface
small additions and fixes
support for Win7 / 8 / 8.1 (no extra versions)
v3.2.1:
add apktool b9
v3.2:
add different apktool, aapt and batch files
should solve some problems on de - and recompiling
v3.1:
Fixes for adb push
button to reboot device
many other fixes and code rework
v3.0:
SlimBean apktool ((de)compiling also with inverted folders from trds)
ADB (AndroidDebugBridge for pushing files to your device)
Some Links in the tool for support and donation
v2.2 Beta1:
apktool 2.0.0
Details:
Details
v1.5.x -> v2.0.0
Java JRE 1.7 is required!
Update apktool to v2.0.0
aapt is now included inside the apktool binary. Its not required to maintain your own aapt install under $PATH. (However, features like -a / --aapt are still used and can override the internal aapt).
Remove framework $HOME/apktool/framework/1.apk or manually update via (FrameworkFiles)
Eagle eye users will notice resources are now decoded before sources now. This is because we need to know the API version via the manifest for decoding the sources.
Parameter Changes
Smali/baksmali 2.0 are included. This is a big change from 1.4.2. Please read the smali updates here for more information.
-o / --output is now used for the output of apk/directory.
-t / --tag is required for tagging framework files
-advance / --advanced will launch advance parameters and information on the usage output.
-m / --match-original is a new feature for apk analysis. This retains the apk is nearly original format, but will make rebuild more than likely not work due to ignoring the changes that newer aapt requires.
After [d]ecode, there will be new folders (original / unknown) in the decoded apk folder.
original/ = META-INF folder / AndroidManifest.xml, which are needed to retain the signature of APKs to prevent resigning. Used with -c / --copy-original on uild.
unknown/ = Files / folders that are not part of the standard AOSP build procedure. These files will be injected back into the rebuilt APK.
apktool.yml collects more information than before
SdkInfo = Used to re-populate the sdk information in AndroidManifest.xml since aapt requires it to be passed at runtime.
packageInfo = Used to help support Android 4.2 due to renamed manifest packages. Automatically detects difference between manifest and resources and performs automatic --rename-manifest-package on uild.
versionInfo = Used to re-populate the version information in the AndroidManifest.xml since aapt requires it to be passed at runtime.
compressionType = Used to determine the compression that resources.arsc had on the original apk to duplicate on uild.
unknownFiles = Used to record the name/location/compression type of non-standard files in Apk.
v2.1:
fixed freezes
bigger UI for better overview
option to save log to a text file
other small fixes
v2.0:
complete code rework
folder structure for a better overview
decompiled, recompiled, signed files will be located in their own folder
no more messy file handling
added radio buttons for choosing jar or apk
some graphical changes
added info button in the "installing framework" section
V1.2:
Added ability to decompile and recompile ".jar" files
Added baksmali
FolderBrowserDialog: If you push the "browse" button you are in the right directory now and needn't to scroll and search the "AndroidApktool" folder
other small fixes
V1.1:
Added ability to sign .apk
Changed comboboxes to browse buttons
bigger log - screen
Initial Release
- Latest mod version
Latest version is: 3.5.9 (23.10.2018) updated by bovirus
This version is based on original v. 3.5.9 by Flextrick plus with these updates
- apktool (by iBotPeaches) v. 2.3.4 stable
- apktool commands list
- baksmali/smali (by JesusFreke) v. 2.2.5 stable
- baksmali/smali command list
- Android Build Tools (by Google) v. 28.0.3 stable
- Android Build Tools commands list
- Android Platform Tools (by Google) v. 28.0.1 stable
- Android Platform Tools commands list
- 7zip (by Igor Pavlov) v. 18.05
- DOS batch updated (now support file names with spaces)
With the DOS batch (file AMT.BAT) you can
- install framework file
- select application
- decompile application
- compile application
- sign application
Android Multitool v. 3.5.9 (updated) - Download
- Android Multitool previous version
Library of previous version (Google Drive)
Note: Please take care that v. 3.5.9 (stock) included in the Google Drive repository DON'T include all updates reported before.
- Use always updated framework-res.apk
If you get error during decompilation/compilation of the apk, please check if you are using and updated version of framework.res.apk.
Please try to search, find and download an updated version of framework.-res.apk
Note: I suggest to rename the framework downloaded file name (without spaces) adding some info about it (like brand-model of device and Android version), like
framework-Samsung-S8-Android-7.1.2.apk
put the file in it in Framework-Files sub-folder of Android Multitool and install it in Android Multitool.
Then try again to decompile/recompile the application.
- External references
- apktool by iBotpeaches
apktool by iBotPeaches - XDA thread
apktool by iBotPeaches - XDA thread
- baksmali/smaly by JesusFreke
baksmali/smaly by JesusFreke - Download (bitbucket.org)
baksmali/smaly - XDA discussion thread
baksmali/smaly by JesusFreke - Source (Github)
- 7zip by Igor Pavlov
7zip by Igor Pavlov - Tool to decompress/compress files
- Android Platform Tools by Google
Android Platform Tools by Google - latest Windows version
..
Very nice tool!
One feature request, could you have a checkbox for say the -b command so that we can get rid of the useless .linexx and .prologue lines? That would make this tool perfect
Another feature is adding the twframework-res.apk as a framework file? Thats essential for modding samsung system apk's. I usually have to install both twframework-res.apk and framework-res.apk before decompiling. Maybe adding 2 slots for the framework in the tool?
Thanks again!!
Good work bro....
Very nice..
Sent from my GT-S6312 using xda app-developers app
clark44 said:
Very nice tool!
One feature request, could you have a checkbox for say the -b command so that we can get rid of the useless .linexx and .parameterxx lines? That would make this tool perfect
Another feature is adding the twframework-res.apk as a framework file? Thats essential for modding samsung system apk's. I usually have to install both twframework-res.apk and framework-res.apk before decompiling. Maybe adding 2 slots for the framework in the tool?
Thanks again!!
Click to expand...
Click to collapse
Sure, adding a second slot will be no problem!
But I don't know what you mean with this checkbox, could you explain me exactly what you mean?
~ via Nexus
Flextrick said:
Sure, adding a second slot will be no problem!
But I don't know what you mean with this checkbox, could you explain me exactly what you mean?
~ via Nexus
Click to expand...
Click to collapse
When I decompile using baksmali this is the command I run...
Code:
java -jar baksmali.jar -b -o c:/smali c:/smali/classes.dex
The -b command prompts baksmali to remove all .line type code from the smali.
Here is an example .smali file before and after the -b command...
BEFORE: http://pastebin.com/gYKQ90cW
AFTER: http://pastebin.com/17i8k1X2
This method of decompiling smali makes it much much simpler to compare to other code.
Thanks!! :highfive:
Ah, I'm understanding. Yes, I think that's possible as well!
~ via Nexus
Flextrick said:
Ah, I'm understanding. Yes, I think that's possible as well!
~ via Nexus
Click to expand...
Click to collapse
Cool. Cant wait
One more thing, will you be adding the ability to decompile more then one apk/jar?
At once? Would work, I think.
Two possibilities:
The first apk decompiles, and then the second one
Or: Both are decompiling at the same time, but in two different processes.
~ via Nexus
Flextrick said:
At once? Would work, I think.
Two possibilities:
The first apk decompiles, and then the second one
Or: Both are decompiling at the same time, but in two different processes.
~ via Nexus
Click to expand...
Click to collapse
One then the second and so on would save the most memory and prevent crashes on weaker machines
androidapktool.exe does not open on my win 7 32 bin in admin mode.... i have java 7u25 installed.
need java 6?
Flextrick said:
ANDROID APKTOOL
exe crashed on my PC
Win 7 x64, Java 7 w/ update 21 (64-bit) installed.
(AMD FX-8120, 16Gb ram)
Just try with java 6
Click to expand...
Click to collapse
fvadym said:
Flextrick said:
ANDROID APKTOOL
exe crashed on my PC
Win 7 x64, Java 7 w/ update 21 (64-bit) installed.
(AMD FX-8120, 16Gb ram)
Just try with java 6
Click to expand...
Click to collapse
AndroidApktool.exe won't start, neither with 6u45 nor with 7u25 (latest versions)
whats wrong... ?
i have copied framework-res.apk into C:\AndroidApktool from my samsung galaxy s3 i9300, FW XXEMD3 / 4.1.2 jelly bean.
i tried to run it as normal and as an adminstrator... nothing happened at all.
Click to expand...
Click to collapse
yeah not running on windows 8 either
is there something we have to install, too?
Hello, there can be a lot of things.
Maybe you are missing the .NET framework, or some dll´s.
I also uploaded a new .exe just for testing. New is the progressbar.
Download: http://www.mediafire.com/?6y7qi0x8h9q6pt7
Cheers
Flextrick said:
Hello, there can be a lot of things.
Maybe you are missing the .NET framework, or some dll´s.
I also uploaded a new .exe just for testing. New is the progressbar.
Download: http://www.mediafire.com/?6y7qi0x8h9q6pt7
Cheers
Click to expand...
Click to collapse
Test new .exe......
best regards "D"
Could anybody test trying to install .NET Framework?
Hopefully I get a solution for this problem, otherwise I'll make an Installer.
~ via Nexus
@Flextrick
I have NET Framework 4.5, Java 7 Update 25 and Java SE Development Kit 7 Update 25.
Edit:
You've got a Private Message
"D"
Ok. For starting the Tool is no Java necessary.
I think the dll's are missing, hopefully I get it working as far as possible.
~ via Nexus

Multi-Windows for all app EMUI 3.1 Honor 6 tested on developer edition rooted

Multi-Windows for all app EMUI 3.1 Honor 6 - tested on developer edition rooted device
Prerequisites
- Rooted device
- Root Explorer
- File "multiwindow_whitelist_apps.xml" modified by me with notepad++
http://www.mediafire.com/download/pj3a0agqrpgkb7m/multiwindow_whitelist_apps.xml
1 - Go to settings/Multitask windows and disable it
2 - Copy the file multiwindow_whitelist_apps.xml in the SD
3 - With Root Explorer copy the file multiwindow_whitelist_apps.xml in data/cust/xml and set permissions chmod 644
https://dl.dropboxusercontent.com/u/10992526/FontTutePics/screenshot(2).jpg
4 - Go to settings/manage app and search HwDualWindowLauncher, clean cache, clean data and reboot
5 - Go to settings/Multitask windows and activate it.
How to add other apps in multiwindow_whitelist_apps.xml
Download Notepad++ and install it
https://notepad-plus-plus.org/
Open Right and select "Edit with Notepad++"
Add this line and replace example: "com.android.vending" with the name of the app you want to open in the Multi-Window
<mw_app package_name="com.android.vending" default_visibility="1"/>
The name of the app you want to add is located in /data/app and matches the folder name
Now you can have all the apps you want in multi-window
{
"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"
}
You were quicker than me as I meant to create such a thread myself
Anyways it isn't all that new, I mean there already is a year old thread on xda, albeit on a different device section. What I wanted to do was to code up a little tool which would poll the package manager to retrieve all the installed packages and then generate the whitelist xml file so you don't have to edit the file manually.
To add to what you have already posted, I've found it's not necessary to disable the package and re-enable it after reboot. It's also possible to make chosen apps invisible in the dual window launcher but still support the feature (activated by holding the multi tasking button or swiping two fingers from the bottom of the screen while you are in the app).
Lastly, I should warn you guys not to add the Huawei launcher to your whitelist as that results in a pretty much buggy behavior (com.huawei.android.launcher).
micechal said:
You were quicker than me as I meant to create such a thread myself
Anyways it isn't all that new, I mean there already is a year old thread on xda, albeit on a different device section. What I wanted to do was to code up a little tool which would poll the package manager to retrieve all the installed packages and then generate the whitelist xml file so you don't have to edit the file manually.
To add to what you have already posted, I've found it's not necessary to disable the package and re-enable it after reboot. It's also possible to make chosen apps invisible in the dual window launcher but still support the feature (activated by holding the multi tasking button or swiping two fingers from the bottom of the screen while you are in the app).
Lastly, I should warn you guys not to add the Huawei launcher to your whitelist as that results in a pretty much buggy behavior (com.huawei.android.launcher).
Click to expand...
Click to collapse
I know file multi window_whitelist_apps.xml since it was introduced this feature on 6 Honor, I never modified before because changes frequently ROM like CM11, MIUI 7 or official fimware EMUI. Now I'm using for quite some time developer edition and after making a backup with TWRP i decided to try.
I do not think anyone has the exclusive right to edit the file multiwindow_whitelist_apps.xml
The thread that you are referring uses a different procedure from mine, do not use Notepad ++ to add line code in xml
This guide is infallible even for the most stupid man
Create a tool to write directly to the XML file would be useful but that way you still have to manually write the name of each app
The ideal would be to build an app that selects the other apps and updates directly the XML file, but I think it would be too much work, I think you just put in the xml file only the most used apps.
Regarding the bug Huawei Launcher I had no way to test it because I use Nova Launcher
Just a quick and dirty script I've made:
Code:
import xml.etree.ElementTree as ET
from subprocess import check_output
o = check_output("pm list packages",executable="/system/bin/sh",shell=True)
pkgs = [line[8:] for line in o.splitlines()]
whitelist = ET.Element("multiwindow_whitelist")
for pkg in pkgs:
if pkg == "com.huawei.android.launcher":
continue
mw_app = ET.SubElement(whitelist, "mw_app")
mw_app.set("package_name", pkg)
mw_app.set("default_visibility", "1")
with open("/sdcard/multiwindow_whitelist_apps.xml", "w") as f:
ET.ElementTree(whitelist).write(f, encoding='utf-8', xml_declaration=True)
It will create a whitelist file with all your installed packages ("apps") in "/sdcard/multiwindow_whitelist_apps.xml". After that, you just have to copy the file to "/cust/unicomelectric/cn/xml", clear the application data and reboot.
One way to run this on your phone is by using the QPython application from the Play Store.
Thanks for the nice instructions work like a charm!:good::good::good:
And how about honor 6 emui 4? help more detail
panamera2011 said:
The name of the app you want to add is located in /data/app and matches the folder name
Click to expand...
Click to collapse
Not all of the apps I have installed on my Honor is present in this folder. Can I make them also usable in multi-window mode, and where I can find their names if it's possible?
doctorat said:
Not all of the apps I have installed on my Honor is present in this folder. Can I make them also usable in multi-window mode, and where I can find their names if it's possible?
Click to expand...
Click to collapse
All apps user are located in data / app. Copy the name of the folder that contains the app and write the name of the folder in Multiwindow_withelist_apps.xml file with Notepad ++
Example: to add amazon shop app, write the folder name:
com.amazon.mShop.android.shopping-1
H60-L02 using Tapatalk
panamera2011 said:
Multi-Windows for all app EMUI 3.1 Honor 6 - tested on developer edition rooted device
Prerequisites
- Rooted device
- Root Explorer
- File "multiwindow_whitelist_apps.xml" modified by me with notepad++
http://www.mediafire.com/download/pj3a0agqrpgkb7m/multiwindow_whitelist_apps.xml
1 - Go to settings/Multitask windows and disable it
2 - Copy the file multiwindow_whitelist_apps.xml in the SD
3 - With Root Explorer copy the file multiwindow_whitelist_apps.xml in data/cust/xml and set permissions chmod 644
https://dl.dropboxusercontent.com/u/10992526/FontTutePics/screenshot(2).jpg
4 - Go to settings/manage app and search HwDualWindowLauncher, clean cache, clean data and reboot
5 - Go to settings/Multitask windows and activate it.
How to add other apps in multiwindow_whitelist_apps.xml
Download Notepad++ and install it
https://notepad-plus-plus.org/
Open Right and select "Edit with Notepad++"
Add this line and replace example: "com.android.vending" with the name of the app you want to open in the Multi-Window
<mw_app package_name="com.android.vending" default_visibility="1"/>
The name of the app you want to add is located in /data/app and matches the folder name
Now you can have all the apps you want in multi-window
Click to expand...
Click to collapse
no such file in mentioned directory on EMUI 4.0 for Huawei 5x..
fazorni said:
no such file in mentioned directory on EMUI 4.0 for Huawei 5x..
Click to expand...
Click to collapse
Copy it to the date/cust/xml folder and try if it works, if it does not work nothing happens, you can delete without problems
Or try it in the folder cust/xml
panamera2011 said:
Copy it to the date/cust/xml folder and try if it works, if it does not work nothing happens, you can delete without problems
Or try it in the folder cust/xml
Click to expand...
Click to collapse
Done, it says "this app is not supported by dual windows" for every app even those which worked before
@panamera2011
Thanks for teaching us that!
tested on my H06-L12 rom B807 with root.
worked perfect!
micechal said:
Just a quick and dirty script I've made:
Code:
import xml.etree.ElementTree as ET
from subprocess import check_output
o = check_output("pm list packages",executable="/system/bin/sh",shell=True)
pkgs = [line[8:] for line in o.splitlines()]
whitelist = ET.Element("multiwindow_whitelist")
for pkg in pkgs:
if pkg == "com.huawei.android.launcher":
continue
mw_app = ET.SubElement(whitelist, "mw_app")
mw_app.set("package_name", pkg)
mw_app.set("default_visibility", "1")
with open("/sdcard/multiwindow_whitelist_apps.xml", "w") as f:
ET.ElementTree(whitelist).write(f, encoding='utf-8', xml_declaration=True)
It will create a whitelist file with all your installed packages ("apps") in "/sdcard/multiwindow_whitelist_apps.xml". After that, you just have to copy the file to "/cust/unicomelectric/cn/xml", clear the application data and reboot.
One way to run this on your phone is by using the QPython application from the Play Store.
Click to expand...
Click to collapse
Great script!
just a question, can I run this via BusyBox?
SM26 said:
@panamera2011
Thanks for teaching us that!
tested on my H06-L12 rom B807 with root.
worked perfect!
Great script!
just a question, can I run this via BusyBox?
Click to expand...
Click to collapse
It is an integrated script EMUI, I just added more app, busybox has nothing to do [emoji3]
H791 using Tapatalk
panamera2011 said:
It is an integrated script EMUI, I just added more app, busybox has nothing to do [emoji3]
H791 using Tapatalk
Click to expand...
Click to collapse
sorry but I don't fully understand you.
to make an app work with multi-window, you have to add her to the white-list xml.
you can add manually (like you said in the OP)
or I can use @micechal script.
to run his script, I used QPython, and it worked perfectly.
but BusyBox also has an option to run scripts.
I'm asking if this script can be executed by BusyBox instead of QPython.
SM26 said:
sorry but I don't fully understand you.
to make an app work with multi-window, you have to add her to the white-list xml.
you can add manually (like you said in the OP)
or I can use @micechal script.
to run his script, I used QPython, and it worked perfectly.
but BusyBox also has an option to run scripts.
I'm asking if this script can be executed by BusyBox instead of QPython.
Click to expand...
Click to collapse
I have modified xml file with Notepad ++, not used QPython
H791 using Tapatalk
SM26 said:
sorry but I don't fully understand you.
to make an app work with multi-window, you have to add her to the white-list xml.
you can add manually (like you said in the OP)
or I can use @micechal script.
to run his script, I used QPython, and it worked perfectly.
but BusyBox also has an option to run scripts.
I'm asking if this script can be executed by BusyBox instead of QPython.
Click to expand...
Click to collapse
I have modified xml file with Notepad ++, not used QPython
H791 using Tapatalk
SM26 said:
I'm asking if this script can be executed by BusyBox instead of QPython.
Click to expand...
Click to collapse
I don't use BusyBox, so I can't really answer your question properly, but if it lets you run any Python code/script then it should just work.
Personally I use Termux right now and I can recommend using it if for some reason QPython doesn't suit you. To install python in Termux, you'd basically have to run these two commands:
Code:
apt update
apt install python2
then execute any python scripts with
Code:
python2 /path/to/script.py
micechal said:
I don't use BusyBox, so I can't really answer your question properly, but if it lets you run any Python code/script then it should just work.
Personally I use Termux right now and I can recommend using it if for some reason QPython doesn't suit you. To install python in Termux, you'd basically have to run these two commands:
Code:
apt update
apt install python2
then execute any python scripts with
Code:
python2 /path/to/script.py
Click to expand...
Click to collapse
QPython works fine.
I just wanted to save an app.
BusyBox can run .sh files, and this is a .py code.
(I don't know .sh code syntax)
fun fact, BusyBox can edit and save .Py files, but can't execute them!
or at least I can't make him do that.
How to achieve this in EMUI 4.0.1

Categories

Resources