FORUMS

Google No Longer Sending Calendar SMS Notifications

In a not entirely surprising move, Google announced that it’s putting an … more

Enable Multi-Window Mode on M Developer Preview

What was not mentioned in yeterday’s keynote was Android M’s multi-window … more

I/O Summary: Google Cardboard Virtual Reality

One year ago, Google introduced cardboard. Amazingly enough, that was all it took to fire … more

Android M Preview Images – XDA TV

Android M preview images are available. That and much more news is covered by Jordan when he … more

[GUIDE][HOW] Add Battery Percentage On Lockscreen Permanently

Thanks Meter: 79
 
Post Reply Subscribe to Thread Email Thread
Here's A New Guide To Add Battery Percentage On Lockscreen


Requirements -:


1. android.policy.jar

2. framework-res.apk


PHP Code:
First,We Edit "framework-res.apk"  present here (system/framework/framework-res.apk)

Decompile framework-res.apk Through Apktool (if you dont know how to decompile,See on XDA How to Decompile,Recompile Or Ask Someone)

After Decompiling -> Go Here 
framework-res/res/values/string.xml

PHP Code:
Open String.xml in Notepad++

After Opening -> Hit These Two Keys (ctrl+f)

And 
Copy This____  Charging  ____  Then Hit Enter

Change The Charging Text To____  Charge Status _____ 
-> After Changing -> Save it

Now,Main Work Here in Smali

PHP Code:
Decompile "android.policy.jar" present here (system/framework/android.policy.jar)

After Decompiling -> Open This smali file Through Notepad++

android.policy/com/android/internal/policy/impl/KeyguardUpdateMonitor.smali

Open   KeyguardUpdateMonitor
.smali

Search 
For This Line Through Notepad++ By Hitting Ctrl+
PHP Code:
.method public shouldShowBatteryInfo()
The Whole Code Looks Like....


PHP Code:
.method public shouldShowBatteryInfo()Z
    
.registers 2

    
.prologue
    
.line 1000
    sget v0
Lcom/android/internal/policy/impl/KeyguardUpdateMonitor;->mBatteryInfoState:I

    
if-eqz v0, :cond_6

    
const/4 v00x1

    
:goto_5
    
return v0

    
:cond_6
    
const/4 v00x0

    
goto :goto_5
.end method 

After Editing It Looks Like....

PHP Code:
.method public shouldShowBatteryInfo()Z
    
.registers 2

    
.prologue
    
.line 1000
    sget v0
Lcom/android/internal/policy/impl/KeyguardUpdateMonitor;->mBatteryInfoState:I

    
if-eqz v0, :cond_6

    
const/4 v00x1

    
:goto_5
    
    
const/4 v00x1
    
    
return v0

    
:cond_6
    
const/4 v00x0

    
goto :goto_5
.end method 

ENJOY.......!!!!!!!!!!

Credits - To Me Kartik Verma@XDA
Last edited by kartik verma; 5th April 2015 at 10:33 AM.
The Following 3 Users Say Thank You to kartik verma For This Useful Post: [ View ]
 
 
3rd August 2014, 05:45 AM |#2  
Member
Thanks Meter: 13
 
More
Thanks Dude , its working 100%
Attached Thumbnails
Click image for larger version

Name:	SC20140802-074131.png
Views:	600
Size:	116.5 KB
ID:	2881574  
3rd August 2014, 05:57 AM |#3  
OP Senior Member
Flag Hamirpur H.P
Thanks Meter: 79
 
More
Quote:
Originally Posted by ZindaqI

Thanks Dude , its working 100%

Adding more stuffs after some tym.
3rd August 2014, 03:28 PM |#4  
Member
Thanks Meter: 13
 
More
Quote:
Originally Posted by kartik verma

Adding more stuffs after some tym.

you can change charge icon to battery icon .. also you can make lockscreen transparent
3rd August 2014, 03:46 PM |#5  
OP Senior Member
Flag Hamirpur H.P
Thanks Meter: 79
 
More
Quote:
Originally Posted by ZindaqI

you can change charge icon to battery icon .. also you can make lockscreen transparent

sorry sir , but i know all about these things.
5th August 2014, 03:01 AM |#6  
tjbearX's Avatar
Senior Member
Flag Balanga, Bataan Philippines
Thanks Meter: 401
 
More
Thumbs up
nice guide bro. keep it up the good work
10th August 2014, 10:10 AM |#7  
jasper~'s Avatar
Senior Member
Flag Laguna
Thanks Meter: 7
 
More
Quote:
Originally Posted by kartik verma

[COLOR="Blue"][SIZE="5"]

PHP Code:
First,We Edit "framework-res.apk"  present here (system/framework/framework-res.apk)

Decompile framework-res.apk Through Apktool (if you dont know how to decompile,See on XDA How to Decompile,Recompile Or Ask Someone)

After Decompiling -> Go Here 
framework-res/res/values/string.xml

PHP Code:
Open String.xml in Notepad++

After Opening -> Hit These Two Keys (ctrl+f)

And 
Copy This____  Charging  ____  Then Hit Enter

Change The Charging Text To____  Charge Status _____ 
-> After Changing -> Save it

I didnt Get this mate. Can you explain?
10th August 2014, 10:54 AM |#8  
OP Senior Member
Flag Hamirpur H.P
Thanks Meter: 79
 
More
Quote:
Originally Posted by jasper~

I didnt Get this mate. Can you explain?

decompile framework-res.apk , open string.xml present in values folder (framework-res/res/values/string.xml)

open it with notepad++ after this Hit 2 button ctrl+f and than type the text "charging" only charging and than hit enter u see an xml line contain charging text change it to "Charge Status"

dont use inverted commas " " there i just use it for highlighting the things
The Following User Says Thank You to kartik verma For This Useful Post: [ View ]
10th August 2014, 03:40 PM |#9  
jasper~'s Avatar
Senior Member
Flag Laguna
Thanks Meter: 7
 
More
Quote:
Originally Posted by kartik verma

decompile framework-res.apk , open string.xml present in values folder (framework-res/res/values/string.xml)

open it with notepad++ after this Hit 2 button ctrl+f and than type the text "charging" only charging and than hit enter u see an xml line contain charging text change it to "Charge Status"

dont use inverted commas " " there i just use it for highlighting the things

Oh thanks bro. I have 1 question, is the battery percent still there when I charge my phone?
10th August 2014, 04:56 PM |#10  
OP Senior Member
Flag Hamirpur H.P
Thanks Meter: 79
 
More
Quote:
Originally Posted by jasper~

Oh thanks bro. I have 1 question, is the battery percent still there when I charge my phone?

it always on your device lockscreen ,if u charge ur device or if not.
Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes