Theming mediatek-res.apk - Android Themes

I have been interested in theming an MTK 6592 mediatek phone (Infinix Hot Note x551) I have owned for quite a while. Its currently running Stock Android 5.1 Lollipop.
I reached a point where I needed to decompile and recompile the mediatek-res.apk framework resource app.
I was using apktool version 2.1.1 and later on 2.2.0-a4270d-SNAPSHOT
I wanted to get rid of this notification item, every time you opened the Dialer, Contacts or Mms application. I found it annoying - asking every time to choose a default simcard, when I clearly wanted and is able to choose a line on calls, or outgoing SMSs.
Sorry, cant post image links yet!!
Click to expand...
Click to collapse
After a few weeks of on-of/trial and error research, I realized that these could be accomplished by editing the mediatek-res.apk located in /system/framework/mediatek-res.
It decompiled ok, but could not compile after editing(again, trial-error).
These were the compilation errors I was getting: A tonne of errors concerning all the resources and their Id's:
HTML:
W: /home/*****/Desktop/mtk/mediatek-res/res/layout/account_five.xml:6: error: Error: No resource found that matches the given name (at 'id' with value '@id/account_five_img').
I read up on this error and one post here on XDA (didnt save the link, sorry) and also over at github, said to edit the apktool.yml file and include the framework ID for the mediatek-res.apk (already installed via 'apktool if mediatek-res.apk'). Its framework ID was 8. So I added it.
HTML:
usesFramework:
ids:
- 1
to
HTML:
usesFramework:
ids:
- 1
- 8
On compilation, a ton of these new errors came up:
HTML:
W: /home/*****/Desktop/mtk/mediatek-res/res/values/styles.xml:3: error: Resource entry style/ImageSwitch is already defined in package com.mediatek.
Looked around furrther for quite sometime couldnt get a solution to this new errors. I continued on my trial and error ways and discovered that If edited the apktoo.yml file
HTML:
sharedLibrary: false
to
HTML:
sharedLibrary: true
and removed the mediatek-res framework ID from apktool.yml file, the errors were reduced to TWO!!
HTML:
W: /home/*****/Desktop/mtk/mediatek-res/res/values/public.xml:914: error: Public symbol ^attr-private/factor declared here is not defined.
HTML:
W: /home/*****/Desktop/mtk/mediatek-res/res/values/public.xml:915: error: Public symbol ^attr-private/scale declared here is not defined.
On investigating the error, I found out that indeed the two resources( ^attr-private/scale & ^attr-private/factor) were not defined in Ids.xml located in /res/values. I added the two to the bottom of the file,
HTML:
<item type="^attr-private" name="factor">false</item>
<item type="^attr-private" name="scale">false</item>
Also I renamed the file ^attr-privates.xml to ^attr-private.xml
On compilation, NO ERRORS!! and the app but pushed to system the phone ends up in endless bootloop.
I finally resolved the bootloop by replacing the resources.arsc in the compiled apk by the one from the original resources.arsc. They differ in size by a few kilobytes.
STEP BY STEP
1. Using APK Multi-Tools, use option
1. Extract APK
Click to expand...
Click to collapse
. Go to Projects folder and copy the resources.arsc file. This is the original file you shall place in the compiled app.
2. Compile as usual the modified mediatek-res app.
3. Go to '/Build/apk' folder and replace the resources.arsc therein with the one from setp 1.
4. Compile a second time.
5. Your apk will be able to boot and run ok now.
Because I am not very well versed with apktool and its inner workings, I don't know why this errors came up. I know this is a work-around, but for now it will have to do.
If this post saves you a few hours/days/weeks of research, hit thanks!!

Related

[Q] Creating an ADW Theme 317 errors woo!

