TUTORIAL - modding lockscreen/framework-res.apk

Search This thread

eChinz

Senior Member
Apr 29, 2013
94
12
Pasay
pls help me how to change the default lockscreen wallpaper?

i want to put image on lockscreen pls
 

stickman1981

Senior Member
Sep 2, 2012
122
3
I'm having trouble I use 7 zip and put it back on my phone and reboot its still the same all I'm try to add is removed the emergency button

Sent from my LG-P930 using XDA Premium 4 mobile app
 

kennyTSV

Member
Dec 10, 2013
17
1
I'm having trouble I use 7 zip and put it back on my phone and reboot its still the same all I'm try to add is removed the emergency button

Sent from my LG-P930 using XDA Premium 4 mobile app

That's because your phone operating system is probably not looking for 'keyguard_screen_unlock_portrait.xml'. I know that for my phone's ice cream sandwich operating system, the file to edit is actually a different one.... namely 'keyguard_screen_password_portrait.xml'. I wasted a whole bunch of time focusing on 'keyguard_screen_unlock_portrait.xml' (which is the file contained within the Original Poster's zip file at the beginning of this thread)...... and eventually found out for myself through testing that 'keyguard_screen_password_portrait.xml' was actually the relevant file for my ICS operating system. And for your operating system, you will just need to figure out the correct file to edit. A good recommendation is to just do edits on files that have files having NAMES that contain the word 'portrait' in it. So just go to the parts in the files that are related to the emergency call button, and change layout width and heights to "0.0dip". But this is assuming you have a decompiler and compiler to get the files into the formats we need.

Yep....so even though the OP's zip file for removing emergency call button contains "keyguard_screen_unlock_portrait.xml", I know that this file is certainly irrelevant for ice cream sandwich. ICS requires ''keyguard_screen_password_portrait.xml''.
 
Last edited:

lorenzobugay

New member
Aug 6, 2014
2
0
HELP ME

I THINK I BRICKED MY PHONE. IT'S ON BOOTLOOP AND I DONT KNOW WHAT TO DO:crying::crying::crying::crying::crying:
 

Top Liked Posts

  • There are no posts matching your filters.
  • 19
    *I made this before any of these new roms came out and as such it was meant for and has been tested on only the stock Gingerbread rom that comes with the phone. I doubt it will be compatible with the new roms.*

    In response to a request, I am posting a tutorial on how to make a couple lockscreen mods.
    You may want to read my other tutorials first
    Swapping Out PNGs
    Editing XML

    *MY TYPICAL DISCLAIMER!*
    I AM NOT A DEV! I just like tinkering with this phone because I'm overall an extremely picky and obsessive person. I have no prior android experience (besides a little tinkering with my X10), and I am in NO way an expert. But since I know how to mess with my phone a little bit and I've been asked to share, I will =) But follow these instructions at your own risk! I am not responsible for the untimely death of your phone, so please be cautious and careful, and if you have any questions about any step, before you try it, ask me or someone who knows! I don't want the blood of your dead phone on my hands! =)

    These instructions are for Windows computers. Sorry, I'm just not familiar with mac or linux. =(

    **Messing with the lockscreen/framework-res.apk**

    Since modding, to me, is about personalization, I’m going to let you pick and choose whatever particular things you like and leave out the things you don’t like. You can get rid of the carrier, but keep everything else, or just get rid of the dots and emergency button, but keep the carrier cause you just love AT&T so much! Whatever tickles your fancy. Unfortunately, with that flexibility comes a teency bit more work =) So I can’t make a framework-res.apk that you can just put with all the mods for a couple reasons:

    1.) I don’t know which mods you want
    2.) Any other modifications you’ve made to framework-res.apk before will be wiped out if you install one that I upload

    So this way, with a tiny bit more work, you can not only pick and choose what you want, but keep the old changes to framework-res.apk you already love so very much.

    So without further adieu, here’s what I did to the lockscreen:

    I like using the pattern lockscreen for just the touch of security, but I hate how it looks. To me, it's wildly unnecessarily cluttered. So here's what I've done, before and after =)

    lockscreenedits.jpg


    I don't like AT&T plastered on it, the divider line is too harsh, the dots are just completely unnecessary to me (I can estimate a third along each axis, thanks =)), and the emergency call button (albeit practical) is ugly, and I'm shallow. So I changed all of them. The dots will still appear, but only after you press them so you can see that beautiful wallpaper of yours while your phone is locked. This included 4 modifications:

    1. Removed carrier (edited XML)
    2. Lightened divider to almost invisible (I like just a touch of it =)) (edited PNG)
    3. Removed dots (edited PNG)
    4. Removed emergency call button (edited XML)

    Don't worry. The emergency call button (along with the "forgot pattern" button) still returns after you've failed to enter the correct pattern multiple times:

    Lockscreen-clean-forgot.jpg


    So let’s get started!

    **What you’ll need**
    1.) Root explorer from the market with root permissions! (I DO NOT suggest an alternative file explorer ESPECIALLY since this mod requires messing with framework-res.apk, the easiest way to brick your phone! And I know other file explorers like ES file explorer will brick your phone if you try to mess with framework-res.apk in this way!)
    2.) 7zip or some kind of zip manager for your computer

    **What to do**
    1.) Using root explorer with root permissions, COPY (don’t MOVE!) framework-res.apk from your phone (in \system\framework\framework-res.apk) to your sd card, and then to your computer. Keep a copy safe somewhere else as a backup in case you want to revert back to your original framework-res.apk!

    Decide what mods you want! Here’s the list again:

    1. Removed carrier (edited XML)
    2. Lightened divider to almost invisible (I like just a touch of it =)) (edited PNG)
    3. Removed dots (edited PNG)
    4. Removed emergency call button (edited XML)

    If you want the invisible dots or the lightened divider, download the attached “PNGS- lockscreen.zip” from the end of this thread.

    If you want either the removed carrier or the removed emergency call button, download the ONE XML you want! (If you only want to remove the carrier, only download “XML- no carrier.zip.” If you only want to remove the emergency button, only download “XML- no emergency call button.zip.” If you want both, download “XML- no carrier AND no emergency call button.zip.” You can only use ONE XML. If you try to use more than one, they will just overwrite each other since they’re just different modifications of the same XML file!)

    2.) Unzip whichever zips you downloaded onto your computer
    3.) Right click on your framework-res.apk from your phone, 7zip-> open archive (do not extract!)
    4.) Drag and drop all the unzipped PNGS you downloaded (if any) into \res\drawable-xhdpi in framework-res.apk. Let them overwrite the originals in that folder.
    5.) Drag and drop the unzipped XML you downloaded into \res\layout in framework-res.apk, and let it overwrite the original.
    6.) Move your newly modified framework-res.apk back onto your sd card
    7.) Copy it to \system\
    8.) Using root explorer, change permissions for framework-res.apk to owner: read AND write, group: read, others: read! This step is CRITICAL!
    9.) Move it into \system\framework and let it overwrite the original framework-res.apk!
    10.) Restart your phone!

    Upon startup, you should see your new changes! You can also edit the PNGs however you like, if you want to change the dots to something else, or want a big blue divider or whatever. =)
    All the XML edits I did were as explained in my editing XML tutorial, but if anyone wants more details or what values in particular I modified, I’d be happy to go through them!
    If you need help using root explorer to change permissions, etc, I have more details in my other tutorials listed at the top of this entry.

    If you have ANY questions or need more details, before you do anything, PLEASE check my other tutorials or just ask! =)
    2
    Deleting lines usually made things crash and burn, so I just cheated and changed widths/sizes to 0

    To remove carrier (lines 8 and 9), after:
    android:id="@id/carrier", changed android:layout_height to "0.0dip"
    android:id="@id/carrier_sub2", changed android:layout_height to "0.0dip"

    To remove emergency buttons, in the section just above android:id="@id/emergencyCallAlone" (line 24) shown here:

    <RelativeLayout android:id="@id/footerNormal" android:layout_width="fill_parent" android:layout_height="fill_parent">
    <Button android:textSize="18.0sp" android:textStyle="bold" android:id="@id/emergencyCallAlone" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/lockscreen_emergency_call" android:drawableLeft="@drawable/ic_emergency" android:drawablePadding="8.0dip" android:layout_centerInParent="true" style="@style/Widget.Button.Transparent" />
    </RelativeLayout>

    Changed the first android:layout_height to "0.0dip"


    Hope it helps. And no, I don't hate thanks of any kind. =) You'd be surprised how many just demand
    1
    Worked perfectly! Thanks, it looks so much better than before imo!
    1
    I'm pretty sure this is only for stock roms.
    1
    Update 763: I can't locate the graphic for the grey bar that links the pattern circles. If anyone knows, please feel free :) UNless it's some kind of java routine or css hoopla.

    I found it!! =) It's in the smali com/android/internal/widget/LockPatternView.smali, .line 266 and .line 835, there are settings for color (in hexadecimal) and alpha/transparency (also hex). I thought I'd touch up my lock pattern lines =)

    from
    lines.png


    to invisible lines (alpha set to "0x0")
    arrows.png