1. Download the #1 Android News App:   EarlyBird - News for Android
    Dismiss Notice

[TUTORIAL] Theming walkthrough v. 1

Thread Status:
Not open for further replies.

Last Updated:

  1. DaSchmarotzer

    DaSchmarotzer Blame it on me VIP Member

    Warning, this thread is outdated. No support will be given. The links and pictures of the first post are down. You can still learn from it: the general idea is still the same. The "tips" given on the second post are still useful.

    I've seen many people asking for a step-by-step guide to making a theme so I thought I'd attempt to fulfill this request. I will be using this method to edit a few files but this method can be used to create a theme for any ROM.

    Mad props to Ardchoille and karandpr for their help with this tutorial.

    I am not responsible for any problems that result from following this tutorial
    I have attempted to keep this tutorial as basic as possible but please let me know if you have any questions.

    Goals of this tutorial
    * Edit the GPS icons that appear in the status bar as well as the status bar itself
    * Create a theme zip file that can be flashed in a custom recovery

    You will need the following skills
    * Basic computer skills
    * Downloading files
    * Unzipping files
    * File management
    * Image editing

    Tools needed
    * Web browser
    * A rooted android device
    * Busybox
    * Amon_RA recovery or ClockworkMod recovery
    * Image editor - GIMP is free but Photoshop works just as well
    * APK Manager - available here (Windows version is preferred)
    * Your favorite beverage :)

    Obtaining the required files
    First we'll need a ROM. I'll be using the Fresh Evo ROM for this walk-through, available here, but this walk-through can be used to make a theme for any android ROM.

    When creating a new theme it is imperative that you begin with the same files that are included in the ROM you plan to use. Creating a theme for, say, ROM A will cause problems when using that theme on ROM B. Do not attempt to mix themes and ROMS. You will need to create a new theme each time you flash a new ROM.

    NOTE ON PACKAGES: The required packages are in different locations for different versions of Android. Different packages may also be needed for each manufacturer.

    Required packages
    Let me know which packages are required for theming the various manufacturer ROMs and I will add them.

    All Froyo ROMs:
    * /system/framework/framework-res.apk

    All Gingerbread ROMs:
    * /system/framework/framework-res.apk
    * /system/app/SystemUI.apk

    Manufacturer specific ROMs:
    The above packages will be needed in addition to the below requirements.

    Sense UI ROMs:
    * /system/framework/com.htc.resources.apk

    Samsung Froyo ROMs:
    * /system/framework/twframework-res.apk - Notification menu

    Since Fresh Evo is a Froyo ROM with htc's Sense UI we'll need the following packages in order to create a theme:
    * /system/framework/com.htc.resources.apk
    * /system/framework/framework-res.apk

    If this were a Gingerbread ROM we would need these packages plus /system/app/SystemUI.apk

    Extracting the ROM and packages
    Once you have the ROM you'll need to extract it so you can work with the correct packages. I used a zip file extractor to extract the ROM and also to extract the com.htc.resources.apk and framework-res.apk packages which are located inside this ROM. Make sure you keep untouched copies of the packages that you extract from the ROM because you'll be adding the edited images back to those packages later.

    Decompiling the packages
    Please note that this step isn't a requirement: you could modify most picture files directly in the package (such as framework-res.apk). However, it will be much easier to modify the .9.png files and you will be able to edit important xml files making the theme much more customizable.

    Unzip the APK Manager package and go into the folder that was produced. Launch APK Manager and follow the instructions. Choose "y" when it asks if you want to clean out all of your current projects. This will create some required folders that you will need to work in.

    Place the package you want to modify in the "place-apk-here-for-modding" folder. Run APK Manager and select the 22th option to pick your project. Follow to onscreen directions to pick the apk you want to modify. Then, select the ninth option, "Decompile apk" (You might have to use the tenth one, but I won't give more details).

    You should now see a folder named after the decompiled package in the "projects" folder of APK Manager. That's where you will edit the images and different files.

    Editing the images
    Now that we have extracted the ROM and required packages, it's time to edit the images. I use the GIMP on a Linux machine to do all of my graphics work but Photoshop works just as well.

    The images I will be working with in this tutorial are:
    From the com.htc.resources.apk package:
    * /res/drawable-hdpi/sym_gpsone_0_sprint.png
    * /res/drawable-hdpi/sym_gpsone_0_vzw.png
    * /res/drawable-hdpi/sym_gpsone_3_sprint.png
    * /res/drawable-hdpi/sym_gpsone_3_vzw.png
    * /res/drawable-hdpi/sym_gpsone_none.png

    From the framework-res.apk package:
    * /res/drawable-hdpi/statusbar_background.png

    I won't go into how to edit the individual images as that is beyond the scope of this tutorial. Use your imagination and personalize your images as needed.

    What are .9.png files?
    I won't be using this type of image in this tutorial but I wanted to touch on it for users who want to edit these images.

    A NinePatchDrawable graphic is a stretchable bitmap image, which Android will automatically resize to accommodate the contents of the View in which you have placed it as the background. An example use of a NinePatch is the backgrounds used by standard Android buttons — buttons must stretch to accommodate strings of various lengths. A NinePatch drawable is a standard PNG image that includes an extra 1-pixel-wide border. It must be saved with the extension .9.png in your project so it can be compiled when you build your project.
    This page has a nice explanation of what is required.

    If you have decompiled the package (you should have if you followed the tutorial), you will see that the .9.png files have a 1 pixel transparent border with a few 100% black pixels around. You can modify them directly and the border will disappear when you compile the package again. If you haven't decompiled the package, you will see regular images, but modifying them will cause different problems as they will not stretch correctly and might cause incompatibility issues with UOT Kitchen for example.

    Incorporating edited images into their packages
    GPS icons:
    Open the com.htc.resources.apk folder and drag and drop the 5 GPS icons that you edited into the /res/drawable-hdpi folder - their original location. Make sure you drop the images into the proper folder or your theme won't change.

    Status bar image:
    Open the framework-res.apk folder and drag and drop the status bar image that you edited into the /res/drawable-hdpi folder - its original location. Make sure you drop the image into the proper folder or your theme won't change.

    Once the edited images have been dropped into their proper places in respective their packages, close the folder. Did I mention that you need to make sure you drop the images into their proper folders or your theme won't change?

    Compiling the package
    Open up the APK Manager again. This time, select the 11th option, "Compile apk". After a short while, you will be asked if it is a system app or not. The answer will probably be yes, since this is a theming tutorial. It will also ask if you would like to copy any additional files to avoid errors. You should pick no since it's faster and you are less prones to errors. My themes always worked perfectly. You should now find an apk file called "unsignedframework-res.apk" in the "place-apk-here-for-modding" folder (if you were modifying the framework-res package, of course).

    Optimizing the package (Tested on Windows only)
    This is a great way to enhance the performance of your modified packages. Take your compiled apk and place it into the "place-apk-here-to-batch-optimize" folder. Rename it to remove the "unsigned" part: you won't have to sign system applications. In APK Manager, select the 15th option: "Batch Optimize Apk". You will be asked what you want to do specifically, type zp and press enter. This will take a while, so enjoy your beverage. :)

    Creating the flashable theme
    I have supplied a blank theme template which you can use to create your theme. This template can be found here and includes a README.txt file. Download the theme template and unzip it to find a README file and 3 folders. Place the edited package according to this table AFTER you have edited the images and added them back to their proper packages:

    Froyo ROMs:
    framework-res.apk - framework folder

    Gingerbread ROMs:
    framework-res.apk - framework folder
    SystemUI.apk - app folder

    Sense ROMs:
    com.htc.resources.apk - framework folder

    If this will be a Gingerbread theme you'll need to add the following line to the /META-INF/com/google/android/updater-script file BETWEEN the run_program lines:

    Code (Text):
    1. package_extract_dir("app", "/system/app");
    There is already a package_extract_dir line there for framework, leave it there and add the above line under the existing line.

    Signing the theme
    Once the edited packages are in the proper places for the theme you'll need to sign the theme. APK Manager is an awesome tool and I would recommend keeping a copy of it for future use.

    1. Place the theme zip file that you created earlier into the place-apk-here-for-modding folder

    2. Rename the theme zip file to repackaged-unsigned.apk

    3. In APK Manager choose item number 4 (Sign apk)

    4. When the signing procedure is complete go into the place-apk-here-for-modding folder and your finished theme should be there already renamed to repackaged-signed.apk. This is the package you previously renamed to repackaged-unsigned.apk.

    5. Rename this apk package to anything you want but change the .apk file extension to .zip. This is your new theme, place a copy of it somewhere for archival purposes.

    Flashing your new theme
    1. Place your new theme zip file on your SD card and make note of where it is placed

    2. Reboot your phone into your custom recovery image

    3. Flash your theme zip file as you would a ROM. I've never had to wipe anything prior to flashing a theme and my themes have always worked.

    4. Reboot your phone and you should see your new theme

    Reverting to the original theme
    The easiest way to revert to the original ROM's theme is to create a flashable from the original packages that were edited. For instance, if you changed anything in framework-res.apk you can simply create a new flashable zip file using the original untouched framework-res.apk and flash it via your preferred recovery. Make sure, however, that you create the new flashable zip file to include untouched versions of ALL of the packages that were edited when you created your theme.

    I have been creating themes from the above steps for some time and I've never had any problems with this procedure. Please let me know if there is anything I can do to improve this tutorial. I hope you enjoyed this tutorial and I look forward to seeing some new screenshots :D

  2. DaSchmarotzer

    DaSchmarotzer Blame it on me VIP Member

    This post will contain general tips about themes that you might find useful as an add-on to Ardchoille's guide. If you have a tip, you can PM me or post it here and I will add it to the list. :)

    When I started creating themes, the information was scarce so I decided to share my "knowledge" when Ardchoille wrote the guide. It's something I had wanted to do for a long time. Enjoy. ;)

    Changing the boot animation
    [Hide]Customizing the boot animation is a great plus to a theme. To do so, you should add a folder in the "system" folder of your theme. That new folder should be renamed to "media", without the quotation marks and it is important for it to be in lowercase. The files related to the boot animation should be put directly inside of this folder. You can download many boot animations from Google, or you can create your own if you want.

    Example of a boot animation inside a .zip package, ready to be applied. I made it myself and I'll explain how it works. Don't mind the sdcard folder, I'll use this for another tip.

    The desc.txt file is important, it contains the instructions. This is what you should see:

    Code (Text):
    1. 320 480 3
    2. p 1 0 part0
    3. p 0 0 part1
    The first two numbers of the first line are the resolution for the boot animation. Width first, the height. You can guess that my phone has a resolution of 480x320. The "3" on the first line is the frame in fps (frames per second). 3 is really not a lot, for a smooth animation a number like "30" should be used. It is because my boot animation is really simple, if you check out the images you will understand.

    On the second line, the first number after the "p" is the number of times the folder "part0" should be looped. Zero means "until boot has finished". The next number (0 in this case), is the pause. A pause of 1 means pause for 1 frame, depending on the number of fps you selected.

    The third line is just like the second one. ;)

    The part0 and part1 folders contain the the individual frames saved as png files. The name of the file should be something like loop_00000.png, from 0 to the number of frames (loop_00001.png, loop_00002.png, loop_00003.png, etc). They will be played in that order. I used two folders, but you could use any number you want, as long as you modify the desc.txt file accordingly.[/Hide]
    Changing system fonts
    [Hide]This can be useful if you want your theme to stand out. A font is simply a .ttf file with a specific name. For example, the font used for the lockscreen lock is named "Clockopia.ttf". To change a font, you'll have to download the font you want as a .ttf file. Websites such as DaFont can help you find great free fonts. Once you have it, you'll have to rename it to the font you want to replace, to overwrite the actual font. Let's say you downloaded Comic_sans.ttf, you'll have to rename it to Clockopia.ttf if you want to change the font on the lockscreen clock.

    Open up your theme .zip file and create a folder named "fonts" inside the system folder. It is important to use lowercase. Place your newly renamed font in there and there you go, your theme is ready to be signed. Here's an example, this will change the clock font to the droid sans font.
    Adding files on the SD Card via a theme
    [Hide]This really is an easy one. To get an example, please download this file, a "theme" package ready to be applied. All it does is change the boot animation and place files on the SD card. It is the same file as the one in the section "Changing the boot animation".

    Basically all you have to do is add a folder directly inside your theme named "sdcard". Whatever you put in there, it will be placed on the phone's SD card. In my example, I put a folder called "DaColors" and put a .txt file along with a wallpaper for the user. Be careful though: if the folder already exists, they will be merged and if a file already exists, it will be overwritten by the one in your theme.[/Hide]
    Changing the menu background to black
    [Hide]This part might be a little more tricky, but if you follow my instructions it should be fairly easy and straightforward. This is the result:


    You should decompile the framework-res.apk file just like in Ardchoille's post above. The first part is easy, you need to change a couple image files to get the black background. Download this and this. You might have guessed it already, but the files are "menu_background_fill_parent_width.9.png" and "menu_background.9.png". They were located in the "drawable-mdpi-v4" folder, but it might be different for you. Just a reminder, you should replace these files in the project folder of the APK Manager, inside your framework-res.apk folder.

    You might think that the modification is over and that the background would be black, but you'd only be partly right. The menu would be black, but the text would be black too. It needs to be white (the separators too!), otherwise it makes for an ugly theme with unreadable text. That's where the xml editing comes into play. If you don't have an xml editor, I recommend downloading Notepad + +, it's free. If you don't use Windows, I'm not sure if it will be compatible, sorry.

    Still inside your framework-res folder, check out the "values" folder. Inside of it, open up the "styles.xml" file, that's what we'll modify. It's a big file that contains a lot of stuff, so make sure to change only the correct things. Near the end of the files, find this:

    Code (Text):
    1. <style name="Theme.IconMenu" parent="@style/Theme">
    2.         <item name="windowAnimationStyle">@style/Animation.OptionsPanel</item>
    3.         <item name="background">@null</item>
    4.         <item name="itemTextAppearance">@style/TextAppearance.Widget.IconMenu.Item</item>
    5.         <item name="horizontalDivider">@drawable/divider_horizontal_bright</item>
    6.         <item name="verticalDivider">@drawable/divider_vertical_bright</item>
    7.         <item name="itemBackground">@drawable/menu_selector</item>
    8.         <item name="itemIconDisabledAlpha">?disabledAlpha</item>
    9.         <item name="moreIcon">@drawable/ic_menu_more</item>
    10.     </style>
    11.     <style name="Theme.ExpandedMenu" parent="@style/Theme">
    12.         <item name="listViewStyle">@style/Widget.ListView.Menu</item>
    13.         <item name="windowAnimationStyle">@style/Animation.OptionsPanel</item>
    14.         <item name="background">@null</item>
    15.         <item name="itemTextAppearance">?textAppearanceLargeInverse</item>
    16.     </style>
    You should change it to this:

    Code (Text):
    1. <style name="Theme.IconMenu" parent="@style/Theme">
    2.         <item name="windowAnimationStyle">@style/Animation.OptionsPanel</item>
    3.         <item name="background">@null</item>
    4.         <item name="itemTextAppearance">@style/TextAppearance.Widget.IconMenu.Item</item>
    5.         <item name="horizontalDivider">@drawable/divider_horizontal_dark</item>
    6.         <item name="verticalDivider">@drawable/divider_vertical_dark</item>
    7.         <item name="itemBackground">@drawable/menu_selector</item>
    8.         <item name="itemIconDisabledAlpha">?disabledAlpha</item>
    9.         <item name="moreIcon">@drawable/ic_menu_more</item>
    10.     </style>
    11.     <style name="Theme.ExpandedMenu" parent="@style/Theme">
    12.         <item name="listViewStyle">@style/Widget.ListView.Menu</item>
    13.         <item name="windowAnimationStyle">@style/Animation.OptionsPanel</item>
    14.         <item name="background">@color/background_dark</item>
    15.         <item name="itemTextAppearance">?textAppearanceLarge</item>
    16.         </style>
    That's not all: you should also find this:

    Code (Text):
    1. <style name="TextAppearance.Widget.IconMenu.Item" parent="@style/TextAppearance.Small">
    2.         <item name="textColor">?textColorPrimaryInverse</item>
    3.     </style>
    and change it to this:

    Code (Text):
    1. <style name="TextAppearance.Widget.IconMenu.Item" parent="@style/TextAppearance.Small">
    2.         <item name="textColor">@color/bright_foreground_dark</item>
    3.     </style>

    These two modifications will change the text from black to white, change the dividers from black to white and also change the expanded menu background color (when there are more than 6 options, the menu that comes up when you press "more"), otherwise its text would have been white on a white background. If you check what changed, you should be able to figure out why we did these modifications and thus be able to change more things on your own.

    That's it, you should save the modifications, close the folder, fire up APK Manager, compile your framework-res.apk and it's ready to be placed in a theme. :)
    Changing the order of the system notification icons
    [Hide]Check out the top-right corner, that's what I'm talking about:


    You should start by decompiling the framework-res.apk, following Ardchoille's guide.

    If you don't have an xml editor, I recommend downloading Notepad + +, it's free. If you don't use Windows, I'm not sure if it will be compatible, sorry.

    This is quite simple. Inside the project folder of the APK Manager, you should find the folder named "framework-res.apk". Inside of it, find the "res" folder and then the "values" folder. Open "arrays.xml" with your xml editor. You'll see many things which you could change. You should see something similar to this:

    Code (Text):
    1. <string-array name="status_bar_icon_order">
    2.         <item>battery</item>
    3.         <item>clock</item>
    4.         <item>secure</item>
    5.         <item>alarm_clock</item>
    6.         <item>phone_signal</item>
    7.         <item>phone_evdo_signal</item>
    8.         <item>phone_dbm_signal</item>
    9.         <item>data_connection</item>
    10.         <item>cdma_eri</item>
    11.         <item>wifi</item>
    12.         <item>bluetooth</item>
    13.         <item>tty</item>
    14.         <item>volume</item>
    15.         <item>headset</item>
    16.         <item>mute</item>
    17.         <item>speakerphone</item>
    18.         <item>tty</item>
    19.         <item>gps</item>
    20.         <item>sync_active</item>
    21.         <item>sync_failing</item>
    22.         <item>ime</item>
    23.     </string-array>
    The modification is simple: you simply have to reorder the elements. In my case, the first one is the battery: just like on the screenshot. You could probably use this to remove the clock if you wanted to. ;)

    Save up your work, your new framework is ready to be compiled.
    Changing system text
    [Hide]You should start by decompiling the framework-res.apk, following Ardchoille's guide.

    If you don't have an xml editor, I recommend downloading Notepad + +, it's free. If you don't use Windows, I'm not sure if it will be compatible, sorry.

    This is quite simple. Inside the project folder of the APK Manager, you should find the folder named "framework-res.apk". Inside of it, find the "res" folder and then the "values" folder. Open "strings.xml" with your xml editor. You'll see many things which you could change, that's pretty much it. If you want to change text when using another language, there should be a "strings.xml" file in other "values" folders, such as "values-fr" for French.

    The plurals.xml also contains text which you could change. ;)

    Save the edited xml files and your framework is ready to be compiled![/Hide]
    How to edit .9.png files correctly
    You might know what .9.png files are. If not, it's really simple. They are regular png files, but with an added border: 1 pixel all around. That border is transparent (the png format allows transparency) but it contains a few 100% black pixels. It is used for stretching and for text. You might have noticed that sometimes, the menus in Android change shape depending on what they contain. A pop-up will be small if there's not a lot of text but it might also be huge if there's a lot. That's when .9.png files come into play.

    Luckily for us, the Android SDK comes with a special tool to help you create .9.png files. It is located in the tools folder: "draw9patch.bat".

    If you run it, you'll get in the application but you'll have to import an image file. This will be used to convert a regular png file in a .9.png file that you will be able to add to your decompiled apk. This application will add the transparent border and will allow you to place the black pixels while seeing changes in real time. I created a small file to use as a first example:


    So, I dragged it onto the Draw9Patch application and put the black pixels around to get an optimal result. I'll show you the picture and then explain a little bit.

    The right and bottom borders are used for text. You should put a black line where you want the text to be written, it's pretty simple. The top and left borders are used for the stretching instructions. The picture is stretched where I placed the black pixels.

    Ok, here's another example:


    This time, there's a gradient. So if we stretch one pixel only, the gradient will be messed up. I don't want the corners to be stretched though, as it wouldn't look good at all. Here's how I did it:

    As you can see, the result is a nice looking gradient, even when stretched.

    One last example:


    This time, I don't want the "watermark" to be stretched at all. I also want it to be centered even when the png file changes shape. I don't want this to happen:


    Here's how it should be done:


    You now know how to use .9.png files correctly. The tool is used to add a border to a .png file and see the result, but you could do it in any painting program such as Photoshop, GIMP, Paint.net, etc. It's just a regular png file with the border and .9 before the .png extension. If you decompile an apk, you'll see that the borders are visible on the .9.png images, but they are not visible when compiled. That's why you should always work with a decompiled apk (usually the framework for themes), and then compile when you are done editing.
  3. ardchoille

    ardchoille Well-Known Member

    You're welcome :)

    I'm hoping to see some cool themes come from this.
  4. Sak01

    Sak01 Well-Known Member

    Have you got a link to all your themes, ardchoille?
  5. ardchoille

    ardchoille Well-Known Member

    I'm afraid I don't. I am, however, making a new theme now and will link to screenshots when it's done.
  6. ardchoille

    ardchoille Well-Known Member

    Added screenshots to the OP.
  7. karandpr

    karandpr Well-Known Member

    Add Edit
    Froyo Samsung ROMS
    twframework-res.apk - Notification menu
    framework-res.apk - Everything else


    If you are editing Why be satisfied with GPS alone ,use it to change battery ,status bar, notification header/footer, background and icons.Add transparency and glow.
    ardchoille likes this.
  8. ardchoille

    ardchoille Well-Known Member

    I only used a few images as an example. Good point, though, this theming method can be used to edit anything in a ROM.
  9. DaSchmarotzer

    DaSchmarotzer Blame it on me VIP Member

    Good job Ardchoille.

    Since the tutorial already requires you to use APKManager, why don't you edit it to include decompiling, compiling and maybe a quick note about optimization? They're all options in APK Manager and have more "power" than just changing a couple image files.

    With these options, you don't have to worry about .9.png since they'll be compiled with the rest, meaning that you can edit them directly in GIMP or Photoshop. Also, the themer will have access to the "values" folder, where he could edit xml files to change some colors or even text in the ROM (for example the color of the menu and dividers when the menu key is pressed). Or the order of the notification icons. Many things. ;)

    Just a suggestion, I know your tutorial is a little more basic though. That's exactly how I started. (I even used Eclipse to compile my .9.png until I discovered APK Manager.) :)
    karandpr and ardchoille like this.
  10. ardchoille

    ardchoille Well-Known Member

    Yeah, you're right. I'll be updating this tutorial to include more APK Manager stuff. APK Manager is a lot easier to use than Eclipse for theming. Thank you for the suggestion :)

    EDIT: Unfortunately the Linux version of APK Manager lacks much of the functionality of the Windows version, so I won't be able to do much updating here.
  11. karandpr

    karandpr Well-Known Member

    Good Work DaS I guess
  12. karandpr

    karandpr Well-Known Member

    I think UOT kitchen should be mentioned here :D
    ardchoille likes this.
  13. ardchoille

    ardchoille Well-Known Member

    Yes, very good theming site and one that I've learned quite a lot from.
  14. DaSchmarotzer

    DaSchmarotzer Blame it on me VIP Member

    After talking with Ardchoille, I modified the tutorial to include decompiling, compiling and optimizing packages. It should help beginners modify advanced stuff. I might add a second post with useful tips for themes, such as changing the boot animation, fonts, adding files on the internal memory (such as wallpapers, icons, readme, etc), modifying xml files, etc.
    blue2107, eyebeam and ardchoille like this.
  15. eyebeam

    eyebeam Well-Known Member

    Wow! Great work Ard. AF really needed someone to put something like this together. Thanks for taking the time to do it!
  16. DaSchmarotzer

    DaSchmarotzer Blame it on me VIP Member

    I inserted a second post and shared some tips about themes. I hope at least one person will find this useful! ;)
    blue2107 and ardchoille like this.
  17. zeroibis

    zeroibis Active Member

    Something I was wondering. Why not just have users simply overwrite files such as framework-res.apk directly and then reboot. To me this seems safer for users with sprecovery as they can then keep there current rom as update.zip at all times ready to re-flash if something went wrong.

    Logically this may seem like more steps but you only need terminal emulator or root explorer in order to do it. For example the instructions here have people modifying theme data without needing to flash or build an entire package. Likely much easier if your just trying to change a few things or fine tune stuff: [TUT] How to mod your own framework-res.apk to include the CRT screen off animation - xda-developers

    Lastly I understand that doing
    but what does this actually do to the file? How does it make it faster on the phone?
  18. ardchoille

    ardchoille Well-Known Member

    I have done this on two different android phones and was thrown into a boot loop, was told it's dangerous to replace/edit framework files while the system is running. I noticed some of the comments in the thread you linked also complain of boot loops.

    I would have to say it's safer to build and flash a flashable zip file.
  19. DaSchmarotzer

    DaSchmarotzer Blame it on me VIP Member

    In addition to ardchoille's reply, the .zip archive can easily be used by users with less knowledge, that's another advantage. It can be shared more easily.

    About optimization, it is supposed to make the application more "efficient" by reducing its file size. The png image files will be optimized (such as indexed colors) without any loss of quality and the app will also be zipaligned (I won't get into details but the app should consume less RAM).
    ardchoille likes this.
  20. zeroibis

    zeroibis Active Member

    Ah I see, for reference I do the method as shown in the link above where you replace files in the apk as an archive after recompile. Should I optimize before of after this step?

    The only reason I could see a user throwing a bootloop is that they did not set the permissions correctly on the file before the overwrite leading immediately to a major file system error. Otherwise it should not matter when it gets replaced unless it gets corrupted somehow.
  21. ardchoille

    ardchoille Well-Known Member

    For what it's worth, on one of the phones that I tried (Samsung Vibrant), I was thrown into a boot loop as soon as I copied and pasted the new framework-res.apk over the old one. I'm talking a couple of seconds.. there was no time to change permissions. It seems different phones yield different results for this method.
  22. DaSchmarotzer

    DaSchmarotzer Blame it on me VIP Member

    The last thing you should do on your apk would be to optimize it. If you change something, you should optimize it again. ;)
    ardchoille likes this.
  23. zeroibis

    zeroibis Active Member

    Yea that would be expected you need to move it to the systems folder first then change the permissions then move to the app folder and overwrite. As it will then overwrite with the correct permissions already set your problem can be avoided. Always got to be careful with those system files. ;)
    ardchoille likes this.
  24. Granite1

    Granite1 Zercron Encrusted Tweezer Moderator

    I find its much easier to work on your pc, do your thing inside the appropriate .apk res folder, reinsert into 7zip, update archive and then flash the update.zip. Of course I do a anadroid first. :D

    I tell you Ardch has been a godsend from the beginning for helping me start my first theme. Thanks My Man!
    I also have apk manager, but I havent got into it that much yet. I guess I need to start optimizing my .apk's.

    Just as a side note, I'd add 7zip as a tool. I use it all the time, makes updating an archive a breeze. ;)
    ardchoille likes this.
  25. 9to5cynic

    9to5cynic Well-Known Member

    Granite, so you are not using the apk manager then? Just going right for an update zip? Do you need to use it to sign the zip or anything like that.
Thread Status:
Not open for further replies.

Share This Page