Tampilkan postingan dengan label smali. Tampilkan semua postingan
Tampilkan postingan dengan label smali. Tampilkan semua postingan

force close with JKay Deluxe? try this trick to fix it

just helped my friend to solve his problem. he installed JKay Deluxe 13.2 but he got FC (force close) everytime he pressed the icon. after reading the log file, i tried to see where the problem lies. i decompressed the apk and read the source code in smali and found that the null pointer exception at DeluxeSettings.java line 1976 (or DeluxeSettings$updateSysUI.smali) was caused by the missing 'next_alarm_formatted' entry in the system table, found at /data/data/com.android.providers.settings/databases/settings.db. the lines try to read the value of 'next_alarm_formatted' but not handling null value (missing entry). i then added back an entry with empty value to the database and now it works like a charm!

so if you r facing with similar problem, take a look at your log by ddms (aka dalvik debug monitor) or by adb with the following command if you have the logger module loaded (logger.ko):

adb shell logcat -d | grep jkaysoft

if you find something like:
W/WindowManager( 3342): Window Window{4053d140 Starting com.jkaysoft.gingertheme paused=false} destroyed surface Surface(name=Starting com.jkaysoft.gingertheme, identity=-1, mNativeSurface=0), session Session{407ca078 uid 1000}
E/AndroidRuntime(10191): at com.jkaysoft.gingertheme.DeluxeSettings$updateSysUI.run(DeluxeSettings.java:1976)

then u can easily trace the missing entry at line 1976 (not exactly at line 1976, search for '.line 1976' instead), if you r comfortable with editing or reading the smali files, and add it back to the db with sqlite

anyway, i will report the problem to _JKay_ so just be patient if u dono how to fix it or don wanna read the smali files

remove battery fully charged notification icon and sound

perhaps this is one of the most annoying issues, i cannot understand why we need two icons on the status bar if the battery is fully charged

although there are some how-to already, i wanna show you an alternative way to do it
here is an simplier way to remove the icon (plus the notification sound and screen on when the battery is fully charged if you want to). you can opt to disable all of them, or with any one of them enabled only

*this is for DEODEXED files ONLY!! tested on Android 2.3 KI8 and should work with other versions also


- decompile SystemUI.apk
- open StatusBarPolicy.smali under smali/com/android/systemui/statusbar/policy directory with your favorite text editor
- search for ".method private addFullChargeNotification()V" without quotes
- scroll down a bit and you will find something like:

.line 2300
new-instance v2, Landroid/app/Notification;

const v3, 0x7f02002a

const-wide/16 v4, 0x0

invoke-direct {v2, v3, v1, v4, v5}, Landroid/app/Notification;->(ILjava/lang/CharSequence;J)V

.line 2301
iget v3, v2, Landroid/app/Notification;->flags:I

or-int/lit8 v3, v3, 0x2

iput v3, v2, Landroid/app/Notification;->flags:I

those ".line xxxx" above should be different with yours, and
0x7f02002a is the ID of the battery full icon, you may find it differs and that's fine


for the tweak:

option 1 - replace 0x7f02002a with 0x0

for example, before change:
const v3, 0x7f02002a

after change:
const v3, 0x0


option 2 - add a hash sign (#) before the line const v3, 0x7f02002a and write a new line below it, just in case you want to roll it back

for example, before change:
const v3, 0x7f02002a

after change:
#const v3, 0x7f02002a
const v3, 0x0


also note that the number of hash signs or empty spaces before the line are NOT important!! so all of the lines below are valid:

# const v3, 0x7f02002a
# # const v3, 0x7f02002a
##### const v3, 0x7f02002a




how does this work?

after reading the souce code of Notification.smali, i found that it accepts notification without an icon by calling it with the icon parameter with a zero (which is the 0x0 above)



remove notification sound and screen on
in case you want to remove the notification sound as well, scroll down a bit more and put a # in front of the line as below:

# invoke-direct {p0, v0}, Lcom/android/systemui/statusbar/policy/StatusBarPolicy;->playTone(Landroid/net/Uri;)V



and for the screen on after fully charged, make these changes below the playTone found in above:

# .line 2308
# invoke-direct {p0}, Lcom/android/systemui/statusbar/policy/StatusBarPolicy;->turnOnScreenWithForce()V



to see the result, upload the recompiled SystemUI.apk to /system/app/, and type in adb (no need to reboot/wipe, etc):

kill -HUP `pidof system_server`


and you should notice the changes immediately