DroidForums.net is the original Verizon Android Forum! Registered Users do not see these ads. Please Register - It's Free!
Page 1 of 4 123 ... LastLast
Results 1 to 10 of 40

Thread: Push edited stat_sys_battery.xml file to phone & have it accepted?

  1. Droid
    Lock-N-Load's Avatar
    Member #
    35537
    Join Date
    Feb 2010
    Location
    Westsiiide
    Posts
    74
    Phone
    Drizzoid
    #1

    Push edited stat_sys_battery.xml file to phone & have it accepted?

    So, I wanted to edit the icons in my Droid 1's notification bar to have percentage signs. I can and did do that easy enough and used Metamorph to place them and that works just fine.

    Then, in reading around, I saw that some were able to then get the system to also do 10% increments and all they have to do is 'essentially' add in the missing png battery icons and alter the stat_sys_battery.xml file. Well, I can and did create new 10% battery png files and can place them no problem so now I also have images for 5,15,30,50,70 to go along with the system pngs of 100,80,60,40,20,10,0. I can even edit the stat_sys_battery.xml file with the reference to the new icons.

    BUT, the issue is being able to get the system to recognize and accept my stat_sys_battery.xml since it is inside an apk file (framework-res.apk). In all my trials and all my reading of numerous topics, it seems that stat_sys_battery.xml needs to be signed in some way so the system accepts it as a valid xml file when you place it? This is not an issue with the png images, those just go right into place with Metamorph and are recognized. But getting the stat_sys_battery.xml file to be placed and recognized by the system is what is stopping my Droid from seeing and using the new 10% icons I added.

    I have a mac and a PC and wonder if someone can point me to how to get the stat_sys_battery.xml placed, signed, accepted or whatever it takes for the system to accept it in the apk and use it. You can't seem to place it with something like Root Explorer and have it recognized and work.
  2.  
     
     
     
  3. Droid
    powder's Avatar
    Member #
    20741
    Join Date
    Dec 2009
    Location
    the evergreen state
    Posts
    73
    Phone
    LG Revolution
    #2
    Did you compile it? Here is what i would do. Compile it with the rest of framework-res.apk in apk manager. Open up the "unsignedframework-res.apk" that apk manager compiles for you and find your "stat_sys_battery.xml" and drop it in a MM zip like you know how to do already. Put it on your sd, then go on the market and do a search for "ZipThemer" and download it. Once you have it, run your MM zip through it and tell it to build it. Now you have a flashable zip that's signed and zip aligned that you can flash via recovery. The good thing about doing it this way besides what i've mentioned already, is it takes a combination of the files in your MM, and the files already in your framework-res.apk and creates your flashable and also creates an undo.zip that reverts you back to what you started with if the changes don't work out.
  4. Master Droid
    kevdog's Avatar
    Member #
    4295
    Join Date
    Nov 2009
    Posts
    722
    Phone
    moto droid
    #3
    FYI - Droid 1 wont except any battery increments less than 10% -- trust me -- Ive tried it and so have many others.

    Use APKManager/ApkTool to recompile your framework-res.apk. Then my advice would then to specifically drop and drag your modified file(s) along with the resourses.asc file using Winrar (or similar) from your compiled framework into your old framework (pre-modified). (The old themeing trick). By using this trick you don't have to worry about signing since the old framework was already signed and using the drag and drop trick -- you don't destroy the signature.

    That's how to do it.
    Last edited by kevdog; 02-14-2011 at 06:35 AM.
  5. Droid
    Lock-N-Load's Avatar
    Member #
    35537
    Join Date
    Feb 2010
    Location
    Westsiiide
    Posts
    74
    Phone
    Drizzoid
    #4
    Quote Originally Posted by powder View Post
    Did you compile it? Here is what i would do. Compile it with the rest of framework-res.apk in apk manager. Open up the "unsignedframework-res.apk" that apk manager compiles for you and find your "stat_sys_battery.xml" and drop it in a MM zip like you know how to do already. Put it on your sd, then go on the market and do a search for "ZipThemer" and download it. Once you have it, run your MM zip through it and tell it to build it. Now you have a flashable zip that's signed and zip aligned that you can flash via recovery. The good thing about doing it this way besides what i've mentioned already, is it takes a combination of the files in your MM, and the files already in your framework-res.apk and creates your flashable and also creates an undo.zip that reverts you back to what you started with if the changes don't work out.
    I didnt compile.. and I know that is what my issue is. I dont have this "apk manager" so I guess I need to investigate it. I also like the idea of this "zipthemer". It seems all I really should have to do is create an framework-res.apk that contains ONLY the items I changed and nothing more, correct? Some of the ones I have seen on the web include the entire framework-res.apk and yet, I am just editing 1 file within it so I see no reason to make a whole new framework-res.apk.. if I made a framework-res.apk with just my edited files - "stat_sys_battery.xml" and the new png files - in it, it would only place those and leaves others in place, yes?

    Quote Originally Posted by kevdog View Post
    FYI - Droid 1 wont except any battery increments less than 10% -- trust me -- Ive tried it and so have many others.

    Use APKManager/ApkTool to recompile your framework-res.apk. Then my advice would then to specifically drop and drag your modified file(s) along with the resourses.asc file using Winrar (or similar) from your compiled framework into your old framework (pre-modified). (The old themeing trick). By using this trick you don't have to worry about signing since the old framework was already signed and using the drag and drop trick -- you don't destroy the signature.

    That's how to do it.
    hmmm.. I thought below 10% it did that 5%. No biggie if not. I just really want the 10%.

    again, still looks like I need to investigate this APK manager.
    Last edited by Lock-N-Load; 02-14-2011 at 01:31 PM.
  6. Master Droid
    kevdog's Avatar
    Member #
    4295
    Join Date
    Nov 2009
    Posts
    722
    Phone
    moto droid
    #5
    APK manager is found over at xda (Danesh) is the author. It offers a rough gui for apktool -- which is the actual tool doing the decompiling and compiling.

    Its tricky to use at first. You need to start off with an unthemed framework-res.apk (since on many of the themes the author didn't correctly modify the .9.png files which will break apktool when it goes to recompile the framework-res.apk.

    Unzip the framework-res.apk -- make the modifications to whatever files you want using notepad++ or other tool that can write in linux/unix format. Save the changes, and then follow the instructions to recompile. (its a little bit of a hassle). Then once compiled, take your modified files along with the resources.asc file and then drag and drop them to the original unmodified framework-res.apk. This ensures you won't have a signature error when trying to push the framework-res.apk back to the phone.

    If you phone ever bootloops -- just push back the original framework-res.apk (unmodified), and the phone will boot. Ive had to do this many times which sucked, but unlike what others would lead you to believe -- you won't bork your phone.

    You'll need to be somewhat facile with adb to do all of this.
  7. Droid
    powder's Avatar
    Member #
    20741
    Join Date
    Dec 2009
    Location
    the evergreen state
    Posts
    73
    Phone
    LG Revolution
    #6
    I haven't used adb for it. That's the plus of ZipThemer, it's a flashable zip. Your phone has to reboot when any framework changes are made anyways, and framework-res.apk changes cannot be made with a file manager to my knowledge.

    I would make your metamorph them like i stated earlier, and use zipthemer to make it an update.zip.

    Your other option is just make it an update.zip yourself if you have a full apk you want put in. There's templates all over the place, it's pretty simple. Or like kevdog said, you can figure out adb. In the end adb will probably be the easiest for pushing any kind of file, an you won't have to worry about updater-scripts and control xml's.
  8. Droid
    Lock-N-Load's Avatar
    Member #
    35537
    Join Date
    Feb 2010
    Location
    Westsiiide
    Posts
    74
    Phone
    Drizzoid
    #7
    Quote Originally Posted by powder View Post
    I haven't used adb for it. That's the plus of ZipThemer, it's a flashable zip. Your phone has to reboot when any framework changes are made anyways, and framework-res.apk changes cannot be made with a file manager to my knowledge.

    I would make your metamorph them like i stated earlier, and use zipthemer to make it an update.zip.

    Your other option is just make it an update.zip yourself if you have a full apk you want put in. There's templates all over the place, it's pretty simple. Or like kevdog said, you can figure out adb. In the end adb will probably be the easiest for pushing any kind of file, an you won't have to worry about updater-scripts and control xml's.
    I like the zipthemer idea.. so how does this sound:

    1. I make my stat_sys_battery.xml edits with calls to the new images
    2. I put together a directory (& give it my name of choice say my10percent) and in it, I have my MM based file in the root
    3. in this directory I also have a directory called framework-res and in that is res and in that are drawable and drawable-hdpi as all of this lines up with the correct names and placement the system expects
    4. in drawable I put the stat_sys_battery.xml file which is where it lives in real life
    5. in drawable-hdpi I put my new pings which is where they live in real life
    6. I zip up this my10percent directory with all of this inside which matches the Systems placement and file/directory names
    7. I put this on my SD card (into MM's "Androidthemes" folder by default for me)
    8. I get this zipthemer and run my10percent.zip file through zipthemer which makes me an update.zip file I can flash
    9. I reboot into recovery, backup my ROM in case, then flash this zipthemer update.zip file

    sounds correct?

    UPDATE: all worked as expected to create the update.zip file with zipthemer BUT upon reboot, I have no battery icons at all and not sure why? I can see the stat_sys_battery.xml is correctly placed in the system/framework/framework-res.apk and is my updated file with my edits, and I can see my pngs files are in place as expected, BUT I get no icons in the notification bar. none at all.

    any idea?

    BTW, here is my stat_sys_battery.xml file - is this the possible issue? It seems right to me.

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <level-list
      xmlns:android="http://schemas.android.com/apk/res/android">
        <item android:drawable="@drawable/stat_sys_battery_0" android:maxLevel="4" />
        <item android:drawable="@drawable/stat_sys_battery_5" android:maxLevel="5" />
        <item android:drawable="@drawable/stat_sys_battery_10" android:maxLevel="10" />
        <item android:drawable="@drawable/stat_sys_battery_15" android:maxLevel="15" />
        <item android:drawable="@drawable/stat_sys_battery_20" android:maxLevel="20" />
        <item android:drawable="@drawable/stat_sys_battery_30" android:maxLevel="30" />
        <item android:drawable="@drawable/stat_sys_battery_40" android:maxLevel="40" />
        <item android:drawable="@drawable/stat_sys_battery_50" android:maxLevel="50" />
        <item android:drawable="@drawable/stat_sys_battery_60" android:maxLevel="60" />
        <item android:drawable="@drawable/stat_sys_battery_70" android:maxLevel="70" />
        <item android:drawable="@drawable/stat_sys_battery_80" android:maxLevel="80" />
        <item android:drawable="@drawable/stat_sys_battery_90" android:maxLevel="90" />
        <item android:drawable="@drawable/stat_sys_battery_100" android:maxLevel="100" />
    </level-list>
    Also, when I rolled back to my original setup, I see via Root Explorer that the stat_sys_battery.xml is in an unreadable format for me, looks like a bunch of binary code. Maybe that is becuase it is correctly "signed" or compiled? Whereas after my install, the stat_sys_battery.xml file was totally readable as seen above when I went and looked... like it was not correctly encoded or compiled?
    Last edited by Lock-N-Load; 02-18-2011 at 06:00 PM.
  9. Junior Droid
    castaway's Avatar
    Member #
    53741
    Join Date
    Apr 2010
    Posts
    14
    Phone
    HTC MAGIC
    #8

    stat_sys_battery.xml

    first of all, i dont want to spam this thread. I just want to read and learn what other say.
    I find this becouse i google for stat_sys_battery.xml and i want make smooth battery like you do. Im using HTC magic that is MDPI so it can be little different.Im stop at problem with apkmanager which sending me error while compiling framework-res.apk back.

    1.question
    my steps to compile and decompile in apkmanager

    1.put framework-res.apk in to "place-apk-here-for-modding" folder
    2.22 as set project
    3.9 decompile
    4.(minimize apkmanager and edit xml in project folder)
    5.11 compile apk
    6.12 sign apk

    is it right? i think theres some step i dont do or i do it wrong?

    2. question
    im editing only stat_sys_battery.xml but im not sure if theres no more files need to be edited becouse after decompiling framework-res.apk i find \res\values\public.xml that contain all png files used in battery icons so im think if edit this too?

    maybe
    framework-res.apk/res/drawable/zzz_stat_sys_battery_1.xml (this one i dont have in my custom ROM becouse its MDPI?)


    I need to know how exactly use apkmanager to do it. So all what i know is DECOMPILE framework-res.apk ->edit stat_sys_battery.xml ->push there missing pngs-> COMPILE it back and flash framework-res.apk

    (BTW what is MM ? )
  10. Master Droid
    kevdog's Avatar
    Member #
    4295
    Join Date
    Nov 2009
    Posts
    722
    Phone
    moto droid
    #9
    castaway

    Your initial steps were right except for step #6.

    What I do at this point at this point is take the newly compiled framework-res.apk (unsigned). Using winrar, I drag and drop all the changed files (any .png you may have changed and .xml files that you may have changed, along with the resources.arsc file) unto the unmodified or original framework-res.apk.

    The reason I do this is that I had a problem with the signing process using apk manager. It always bootlooped for me at least. My dragging and dropping the changed files onto the signed original framework-res.apk however, the original signature was always preserved, and I never experiened a bootloop.

    Hopefully this helps.
  11. Junior Droid
    castaway's Avatar
    Member #
    53741
    Join Date
    Apr 2010
    Posts
    14
    Phone
    HTC MAGIC
    #10
    Quote Originally Posted by kevdog View Post
    castaway

    Your initial steps were right except for step #6.

    What I do at this point at this point is take the newly compiled framework-res.apk (unsigned). Using winrar, I drag and drop all the changed files (any .png you may have changed and .xml files that you may have changed, along with the resources.arsc file) unto the unmodified or original framework-res.apk.

    The reason I do this is that I had a problem with the signing process using apk manager. It always bootlooped for me at least. My dragging and dropping the changed files onto the signed original framework-res.apk however, the original signature was always preserved, and I never experiened a bootloop.

    Hopefully this helps.
    thank you a lot for this!. I was stuck on step 5 so compile(11) send me error message i attach screenshot of it. Anybody know whats problem or how to fix that?

    After many tryes i get unsignedframework-res.apk/drawable/stat_sys_battery.xml compiled and i think ok so i flash it into phone like other of my themes, it boot up normally but battery icon does not apper.There is just clear space....

    I read on web about this a little and one guy say that we need to edit public.xml in values directory.Now i think if i need to modifi and add lines with png names to public.xm that appers when you decompile framework-res.apk and when you compile it back theres no that directory anymore

    So ,becouse now it look like this. logicaly here must be pngs what i add so for status 30-50-70-90 of battery

    HTML Code:
     <public type="drawable" name="stat_sys_adb" id="0x01080290" />
        <public type="drawable" name="stat_sys_battery_0" id="0x01080292" />
        <public type="drawable" name="stat_sys_battery_10" id="0x01080293" />
        <public type="drawable" name="stat_sys_battery_100" id="0x01080294" />
        <public type="drawable" name="stat_sys_battery_20" id="0x01080295" />
        <public type="drawable" name="stat_sys_battery_40" id="0x01080296" />
        <public type="drawable" name="stat_sys_battery_60" id="0x01080297" />
        <public type="drawable" name="stat_sys_battery_80" id="0x01080298" />
        <public type="drawable" name="stat_sys_battery_charge_anim0" id="0x0108029a"
    so i think how to add lines with other pngs like for example

    HTML Code:
    <public type="drawable" name="stat_sys_battery_30" id="0x********" />
    how to calculate id number in it? can i use id number used in other theme with same png name?
    Attached Thumbnails Attached Thumbnails Push edited stat_sys_battery.xml file to phone &amp; have it accepted?-chyba.png  
Page 1 of 4 123 ... LastLast

Links

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Similar Threads

  1. just was accepted into Google app inventor Beta!
    By searayman in forum Android Applications
    Replies: 0
    Last Post: 09-21-2010, 04:03 PM
  2. How to send one song to phone to be edited by ringdroid?
    By rmkleman in forum Android General Discussions
    Replies: 2
    Last Post: 09-09-2010, 12:40 PM
  3. I edited a programs .apk file now it won't load?
    By Branndon in forum Android Hacks and Help
    Replies: 6
    Last Post: 02-19-2010, 12:58 PM
  4. How do I get edited Launcher.apk back onto phone?
    By 19DroidRage84 in forum Android Hacks and Help
    Replies: 5
    Last Post: 01-31-2010, 07:46 PM
  5. Telesales Pre-orders are being accepted now
    By jwd45244 in forum Motorola Droid
    Replies: 14
    Last Post: 11-06-2009, 12:38 PM

Search tags for this page

android battery icon stat sys battery.xml
,

android stat sys battery

,

edit stat sys battery charge .xml

,
edit stat sys battery.xml
,
no resource found that matches the given name (at icon with
,

stat sys battery

,
stat sys battery 20 .png
,
stat sys battery png
,

stat sys battery.xml

,
where are stat sys battery files android
Click on a term to search our site for related topics.
Find us on Google+