ToqAN Fixes Android 5.0 Notification Bug on Qualcomm Toq

The Qualcomm Toq is probably one of the lesser known smartwatches on the market … more

How to Root and Unlock the Google Nexus 6 on a Mac – XDA TV

In the past, XDA Developer TV Producer droidmodd3rx has shown you how to … more

Set Up Your MediaTek Device with Comprehensive Beginner’s Guide

As can be seen with the use of MediaTek chips in Android One devices … more

Sony Updates AOSP Sources to Android 5.0.1

Just a few days ago, Sony did an utterly fantastic job by pushing out numerous device trees for … more

Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

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

OP kartik verma

2nd August 2014, 02:55 PM   |  #1  
OP Senior Member
Flag Hamirpur H.P
Thanks Meter: 76
 
154 posts
Join Date:Joined: Dec 2013
More
Here's A New Guide To Add Battery Percentage On Lockscreen

By Me [Kartik Verma]


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.......!!!!!!!!!!
Last edited by kartik verma; 2nd August 2014 at 02:57 PM.
The Following 3 Users Say Thank You to kartik verma For This Useful Post: [ View ]
3rd August 2014, 06:45 AM   |  #2  
Member
Thanks Meter: 13
 
58 posts
Join Date:Joined: Mar 2013
Thanks Dude , its working 100%
Attached Thumbnails
Click image for larger version

Name:	SC20140802-074131.png
Views:	408
Size:	116.5 KB
ID:	2881574  
3rd August 2014, 06:57 AM   |  #3  
OP Senior Member
Flag Hamirpur H.P
Thanks Meter: 76
 
154 posts
Join Date:Joined: Dec 2013
More
Quote:
Originally Posted by ZindaqI

Thanks Dude , its working 100%

Adding more stuffs after some tym.
3rd August 2014, 04:28 PM   |  #4  
Member
Thanks Meter: 13
 
58 posts
Join Date:Joined: Mar 2013
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, 04:46 PM   |  #5  
OP Senior Member
Flag Hamirpur H.P
Thanks Meter: 76
 
154 posts
Join Date:Joined: Dec 2013
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, 04:01 AM   |  #6  
tjbearX's Avatar
Senior Member
Flag Balanga, Bataan Philippines
Thanks Meter: 401
 
401 posts
Join Date:Joined: Dec 2012
More
Thumbs up
nice guide bro. keep it up the good work
10th August 2014, 11:10 AM   |  #7  
jasper~'s Avatar
Senior Member
Flag Laguna
Thanks Meter: 6
 
126 posts
Join Date:Joined: May 2014
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, 11:54 AM   |  #8  
OP Senior Member
Flag Hamirpur H.P
Thanks Meter: 76
 
154 posts
Join Date:Joined: Dec 2013
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, 04:40 PM   |  #9  
jasper~'s Avatar
Senior Member
Flag Laguna
Thanks Meter: 6
 
126 posts
Join Date:Joined: May 2014
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, 05:56 PM   |  #10  
OP Senior Member
Flag Hamirpur H.P
Thanks Meter: 76
 
154 posts
Join Date:Joined: Dec 2013
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