So .. I'm trying to create an ADW theme.. I've been following the rules that was set by the creator in his theme template (http://github.com/AnderWeb/ADW.Theme-Template)
I keep getting compiler errors though which most of them similar to this:
error: Error: No resource found that matches the given name (at 'drawable' with value '@drawable/box_launcher_top_normal').
the error seems to make sense since there is no box_launcher_top_normal in drawable..
but there is a .png file with that name in drawable-hdpi or something.. I don't get why it keeps doing this anyone care to lend a noobie help? I'm using eclipse btw.
selfless bump:
I seem to fix the 317 errors but these are still bugging me:
error: No resource identifier found for attribute 'installLocation' in package 'android'
error: Error: No resource found that matches the given name (at 'label' with value '@string/theme_title')
and
Java Exception Breakpoints
Unknown
Unknown
The installLocation error is because you are not building the package against Android 2.2.
that's interesting.. i have to use the 2.2 one despite i just want to make it for my eclair phone D: ? mm.. how about the other ones
here's the manifest that's giving me trouble.. only thing i changed were the ones indicated to be changed which is package name and versions
http://github.com/AnderWeb/ADW.Theme-Template/blob/master/AndroidManifest.xml
darkamikaze said:
that's interesting.. i have to use the 2.2 one despite i just want to make it for my eclair phone D: ? mm.. how about the other ones
here's the manifest that's giving me trouble.. only thing i changed were the ones indicated to be changed which is package name and versions
http://github.com/AnderWeb/ADW.Theme-Template/blob/master/AndroidManifest.xml
Click to expand...
Click to collapse
Don't worry, it will work fine (At least the build against 2.2 part).
woo fixed the others.. now these are left:
this next error is the same except for the methods involved are getItem(int), getCount(), getItemId(int) and getView(int)
Description Resource Path Location Type
The method getItem(int) of type main.IconsAdapter must override a superclass method main.java /com.darkamikaze.monster.theme/src/com/darkamikaze/monster/theme line 76 Java Problem
these are some lines involved in the error in main.java
@Override
public int getCount() {
return mThumbs.size();
}
darkamikaze said:
woo fixed the others.. now these are left:
this next error is the same except for the methods involved are getItem(int), getCount(), getItemId(int) and getView(int)
Description Resource Path Location Type
The method getItem(int) of type main.IconsAdapter must override a superclass method main.java /com.darkamikaze.monster.theme/src/com/darkamikaze/monster/theme line 76 Java Problem
these are some lines involved in the error in main.java
@Override
public int getCount() {
return mThumbs.size();
}
Click to expand...
Click to collapse
Have you resolved this? I'm getting these errors :|

[GUIDE] T-mobile theme engine for the faint at heart (non-linux users)

Hi guys,
This is a guide I put together to make themes for the T-Mobile theme engine based mostly on what i've figured out by digging into haxzamatic's awesome template.
This does not require you to be on linux or whatever.
This is mainly a temporary guide till an Eclipse template for the engine is released, or for those who dont want to use eclipse, etc.
Requirements:
-You should know how to decompile/recompile/sign apk files.
-You should know some basic xml editing and theming.
-basic terminal commands
-You must install the framework for apktool, navigate to the folder containing framework-res.apk and execute -
apktool if framework-res.apk
GUIDE:
1. Get the compiled Templatebread from here: http://bit.ly/hdEWsf
2. Decompile it with apktool or whatever you use.
3. Open the AndroidManifest.xml
4. Change the names according to your theme. Here's my manifest for my NTSense theme:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<manifest android:hasCode="false" android:versionCode="2" android:versionName="1.1" android:installLocation="internalOnly" package="com.nhnt11.theme.ntsense"
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:pluto="http://www.w3.org/2001/pluto.html">
<uses-sdk android:minSdkVersion="9" android:targetSdkVersion="9" />
<application android:label="@string/theme_name" android:icon="@drawable/icon">
<activity android:label="@string/theme_name" android:name="com.tmobile.theme.Foo" />
</application>
<theme pluto:themeId="NTSense" pluto:styleId="@style/NTSense" pluto:name="@string/theme_name" pluto:preview="\@drawable/preview" pluto:author="@string/author" pluto:copyright="@string/copyright" pluto:wallpaperImage="@drawable/wallpaper" pluto:styleName="@string/style_appearance_name" pluto:ringtoneName="Standard" pluto:ringtoneFileName="media/audio/ringtones/Standard.mp3" pluto:notificationRingtoneName="Subtle" pluto:notificationRingtoneFileName="media/audio/notifications/Subtle.mp3" />
</manifest>
Note that the template xml file has "pluto:name="\@string/theme_name" - you need to remove this backslash, its a typo. it should be just "@string/theme_name" Should not be needed using latest version of apktool.
More detail about stuff in the manifest in 2nd post.
5. Open /res/values/strings.xml. Edit to match your theme. Here's mine again:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<resources>
<string name="app_name">NTSense Theme</string>
<string name="theme_name">NTSense</string>
<string name="style_appearance_name">NTSense</string>
<string name="author">nhnt11</string>
<string name="copyright">nhnt11</string>
</resources>
6. Same for /res/values/styles.xml
Code:
<?xml version="1.0" encoding="UTF-8"?>
<resources>
<style name="NTSense" parent="@android:style/Theme" />
</resources>
NOTE: the name of your style must be the same as the pluto:styleID in the manifest!!!
7. Now, if you are making a theme from scratch, go ahead and just edit the images already in the hdpi folder. compile and sign. done. But, read on anyway because i explain how the theme engine works below.
If you want to port a theme, here's what to do:
First, go ahead and delete all the drawable folders. Now, copy your THEMED drawable folders into the directory. You now have to add the following to your theme:
/res/drawable-_dpi/preview.png (prefarably hdpi I guess) (I suggest that you DO NOT remove the backslash in the manifest as different locations of preview.png do not work on different screen sized devices. RETAIN the backslash!! Your theme will not have a preview, but this is a small trade off to get themes working if you're not on linux.)
/res/drawable/wallpaper.png (this can be in drawable-_dpi for different screen res. too)
/res/drawable-_dpi/icon.png.
More detail on those in the second post.
8. Now go to /res/xml - there are a ton of xml's here. Open redirections.xml.
Here, there are entries for specifying which XML redirects which app. Add entries like so:
<package-redirections android:name="<app package name here>"
android:minSdkVersion="7"
android:resource="@xml/your_xml_file(without '.xml' at the end)" />
You have now specified that you want resources in <app> to be redirected based on what's in your_xml_file. Where and what is this your_xml_file and how do you add/modify it? That's what the rest of the xml's in the res/xml folder are.
The rest of these xmls are the heart of the theme engine. How they work is, when android asks for an image or other resource, they come in and switch that resource for your themed one. So its sort of like a proxy server.
Each xml contains the redirections for an app.
For example, redirections to framework-res.apk are in android.xml, and SystemUI is in com_android_systemui.xml
Delete files corresponding to apps you have not themed (for consistency, you might also want to delete the corresponding entry in redirections.xml. If you don't know how, just leave it). You can also add apps by using the convention, <package name>.xml where dots in the package name are separated by underscores, ie. your_package_name.xml for your.package.name
Package names of apps can be found in their respective AndroidManifest.xml's after decompiling. See 2nd post for more detail.
To redirect files, for eg. title_bar_portrait.9.png, just add the item to the systemui xml like so:
Code:
<item name="drawable/title_bar_portrait">@drawable/title_bar_portrait</item>
Note: To make it easy to add hundreds of drawables, I've written a little xml generator - here
Here, the "name" part tells the theme engine WHAT you're replacing.
the part inside the item tag ("@drawable/title_..... in this case") tells it WHAT to replace it with.
In all android packages, the @ sign means that you are referring to a resource in the package. Also, you can refer to a general system-wide resource by using @android:<whatever>
for example, you can replace the above title_bar_portrait with statusbar_background thats already in the android framework like so:
Code:
<item name="drawable/title_bar_portrait">@android:drawable/statusbar_background</item>
After the @ symbol, you have to specify the type of resource. in this case, "drawable".
Note that because the @ symbol refers to something INSIDE your package, you SHOULD NOT use it in the item name="<blablabla>" part.
See Variables in the second post for more detail.
Back to the xmls.
Pretty much all images are ALREADY entered in the xml. Just do a find and replace and get rid of all the "frameworks_res_" and "com_android_systemui_"
for eg, it already has <item name="drawable/title_bar_portrait">@drawable/com_android_systemui_title_bar_portrait</item>, so you need to get rid of the "com_android_systemui_" part.
Actually the professional/clean way to do it would be to rename all of your files to include "package_to_which_it_belongs_" at the front of the filename for better organisation. if you have the time and patience, do it this way!!!!
9. Delete the /res/values/public.xml. Its useless and annoying while compiling. It will be regenerated while compiling.
10. Try to compile the apk. you will probably get errors, because although all the resources are listed in the android.xml (or whatever) you deleted the HDPI folder so many might be missing! it will print what is missing when you compile though, so just go ahead and delete those lines.
11. you can also re-map styles, colors, drawables, etc.. for eg. battery percentage, add this to android.xml after putting the required battery xml in res/drawable:
<item name="drawable/stat_sys_battery">@drawable/stat_sys_battery</item>
also for a color, just add it to /res/values/colors.xml and then in android.xml, add
<item name="color/[name of color]">@color/[name of your color]</item>
See variables in the second post for more info.
12. Sign your compiled apk, and install it! If all goes well you will be able to apply and see the changes after you reboot.
Hope this helped!
More detail
Stuff in the Manifest
The manifest contains several general properties of your app file.
The following are a few which are referenced here.
To change the ringtone: Just put your desired ringtones/notification sound in /assets/media/audio/<Ringtones/Notifications> To prevent your theme from changing the ringtones, delete the corresponding lines from AndroidManifest.xml. I'm sure you can figure out which lines to delete. Also, you can remove the /assets folder, unless you have some other asset in it. (in which case just delete the ringtone buried inside as mentioned above)
Your theme's wallpaper is set to /res/drawable/wallpaper.png. Again, remove the required line from AndroidManifest.xml to make sure you dont mess up your users'wallpapers.
Your theme's theme chooser preview is set to /res/drawable/preview.png. (NEW - I suggest that you DO NOT remove the backslash from the manifest! (see first post))
The icon of your theme's apk file is set to /res/drawable-_dpi/icon.png. You should have an icon for at least one screen-size (preferably hdpi), but its nice to have it for all three.
Variables
This is to help those who don't have dev experience. In android packages, wherever you see an "@" symbol, the part following it will refer to a variable. A variable is basically a name given to refer to a resource for convenient use.
Here are a few types of variables you should know about (note that the explanations may not apply to the theme chooser, but are general):
1. drawable
2. color
3. style
4. string
5. dimen
1. Drawables - Drawbles are, well, drawable. These are resources which android can draw. That includes your theme images, wallpaper, preview, and also stuff like the battery percentage xml's, progress bar xml's etc.
1. Colors - Colors are colors!! Duh! LOL . Anyway, in /res/values/colors.xml you will find an editable list of colors. Say you use green a lot in your theme. Instead of typing "#ff00ff00" everywhere, you can simply define a color called "green" here, by adding the following line:
Code:
<color name="green">#ff00ff00</color>
Now, you can substitute "@color/green" wherever you want to use green.
3. Styles - these are a little advanced. They allow you to define a set of attributes and apply the entire set to different components.
Here's an example style:
Code:
<style name="mytext" parent="@android:style/TextAppearance.Small">
<item name="android:textColor">#ffff0000</item>
</style>
Let's break this down -
First of all, we're naming this style "mytext".
We're saying that its parent is "@android:style/TextAppearance.Small".
This means, that it automatically inherits ALL the properties of the android system style, "TextAppearance.Small" which can be found in the styles.xml in framework-res/res/values.
Now, we're adding an item with the android attribute, "textColor". There are many attributes to choose from, you can look in the attrs.xml in framework-res/res/values. (Note that an attribute may not be applicable to every situation)
Next we're giving the text color a value - in this case, red.
Now, this style can be applied anywhere to get red text in the normal system font size for small text.
Here's an example of how to use styles: post 88.
4. Strings - Strings let you make references to text. Maybe you have your theme name everywhere, and its really long. Maybe your theme name is "supercalifragilisticexpialidocious". Well, you dont want to type that every time. So you can add the following to /res/values/strings.xml:
Code:
<string name="myname">supercalifragilisticexpialidocious</string>
Now, wherever you want to use the word "supercalifragilisticexpialidocious", just substitute it with "@string/myname". And it will use whatever you defined for "myname" there.
5. Dimensions - These store values for sizes and so on. For example, its an easy way to remember a custom text size that you need a lot. Add the following to "/res/values/dimens.xml" (this does not exist by default)
Code:
<dimen name="mysize">33.4sp</dimen>
This will allow you to use the font size 33.4 by substituting "@dimen/mysize" wherever you want. For sizes in pixels, use "____.__dip" instead of "sp".
Comments
Comments are useful little dev tools. Comments basically let a developer (but they're useful to themers too) make comments in the code. Basically, the syntax of a comment (more on that in just a bit) tells the compiler to ignore that line(s). A side effect is that you can "comment" parts of your code - which means that you are marking it as a comment - which are not used (or not yet ready to be used), before compiling and releasing, while retaining the old code for future reference.
How to make a comment in xml files:
Simply surround the code you want to comment with "<!-- ......... -->.
The "<!--" part tells the compiler where a comment starts, and "-->" tells it where the comment ends.
More stuff will come here as I think of it.
I received many error:
ERROR: Failure processing PNG image C:\Users\ADMIN\.\templatebread\res\drawable-hdpi\frameworks_res_timepicker_input_selected.9.png
ERROR: 9-patch image C:\Users\ADMIN\.\templatebread\res\drawable-hdpi\frameworks_res_timepicker_up_disabled.9.png malformed.
No marked region found along edge.
Found along top edge.
ERROR: Failure processing PNG image C:\Users\ADMIN\.\templatebread\res\drawable-hdpi\frameworks_res_timepicker_up_disabled.9.png
ERROR: 9-patch image C:\Users\ADMIN\.\templatebread\res\drawable-hdpi\frameworks_res_timepicker_up_disabled_focused.9.png malformed.
Frame pixels must be either solid or transparent (not intermediate alphas).
Found at pixel #8 along top edge.
ERROR: Failure processing PNG image C:\Users\ADMIN\.\templatebread\res\drawable-hdpi\frameworks_res_timepicker_up_disabled_focused.9.png
ERROR: 9-patch image C:\Users\ADMIN\.\templatebread\res\drawable-hdpi\frameworks_res_timepicker_up_normal.9.png malformed.
No marked region found along edge.
Found along top edge.
ERROR: Failure processing PNG image C:\Users\ADMIN\.\templatebread\res\drawable-hdpi\frameworks_res_timepicker_up_normal.9.png
ERROR: 9-patch image C:\Users\ADMIN\.\templatebread\res\drawable-hdpi\frameworks_res_timepicker_up_pressed.9.png malformed.
No marked region found along edge.
Found along top edge.
ERROR: Failure processing PNG image C:\Users\ADMIN\.\templatebread\res\drawable-hdpi\frameworks_res_timepicker_up_pressed.9.png
ERROR: 9-patch image C:\Users\ADMIN\.\templatebread\res\drawable-hdpi\frameworks_res_timepicker_up_selected.9.png malformed.
No marked region found along edge.
Found along top edge.
ERROR: Failure processing PNG image C:\Users\ADMIN\.\templatebread\res\drawable-hdpi\frameworks_res_timepicker_up_selected.9.png
ERROR: 9-patch image C:\Users\ADMIN\.\templatebread\res\drawable-hdpi\frameworks_res_title_bar.9.png malformed.
Must have one-pixel frame that is either transparent or white.
ERROR: Failure processing PNG image C:\Users\ADMIN\.\templatebread\res\drawable-hdpi\frameworks_res_title_bar.9.png
ERROR: 9-patch image C:\Users\ADMIN\.\templatebread\res\drawable-land-hdpi\frameworks_res_title_bar.9.png malformed.
Must have one-pixel frame that is either transparent or white.
ERROR: Failure processing PNG image C:\Users\ADMIN\.\templatebread\res\drawable-land-hdpi\frameworks_res_title_bar.9.png
ERROR: 9-patch image C:\Users\ADMIN\.\templatebread\res\drawable-hdpi\frameworks_res_title_bar_medium.9.png malformed.
Must have one-pixel frame that is either transparent or white.
ERROR: Failure processing PNG image C:\Users\ADMIN\.\templatebread\res\drawable-hdpi\frameworks_res_title_bar_medium.9.png
ERROR: 9-patch image C:\Users\ADMIN\.\templatebread\res\drawable-land-hdpi\frameworks_res_title_bar_medium.9.png malformed.
Must have one-pixel frame that is either transparent or white.
ERROR: Failure processing PNG image C:\Users\ADMIN\.\templatebread\res\drawable-land-hdpi\frameworks_res_title_bar_medium.9.png
ERROR: 9-patch image C:\Users\ADMIN\.\templatebread\res\drawable-hdpi\frameworks_res_title_bar_portrait.9.png malformed.
Must have one-pixel frame that is either transparent or white.
ERROR: Failure processing PNG image C:\Users\ADMIN\.\templatebread\res\drawable-hdpi\frameworks_res_title_bar_portrait.9.png
ERROR: 9-patch image C:\Users\ADMIN\.\templatebread\res\drawable-hdpi\frameworks_res_title_bar_portrait_cust.9.png malformed.
Must have one-pixel frame that is either transparent or white.
ERROR: Failure processing PNG image C:\Users\ADMIN\.\templatebread\res\drawable-hdpi\frameworks_res_title_bar_portrait_cust.9.png
ERROR: 9-patch image C:\Users\ADMIN\.\templatebread\res\drawable-hdpi\frameworks_res_title_bar_shadow.9.png malformed.
Must have one-pixel frame that is either transparent or white.
ERROR: Failure processing PNG image C:\Users\ADMIN\.\templatebread\res\drawable-hdpi\frameworks_res_title_bar_shadow.9.png
ERROR: 9-patch image C:\Users\ADMIN\.\templatebread\res\drawable-hdpi\frameworks_res_title_bar_tall.9.png malformed.
Must have one-pixel frame that is either transparent or white.
ERROR: Failure processing PNG image C:\Users\ADMIN\.\templatebread\res\drawable-hdpi\frameworks_res_title_bar_tall.9.png
ERROR: 9-patch image C:\Users\ADMIN\.\templatebread\res\drawable-land-hdpi\frameworks_res_title_bar_tall.9.png malformed.
Must have one-pixel frame that is either transparent or white.
ERROR: Failure processing PNG image C:\Users\ADMIN\.\templatebread\res\drawable-land-hdpi\frameworks_res_title_bar_tall.9.png
ERROR: 9-patch image C:\Users\ADMIN\.\templatebread\res\drawable-hdpi\frameworks_res_toast_frame.9.png malformed.
No marked region found along edge.
Found along top edge.
ERROR: Failure processing PNG image C:\Users\ADMIN\.\templatebread\res\drawable-hdpi\frameworks_res_toast_frame.9.png
ERROR: 9-patch image C:\Users\ADMIN\.\templatebread\res\drawable-hdpi\frameworks_res_zoom_plate.9.png malformed.
No marked region found along edge.
Found along top edge.
Look up nine-patch pngs. Theres plenty of information about them. You didn't properly edit the nine-patch images (ending with .9.png)
Sent from my HTC Wildfire using XDA App
If i replaced some pngs with other my prefer pngs, then resigned, everything was OK. But if i wanted to add new pngs, i got that errors!
Strange... you shouldn't be getting nine-patch errors if you simply added some extra pngs. are you SURE you're doing it right?
Did you add the pngs from an already compiled framework or did you decompile them? or did you make them from scratch?
What OS are you using to build your theme apks? Are you using Windows?
No i'm on a hackintosh setup, why?
I'm limited to Windows, and the t-mo engine requires a special aapt, which has not been compiled for Windows to my knowledge.
Yeah, I heard about that. But I'm using the normal non-t-mobile aapt that came bundled with apktool, and it works fine for me.
Edit: AFAIK, you only need the T-mo aapt the first time you compile, after that decompiling and recompiling with apktool works. Correct me if I'm wrong please.
Gah! I've been led astray. I've been talking with one of the developers to ask for features, and learn more about the engine. I just didn't bother trying to build a theme, because of what I learned about the aapt change.
FYI to all t-mobile engine themers:
There are currently 2 "skinning" implementations on the table before Google. T-mo's current implementation is not the favored one. Currently, the t-mo team is working on a new engine that will hopefully make Google happy (or happier).
Sony-Ericson is developing the other concept, but it is not ready for inclusion into AOSP either. While they have Google's attention, their approach is currently focused on OEM skinning. (i.e. no root = no skinning)
Confirming, I just recompiled my theme in windows using apktool. It compiles and applies fine. This guide is valid for all OSes.
By the way, Just wanted to mention that like i said in the first post, this is sort of a temporary workaround for theming. Not in any way the best way to do it, but it's clean (at least, almost) and it works, and is, in my opinion, far more convenient than modifying and releasing and reflashing system files all the time.
nhnt11 said:
<snip> it works, and is, in my opinion, far more convenient than modifying and releasing and reflashing system files all the time.
Click to expand...
Click to collapse
I completely agree there.
I went looking into the CM source. I think an uber-genius avoided the need to the custom aapt. Sweet!
Now to have some fun...
BTW, I'm looking to put together something so "we" can share parts of themes (i.e. pack up UI changes, icon sets, mods, etc. in separate zips). Then people could mix and match to one's liking. (Based off the concepts from apk manager 4.9, ZipThemer, and my own special sauce.)
Cool! Looking forward to what you come up with. I was actually thinking kind of the same thing, like, making a base theme, and then being able to have add on packs to override only a few things in the theme like icons, etc.
Sent from my HTC Wildfire using XDA App
I'm after simple and straightforward.
You unpack the apk you want to theme/skin in directory <package name>, make your changes, then delete all the unchanged files. ZIP up one more more of these package trees, and distribute.
To build a theme/skin of your very own, download the ZIPs you like, combine (resolve 'conflicts'), package, and voila.
The BIG advantage of my approach will be that you won't have to do squat with file names! The program will take care of that for you.
Hmmm, that would work, pretty straightforward way to share resources between theme devs.
But what I think would be cool is if we could make packages for users to apply ON TOP of an already applied theme. That would obviously need to be implemented in the theme engine though.
Sent from my HTC Wildfire using XDA App
nhnt11 said:
Hmmm, that would work, pretty straightforward way to share resources between theme devs.
But what I think would be cool is if we could make packages for users to apply ON TOP of an already applied theme. That would obviously need to be implemented in the theme engine though.
Click to expand...
Click to collapse
http://code.google.com/p/cyanogenmod/issues/detail?id=2812
The reason I got in touch with the t-mo dev was so I could toss in my 2 cents. He liked the idea, but he is concerned that, for a simple user, it could be too complicated and/or confusing. Adding support for multiple APKs to ThemeManager would not be difficult. It is that Theme Chooser needs a user friendly UI that can handle multiple APKs and overlaps/conflicts. (I have in my minds eye what one could/would look like. I'm just not going to be the one writing it.)
It can't be that hard, as you said, or even complicated for a user. Two menus - one with full themes, one with addons (maybe a special flag in the package indicating what it is). All addons override everything in the theme with what they have. And you can order applied addons to prioritize which gets the final say. That's it. Not too confusing IMO.
Sent from my HTC Wildfire using XDA App
nhnt11 said:
It can't be that hard, as you said, or even complicated for a user. Two menus - one with full themes, one with addons (maybe a special flag in the package indicating what it is). All addons override everything in the theme with what they have. And you can order applied addons to prioritize which gets the final say. That's it. Not too confusing IMO.
Click to expand...
Click to collapse
I didn't think 2 listings are needed. Good naming and descriptions would be extremely helpful, but not actually required.
Just 1 multi-select "list" (could be like the current chooser with a check box added). Then an ordering screen only if an overlap is detected.
I get this error in apktool. There is more to it but I didnt include it because it was so long and just repeats of beginning only to different files.
C:\Program Files\Android\android-sdk-windows\tools\com.fyb3roptik.theme.androidi
an\res\drawable\zzz_btn_application_selector.xml:4: error: Error: No resource fo
und that matches the given name (at 'drawable' with value '@drawable/pressed_app
lication_background_static').
C:\Program Files\Android\android-sdk-windows\tools\com.fyb3roptik.theme.androidi
an\res\drawable\zzz_btn_application_selector.xml:5: error: Error: No resource fo
und that matches the given name (at 'drawable' with value '@drawable/focused_app
lication_background_static').
Exception in thread "main" brut.androlib.AndrolibException: brut.common.BrutExce
ption: could not exec command: [aapt, p, -F, C:\DOCUME~1\Nate\LOCALS~1\Temp\APKT
OOL2146181265913808293.tmp, -x, -I, C:\Documents and Settings\Nate\apktool\frame
work\1.apk, -S, C:\Program Files\Android\android-sdk-windows\tools\com.fyb3ropti
k.theme.androidian\res, -M, C:\Program Files\Android\android-sdk-windows\tools\c
om.fyb3roptik.theme.androidian\AndroidManifest.xml]
at brut.androlib.res.AndrolibResources.aaptPackage(Unknown Source)
at brut.androlib.Androlib.buildResourcesFull(Unknown Source)
at brut.androlib.Androlib.buildResources(Unknown Source)
at brut.androlib.Androlib.build(Unknown Source)
at brut.androlib.Androlib.build(Unknown Source)
at brut.apktool.Main.cmdBuild(Unknown Source)
at brut.apktool.Main.main(Unknown Source)
Caused by: brut.common.BrutException: could not exec command: [aapt, p, -F, C:\D
OCUME~1\Nate\LOCALS~1\Temp\APKTOOL2146181265913808293.tmp, -x, -I, C:\Documents
and Settings\Nate\apktool\framework\1.apk, -S, C:\Program Files\Android\android-
sdk-windows\tools\com.fyb3roptik.theme.androidian\res, -M, C:\Program Files\Andr
oid\android-sdk-windows\tools\com.fyb3roptik.theme.androidian\AndroidManifest.xm
l]
at brut.util.OS.exec(Unknown Source)
... 7 more
Can anyone help please? Thanks!

Assistance is NEEDED - Editing APK

I'm having the most difficult time editing apks. I've followed this tutorial: http://forum.xda-developers.com/showthread.php?t=1365810
and I can't even setup a simple middle clock centered mod or custom carrier logo. I decompile the systemUI settings after installing framework-res. I edit the xml EXACTLY how the tutorial says to. I have the png made and put it in /res/drawable-hdpi/
I recompile the systemUI and sign it, zipit, flash it - it flashes.
Now the following has happened to me, I either get stuck on a boot loop or I try the tutorial all over again without signing the apk, flash it, boots up fine but NO MODS HELP!!!!
i don't edit the center clock on some ROMs anymore b/c they come with an option to center it in the settings... if the ROM you are using has this option, following the directions in that thread might not work or mess something up!
-=NMV4G[03.15B]=- does not unfortunately have this feature, it does have the pm/am clock mods but not the color selector or center mod feature
read this guide first : http://forum.xda-developers.com/showpost.php?p=9126643#post9126643
i think your problem is in this part :
Rebuild the apk using the following command:
Code:
java -jar apktool.jar b framework-res out\framework-res.apk
This will create a new framework-res.apk in a subfolder out.
IMPORTANT: Do not push this apk to your phone unless you want to reflash
Extract the xml files and images from the newly generated apk (you can use the original images, but the xml files must be the newly compiled ones from the new apk). Add these files to the original framework-res.apk that you want to push to your phone (see the previous post).
Extract the resources.arsc from the root of the apk
Rename the original framework-res.apk from your theme to framework-res.zip
Right-click the extracted resources.arsc and choose the 7zip menu item ‘Add to archive’
In the dialog that appears set the achive field at the top to the framework-res.zip from step 7. And set the archive format to zip. Now set the Compression level to store and click OK(if you do not do this your phone will not boot). The settings are in the attached screenshot.
Rename framework-res.zip to framework-res.apk and double check that the compressed size or resources.arsc is the same as the original size (see screenshot)
Done. Push the new framework to your phone.
Click to expand...
Click to collapse
I tried the command you posted and it didnt work because it said it couldn't find the file specified: framework-res so I tried the command from the tutorial you (evilisto) posted, I got a framework-res folder that is empty, now I'm a bit confused, am I supposed to have xmls, in that folder or do I need to decompile the SystemUI.apk now?
ebs512 said:
I tried the command you posted and it didnt work because it said it couldn't find the file specified: framework-res so I tried the command from the tutorial you (evilisto) posted, I got a framework-res folder that is empty, now I'm a bit confused, am I supposed to have xmls, in that folder or do I need to decompile the SystemUI.apk now?
Click to expand...
Click to collapse
you have to use your folder name...
ok then here is simple guide about apk file modifying.
-------------------------------------------------------
1) decompile apk. for example...
Code:
java -jar apktool.jar d SystemUI.apk /(folder_name)
2) edit what you want.
3) recompile apk.
Code:
java -jar apktool.jar b /(folder_name) SystemUI.apk
4) copy what you modified from new SystemUI.apk to original SystemUI.apk
so if you changed something in /res/values, copy new resources.arsc to original SystemUI.apk. (using 7-zip or other program)
if you modified /res/layout or other resources files, copy those to original apk file too.
5) use modified original SystemUI.apk file.
-------------------------------------------------------
basically same to above guide that i quoted.
everytime I decompile the framework-res it puts a subdirectory out of framework-res with nothing in it, I decompile the systemui.apk and there is no res folder, just a bunch of smali code, even when I go back and try to install the framework-res before decompiling, I get:
W: Config size >32
W: Config size >32
W: Config size >32
W: Config size >32
W: Config size >32
W: Config size >32
Exception in thread "main" brut.androlib.AndrolibException: Multiple Resources
ebs512 said:
everytime I decompile the framework-res it puts a subdirectory out of framework-res with nothing in it, I decompile the systemui.apk and there is no res folder, just a bunch of smali code, even when I go back and try to install the framework-res before decompiling, I get:
W: Config size >32
W: Config size >32
W: Config size >32
W: Config size >32
W: Config size >32
W: Config size >32
Exception in thread "main" brut.androlib.AndrolibException: Multiple Resources
Click to expand...
Click to collapse
That's a bug with android 4.0.3. Use google, there is a bug report and an attached updated test apktool.jar for 4.0.3
Sent from my Nexus S 4G using xda premium

[Guide][Miui V5] How to Edit framework-miui-res.apk and Related Applications

Hi, it seems some dear users have problems with Miui V5 framework and miui's applications decompiling proccess.
let's begin!
for this job, Im editing the APK Multitool, and all credits will goes to his developer. [raziel23x]
original thread
what's new on this?
changed the aapt to miui compatible, added miui frameworks to default list, added additional frameworks, also you can pull back the files from the phone via adb command.
i wrote it before, original thread
-------------------------------------------------------------------------------------------------------------------------------------------------------------
for version 11.0.1.2 and older!
Download the Attached file.
extract it.
copy these files
Code:
framework-res.apk
framework-miui-res.apk
twframework-res.apk
MiuiSystemUI.apk
from Miui Rom into other folder.
run, Setup.bat script.
Select option 2:
Code:
*
* 2. Installing Framework-Res
* This Will install one of the Framwork-Res Files for 1.x/2.x/3.x/4.x
* This Feature also will install any of the other Dependencies needed
* In order to use this feature make sure to drop all of the needed files
* into the other Folder or else this script will not find them *
*
in next window, install these frameworks by entering related numbers. install it as this order and sequence
Code:
Install framework-res.apk
Install twframework-res.apk
Install Additional Frameworks
Install framework-miui-res.apk
Install MiuiSystemUI.apk
after installing, enter the "9" to get back to main screen.
run setup by entering "3".
Code:
3. Setup Directories
This will setup the appropate directories needed by Apk Multi-Tools
(This script only needs to be ran for first time users do not use if your
Just updating from previous Version
now new folders will create on main folder of this apk multi tool.
Framework's Description
- 1 = framework-res.apk
- 2 = twframework-res.apk
- 3 = additional frameworks
- 4 = additional frameworks
- 5 = additional frameworks
- 6 = framework-miui-res.apk
- 127 = SystemUI.apk​
Version 1.11.0.3 XIAOMI Phones.
1- Download Version 1.0.11.3 [[XIAOMI]MIUI_V5_APKMULTITOOL_1.0.11.3.zip] and extract it.
2- Copy MiuiSystemUI.apk, framework-res.apk and framework-miui-res.apk from your rom or phone into other folder.
3- Run Setup.bat file, choose option 2 and then select option 1 for automatically installing all frameworks.
or you can install frameworks manually
Code:
2. Install framework-res.apk
3. Install dummy frameworks
4. Install framework-miui-res.apk
4- from main menu, run option 3
Code:
3. Setup Directories
This will setup the appropate directories needed by Apk Multi-Tools
(This script only needs to be ran for first time users do not use if your
Just updating from previous Version)
best regards.
How to Edit framework-miui-res.apk?
copy framework-miui-res.apk into "place-apk-here-for-modding" folder, run "Script.bat" file.
choose your project , by entering the " 24 Set current project" [24].
the select your project with related number.
decompile apk.
Code:
9 Decompile apk
when the framework-miui-res.apk get decompiled, goto project folder and on the framework-miui-res.apk , open the "apktool.yml" file via notepadd++.
you will see like this one:
Code:
version: 1.5.2
apkFileName: framework-miui-res.apk
isFrameworkApk: true
usesFramework:
ids:
- 1
sdkInfo:
minSdkVersion: '16'
targetSdkVersion: '16'
packageInfo:
cur_package: miui
orig_package: miui
compressionType: true
add additional frameworks , just like below one
Code:
version: 1.5.2
apkFileName: framework-miui-res.apk
isFrameworkApk: true
usesFramework:
ids:
- 1
- 2
- 3
- 4
- 5
sdkInfo:
minSdkVersion: '16'
targetSdkVersion: '16'
packageInfo:
cur_package: miui
orig_package: miui
compressionType: true
save the file.
now go and edit this file, at final you can compile it.
for compile you can use "11 Compile System APK files" option.​
if you have any problem, please upload the "APK-Multi-Tool.log" file and tell your problem.
Changelog:
version 1.0.11.1 initial release
version 1.0.11.2 , fixed framework installing.
Version 1.0.11.3 , specially for XIAOMI phones and updated apktool to version 1.5.3 snapshot.
+ fixed and removed some scripts
+ all in one framework installer [ option 1]
+ added miui JB frameworks [ ID 2 ~ ID5]
​
M_J_Nazari said:
if you have any problem, please upload the "APK-Multi-Tool.log" file and tell your problem.
Click to expand...
Click to collapse
Thank you Nazari!
I dont know if this script is only meant to work with SGS III files...
I followed your instructions using MI-2 files (without twframework-res.apk of course).
And after de-compiling the apk I can't compile it back.
I'm getting:
error occurred, please check the log (option 21)
Click to expand...
Click to collapse
Btw I notice that inside the apktool.yml
I got
compressiontype: false
Click to expand...
Click to collapse
This is my log:
--------------------------------------------------------------------------
|Sun 06/02/2013 -- 17:55:49.16|
--------------------------------------------------------------------------
java version "1.7.0_21"
Java(TM) SE Runtime Environment (build 1.7.0_21-b11)
Java HotSpot(TM) Client VM (build 23.21-b01, mixed mode, sharing)
I: Loading resource table...
I: Loaded.
I: Decoding AndroidManifest.xml with resources...
I: Loading resource table from file: C:\Users\Sagi\apktool\framework\1.apk
I: Loaded.
I: Regular manifest package...
I: Decoding file-resources...
I: Decoding values */* XMLs...
I: Done.
I: Copying assets and libs...
W: Could not find sources
I: Checking whether resources has changed...
I: Building resources...
Exception in thread "main" brut.androlib.AndrolibException: brut.androlib.err.CantFindFrameworkResException
at brut.androlib.Androlib.buildResourcesFull(Androlib.java:358)
at brut.androlib.Androlib.buildResources(Androlib.java:283)
at brut.androlib.Androlib.build(Androlib.java:206)
at brut.androlib.Androlib.build(Androlib.java:176)
at brut.apktool.Main.cmdBuild(Main.java:228)
at brut.apktool.Main.main(Main.java:79)
Caused by: brut.androlib.err.CantFindFrameworkResException
at brut.androlib.res.AndrolibResources.getFrameworkApk(AndrolibResources.java:544)
at brut.androlib.Androlib.parseUsesFramework(Androlib.java:508)
at brut.androlib.Androlib.buildResourcesFull(Androlib.java:336)
... 5 more
Click to expand...
Click to collapse
I'm guessing it is because of the 'twframework-res.apk' which i dont have...(MI-2 not Samsung).
SagiMedina said:
Thank you Nazari!
I dont know if this script is only meant to work with SGS III files...
I followed your instructions using MI-2 files (without twframework-res.apk of course).
And after de-compiling the apk I can't compile it back.
I'm getting:
Btw I notice that inside the apktool.yml
I got
This is my log:
I'm guessing it is because of the 'twframework-res.apk' which i dont have...(MI-2 not Samsung).
Click to expand...
Click to collapse
W: Could not find sources
so, don't change the "apktool.yml" file and then compile it. see the result. maybe your phone doesn't boot!!
oh,,, i forget to add framework 5 to package, download it and copy to "C:\Users\Sagi\apktool\framework\" folder. i will update the package as soon.
or you can use new package, i added new description and new fixed version.
M_J_Nazari said:
W: Could not find sources
so, don't change the "apktool.yml" file and then compile it. see the result. maybe your phone doesn't boot!!
oh,,, i forget to add framework 5 to package, download it and copy to "C:\Users\Sagi\apktool\framework\" folder. i will update the package as soon.
or you can use new package, i added new description and new fixed version.
Click to expand...
Click to collapse
After I used the new package I succeed to compile it back but the phone doesn't boot.
In apktool.yml I add only
-1
-3
-4
-5
-2 and -6 gave me errors.
I noticed that the new apk size is smaller then the original.
Sent from my MI 2
SagiMedina said:
After I used the new package I succeed to compile it back but the phone doesn't boot.
In apktool.yml I add only
-1
-3
-4
-5
-2 and -6 gave me errors.
I noticed that the new apk size is smaller then the original.
Sent from my MI 2
Click to expand...
Click to collapse
do a search into framework folder, if there is another apk file, i think you need to install this framework. i don't know about the xiaomi phones like mi2 or another.
and, are you sure that you did all steps perfectly?
could you please tell us what did you exactly for compiling process? i mean after entering option "11".
M_J_Nazari said:
and, are you sure that you did all steps perfectly?
could you please tell us what did you exactly for compiling process? i mean after entering option "11".
Click to expand...
Click to collapse
I followed the steps as you wrote except with the twframework, then I edit the apktool.yml
But instead of adding:
-1 to -6
I only add
-1, -3,-4,-5
I edit the style following your guide,
Then I compiled back by entering option 11, copied the 'unsignedframework-miui-res.apk' to my phone and renamed it to 'framework-miui-res.apk' and past it in system/framework. The phone rebooted but got stuck after the bootanimation.
Sent from my MI 2
SagiMedina said:
I followed the steps as you wrote except with the twframework, then I edit the apktool.yml
But instead of adding:
-1 to -6
I only add
-1, -3,-4,-5
I edit the style following your guide,
Then I compiled back by entering option 11, copied the 'unsignedframework-miui-res.apk' to my phone and renamed it to 'framework-miui-res.apk' and past it in system/framework. The phone rebooted but got stuck after the bootanimation.
Sent from my MI 2
Click to expand...
Click to collapse
what's about the keep folder?
M_J_Nazari said:
what's about the keep folder?
Click to expand...
Click to collapse
What is the keep folder?
Sent from my MI 2
SagiMedina said:
What is the keep folder?
Sent from my MI 2
Click to expand...
Click to collapse
ok, i think it is need to know how to work with apk multi tool.
1- decompie
2- edit your framework
3- enter option 11 to compile
4- programs will ask you about the modification , just like this:
Code:
Building Apk
Aside from the signatures, would you like to copy
over any additional files that you didn't modify
from the original apk in order to ensure least
# of errors (y/n)
Type input:
5- enter " y ' and then press enter.
6- wait for programs, to show you this message
Code:
Everything is Ok
Files: x
Size: xxxxx
Compressed: xxxxx
In the APK Multi-Tools folder u'll find
a keep folder. Within it, delete
everything you have modified and leave
files that you haven't. IF you have modified
any xml, then delete resources.arsc from that
folder as well. Once done then press enter
on this script.
Press any key to continue . . .
7- don't touch anything, minimize Apk Multitool program window ,
8-Go back to the main folder of apk multi tool , you will find the "keep" folder.
goto keep folder and delete thisfile "resources.arsc"
9- get back to Apk Multitool program and hit any key to create a new framework-miui-res.apk file with this name
"unsignedframework-miui-res.apk" file.
10- rename it and copy to your phone, do a permission
you can do it via root Explorer
or terminal command
Code:
chmod 0644 /system/framework/framewok-miui-res.apk
or adb commnad
Code:
adb shell chmod 0644 /system/framework/framewok-miui-res.apk
M_J_Nazari said:
...
Click to expand...
Click to collapse
Still no luck Nazari, did everything like you said...
I cant get pass the boot animation once i replace the framework,
why is the new apk is smaller? is it normal?
SagiMedina said:
Still no luck Nazari, did everything like you said...
I cant get pass the boot animation once i replace the framework,
why is the new apk is smaller? is it normal?
Click to expand...
Click to collapse
its normal, you can select compression level by hitting option "21".
but upload your framework-miui-res.apk here to check it and i will make changes to that.
M_J_Nazari said:
its normal, you can select compression level by hitting option "21".
but upload your framework-miui-res.apk here to check it and i will make changes to that.
Click to expand...
Click to collapse
Thanks Nazari!!!
SagiMedina said:
Thanks Nazari!!!
Click to expand...
Click to collapse
it seems xiaomi uses different framework and aapt version, you need to ask them.
M_J_Nazari said:
it seems xiaomi uses different framework and aapt version, you need to ask them.
Click to expand...
Click to collapse
If ill get these different framework and aapt version, I only need to replace them with the those in the 'other' folder?
Guys, you don't have a clue what that other frameworks are for, do you? You can't miss nr 1 or 6 or 2 framework in apktool.yml because that will never work! Apktool.yml is fine and should look like in the first post.
I think your main issue is that you don't know frameworks IDs?
This:
Code:
1. Install framework-miui-res.apk
2. Install framework-res.apk
3. Install twframework-res.apk
6. Install MiuiSystemUI.apk
7. Install Additional Frameworks
Is wrong!
How to tell what ID framework has?
Run this command:
Code:
apktool if framework-miui-res.apk
You will get:
Code:
I: Framework installed to: /home/acid/apktool/framework/6.apk
So framework-miui-res.apk is ID = 6.
Try to install regular framework-res.apk. You will get ID = 1.
To complete the gap between ID1 and ID6 you have to install proper frameworks. AND MiuiSystemUi is NOT a framework! Thats nonsense!
ID is 127 which is out of range.
You have to install framework files that have proper ID from 1 to 6.
ID1:
framework-res.apk
ID2:
frameworks from producer base. So this is twframework-res for Samsung devices, com.htc.resources.apk for HTC, SemcGenericUxpRes.apk for Sony... etc. That doesnt really matter. ID2 frameworks are used when you recompile stock apps like Samsung TW apps or HTC apps (HTCAlbum, Music etc). If you just want to recompile framework-miui-res and boot rom then you can use any ID2 framework or just a dummy file.
ID3:
This is com.htc.dummyskin.apk. Just search for it. You can find it in HTC One roms (One X and One S). Search in MIUI roms for that devices (but with stock HTC based MIUI!). Or grab the file from micode.
ID4:
This is framework-htc-res.apk. Again. search for it. Also HTC roms should have this or grab dummy framework from micode.
ID5:
From micode.
ID6:
framework-miui-res.apk
Dummy frameworks from MiCode:
https://github.com/MiCode/patchrom_build/tree/jellybean/res
You can use 3-5.apk to fill the gap. But still I advice you to use proper ID2 frameworks in case you would like to compile stock apps.
And for last install frameworks in order:
Code:
apktool if framework-res.apk
apktool if twframework-res.apk (or htc or dummy)
apktool if 3.apk
apktool if 4.apk
apktool if 5.apk
apktool if framework-miui-res.apk
That should allow you to boot the rom. Also make sure you have miui aapt and apktool 1.5.3.
thanks a lot @ Accidd for very good explanation.
i worte it for samsung devices, and it seems its fine. this script will install frameworks automatically.
but for other devices i will update the application again, so if we want to compile Xiaomi frameworks , we need to use dummy framework for ID number 2?
It doesn't matter which device you do. You always have to install all frameworks.
Wysłane z MI-2
M_J_Nazari said:
i will update the application again,
Click to expand...
Click to collapse
Thanks Nazari!
And thank you Acid for clearing things!
Sent from my MI 2
Version 1.0.11.3 added to first post to compile Xiaomi phones frameworks.

combine SystemUI.apk with SystemUI.odex

I am facing issues in compiling systemui.apk and systemUI.odex files. I was porting Pixel Navigation bar for AOSP ROM of @Santhosh M. There is any to combine both the files?
If i remember right i made the Pixel navbar for Santhosh M ROM. Doesn't it work anymore? If you don't like the home button just decompile the apk and go to drawable-xxhdpi-v4 and change the ic_sysbar_home icon.
Anyway in order to combine them
1. Download baksmali. Make new folder and put the baksmali.jar and SystemUI.odex there.
2. Open command prompt in the folder where baksmali is located. Type in command prompt "adb pull /system/framework/arm" to extract the required files from the phone.
3. Type "java -jar baksmali.jar deodex SystemUI.odex -l" in the command prompt and if it successful there should be an output folder called "out". Copy it and paste it to the decompiled SystemUI.apk then rename it "smali"
4. Get the required odex files from Pixel's SystemUI(tho' i would recommend you to get them from the already modified systemUI as it usually generates the same number IDs so you wont have to deal with odex file changes).
5. Paste them to smali/com/google/android/systemui(if i remember right you had to create google/android/systemui folders so no worries if they are missing)
6.Recompile
I'd advise you to use this tutorial as it is way more detailed.
Sashko98 said:
If i remember right i made the Pixel navbar for Santhosh M ROM. Doesn't it work anymore? If you don't like the home button just decompile the apk and go to drawable-xxhdpi-v4 and change the ic_sysbar_home icon.
Anyway in order to combine them
1. Download baksmali. Make new folder and put the baksmali.jar and SystemUI.odex there.
2. Open command prompt in the folder where baksmali is located. Type in command prompt "adb pull /system/framework/arm" to extract the required files from the phone.
3. Type "java -jar baksmali.jar deodex SystemUI.odex -l" in the command prompt and if it successful there should be an output folder called "out". Copy it and paste it to the decompiled SystemUI.apk then rename it "smali"
4. Get the required odex files from Pixel's SystemUI(tho' i would recommend you to get them from the already modified systemUI as it usually generates the same number IDs so you wont have to deal with odex file changes).
5. Paste them to smali/com/google/android/systemui(if i remember right you had to create google/android/systemui folders so no worries if they are missing)
6.Recompile
I'd advise you to use this tutorial as it is way more detailed.
Click to expand...
Click to collapse
Thanks! I will be trying this out today. You developed Pixel Nav bars and the thing is you made it for January build. This is April so I have seen that it doesn't works. We need to decompile the systemui.apk again and again Change the ID and other things.
I have ported pixel Navbars for LineageOS. It was easy and today, I stuck in this steps.
I just followed your tutorial and I got this error
C:\Users\Xaif\Desktop\Baksmali\framework>java -jar baksmali.jar deodex SystemUI.
odex -x
usage: java -jar baksmali.jar [options] <dex-file>
disassembles and/or dumps a dex file
-?,--help prints the help message then exits.
Specify twice for debug options
-a,--api-level <API_LEVEL> The numeric api-level of the file
being disassembled. If not
specified, it defaults to 15 (ICS).
-b,--no-debug-info don't write out debug info (.local,
.param, .line, etc.)
-c,--bootclasspath <BOOTCLASSPATH> A colon-separated list of
bootclasspath jar/oat files to use
for analysis. Add an initial colon
to specify that the jars/oats should
be appended to the default
bootclasspath instead of replacing
it
-d,--bootclasspath-dir <DIR> the base folder to look for the
bootclasspath files in. Defaults to
the current directory
-e,--dex-file <DEX_FILE> looks for dex file named DEX_FILE,
defaults to classes.dex
-f,--code-offsets add comments to the disassembly
containing the code offset for each
address
-i,--resource-id-files <FILES> the resource ID files to use, for
analysis. A colon-separated list of
prefix=file pairs. For example
R=res/values/public.xml:android.R=$A
NDROID_HOME/platforms/android-19/dat
a/res/values/public.xml
-j,--jobs <NUM_THREADS> The number of threads to use.
Defaults to the number of cores
available, up to a maximum of 6
-k,--check-package-private-access When deodexing, use the
package-private access check when
calculating vtable indexes. It
should only be needed for 4.2.0
odexes. The functionality was
reverted for 4.2.1.
-l,--use-locals output the .locals directive with
the number of non-parameter
registers, rather than the .register
directive with the total number of
register
-m,--no-accessor-comments don't output helper comments for
synthetic accessors
-n,--normalize-virtual-methods Normalize virtual method references
to the reference the base method.
-o,--output <DIR> the directory where the disassembled
files will be placed. The default is
out
-p,--no-parameter-registers use the v<n> syntax instead of the
p<n> syntax for registers mapped to
method parameters
-r,--register-info <REGISTER_INFO_TYPES> print the specificed type(s) of
register information for each
instruction. "ARGS,DEST" is the
default if no types are specified.
Valid values are:
ALL: all pre- and post-instruction
registers.
ALLPRE: all pre-instruction
registers
ALLPOST: all post-instruction
registers
ARGS: any pre-instruction registers
used as arguments to the instruction
DEST: the post-instruction
destination register, if any
MERGE: Any pre-instruction register
has been merged from more than 1
different post-instruction register
from its predecessors
FULLMERGE: For each register that
would be printed by MERGE, also show
the incoming register types that
were merged
-s,--sequential-labels create label names using a
sequential numbering scheme per
label type, rather than using the
bytecode addressQA
-t,--implicit-references Use implicit (type-less) method and
field references
-v,--version prints the version then exits
-X,--experimental enable experimental opcodes to be
disassembled, even if they aren't
necessarily supported in the Android
runtime yet
-x,--deodex deodex the given odex file. This
option is ignored if the input file
is not an odex file
Click to expand...
Click to collapse
I also tried doing like the above given command so I followed this steps:
C:\Users\Xaif\Desktop\Baksmali\framework>java -jar baksmali.jar --deodex SystemU
I.odex -l
Error occurred while loading boot class path files. Aborting.
org.jf.util.ExceptionWithContext: Cannot locate boot class path file /system/fra
mework/core.jar
at org.jf.dexlib2.analysis.ClassPath.loadClassPathEntry(ClassPath.java:2
96)
at org.jf.dexlib2.analysis.ClassPath.fromClassPath(ClassPath.java:207)
at org.jf.baksmali.baksmali.disassembleDexFile(baksmali.java:67)
at org.jf.baksmali.main.main(main.java:305)
C:\Users\Xaif\Desktop\Baksmali\framework>
Click to expand...
Click to collapse
I have used ApkTool for Android to deodex that file and it did it successfully. Now, I am porting again

Categories

Resources