Related
1.MMS mod
2.Add 2G/3G toggle
3.CRT Animation toggle
4.Improve Sweep to Remove Notification
5.Long Press Volume Button to skip Song
6.Hack FM Radio
7.Make Option for Date style on Status Bar
8.Mod TouchWiz 3
Touchwiz 3 modded for example
Add MMS skin chooser
Need: stock Mms.apk + APKMulti tools + Notepad plus
Step:
1-decompile Mms.apk
2-go to ../res/xml/
open mms_config.xml
change the number to what ever you want.
2.1 Change limit contact to send
Code:
<int name="recipientLimit">10</int>
2.2 CHange limit of converting to MMS
Code:
<int name="smsToMmsTextThreshold">4</int>
3.Enable skin chooser
go to ../res/xml/
open preferences.xml
add this after the 3rd line
Code:
<ListPreference android:entries="@array/pref_entries_message_skin" android:title="@string/pref_title_message_skin" android:key="pref_key_message_skin" android:defaultValue="Default" android:dialogTitle="@string/pref_dialog_title_message_skin" android:entryValues="@array/pref_entry_values_message_skin" />
go to ../smali/com/android/mms/ui/
Open MessagingPreferenceActivity.smali
Find this
Code:
.method public static getMessageSkin(Landroid/content/Context;)I
.registers 2
.parameter "context"
.prologue
.line 631
const/4 v0, 0x0
return v0
.end method
change to this
Code:
.method public static getMessageSkin(Landroid/content/Context;)I
.locals 6
.parameter "context"
.prologue
.line 631
const/4 v4, 0x0
const-string v5, "Default"
.line 578
invoke-static {p0}, Landroid/preference/PreferenceManager;->getDefaultSharedPreferences(Landroid/content/Context;)Landroid/content/SharedPreferences;
move-result-object v0
.line 579
.local v0, pref:Landroid/content/SharedPreferences;
const-string v2, "pref_key_message_skin"
const-string v3, "Default"
invoke-interface {v0, v2, v5}, Landroid/content/SharedPreferences;->getString(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
move-result-object v1
.line 580
.local v1, skinType:Ljava/lang/String;
const-string v2, "Default"
invoke-virtual {v5, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v2
if-eqz v2, :cond_0
move v2, v4
.line 591
:goto_0
return v2
.line 582
:cond_0
const-string v2, "Edge"
invoke-virtual {v2, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v2
if-eqz v2, :cond_1
.line 583
const/4 v2, 0x1
goto :goto_0
.line 584
:cond_1
const-string v2, "Gloss"
invoke-virtual {v2, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v2
if-eqz v2, :cond_2
.line 585
const/4 v2, 0x2
goto :goto_0
.line 586
:cond_2
const-string v2, "Sticker note"
invoke-virtual {v2, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v2
if-eqz v2, :cond_3
.line 587
const/4 v2, 0x3
goto :goto_0
.line 588
:cond_3
const-string v2, "Memo"
invoke-virtual {v2, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v2
if-eqz v2, :cond_4
.line 589
const/4 v2, 0x4
goto :goto_0
:cond_4
move v2, v4
.line 591
goto :goto_0
.end method
Recompile your Mms.apk
Here Mms.apk( base on DXKT3 but all stock deodexed rom can use) i made with limit sending contact is 500, convert to MMS at 500 of course with skin enable.
End tut. Thank you for watching boring show
Add 2G/3G toggle to lidroid toggle bar
First go here and mod your Phone.apk
http://forum.xda-developers.com/showthread.php?t=1731187
At 2. Register the Receiver at runtime through Phone Application smali file
there are 2 options
1- for resigned rom
2- for stock
If your rom is resigned just open Androidmanifest.xml and add
Code:
<receiver android:name="NetworkModeReceiver">
<intent-filter>
<action android:name="com.android.phone.CHANGE_NETWORK_MODE" />
<action android:name="com.android.phone.NEW_NETWORK_MODE" />
</intent-filter>
</receiver>
If not just continue the guide above.
Dont recompile it. You can do some other modification.
Open /res/values/bools.xml and modify what you need.
Code:
<resources>
<bool name="ignore_sim_network_locked_events">false</bool>
<bool name="ignore_perso_locked_events">false</bool>
<bool name="sim_network_unlock_allow_dismiss">true</bool>
<bool name="icc_perso_unlock_allow_dismiss">true</bool>
<bool name="allow_incoming_call_touch_ui">true</bool>
<bool name="allow_in_call_touch_ui">true</bool>
The funniest thing
[COLOR="Red"]<bool name="world_phone">true</bool>[/COLOR]
<bool name="config_enable_dialer_key_vibration">true</bool>
<bool name="tty_enabled">true</bool>
<bool name="hac_enabled">true</bool>
<bool name="dtmf_type_enabled">true</bool>
<bool name="auto_retry_enabled">false</bool>
<bool name="allow_local_dtmf_tones">true</bool>
<bool name="allow_back_key_to_reject_incoming_call">true</bool>
<bool name="config_show_onscreen_dial_button">true</bool>
<bool name="send_mic_mute_to_AudioManager">true</bool>
<bool name="has_in_call_noise_suppression">true</bool>
<bool name="allow_menu_proximity_sensor">true</bool>
</resources>
Recompile Phone.apk
Prepare resource for Network Mode toggle. Decomile lidroid-res.pak
Add 3 images to lidroid-res( for 2G only,3G only and 2G&3G)
Depend on your image size you can put it in drawable-hdpi,mdpi,ldpi...
90x90 put in hdpi, 60x60 put in mdpi, 45x45 put in ldpi
Recompile lidroid-res.apk
Decompile lidroid-res.apk and take ID of 3 image above from public.xml
Next step for rom has 15 toggle bar
Decompile SystemUI.apk
Download quickpanel.rar
Extract to SystemUI.apk/smali/com/lidroid/systemui/quickpanel/
Open NetworkModebutton.smali, change all my resource ID to your
0x30b003f : Text display under toggle. If you use original lidroid-res. It doesnt change
0x3020102 : 2G&3G image ID
0x3020101 : 2G image ID
0x3020103 : 3G image ID
Recompile SystemUI.apk
Download modified QuickpanelSettings.apk support 16 toggle
Copy back to your phone an restart
How to test if toggle work
Open dialer pad
input
Code:
*#*#4636#*#*
Choose Phone Information
scroll to the end you will see a dropdown box display current network
press back button
now change network toggle
Again comeback to PhoneInformation and see if network change
Refine wilfredcool007 CRT animation Guide
Original thread
http://forum.xda-developers.com/showthread.php?t=1533255
Decompile services.jar
No need to change anything in PowerManagerService.smali
open PowerManagerService$BrightnessState
Search
Code:
invoke-static {v0, v1}, Lcom/android/server/PowerManagerService;->access$4700(Lcom/android/server/PowerManagerService;I)I
lookdown several line, after
Code:
.end method
add
Code:
.method private getScreenAnimationMode(Landroid/content/Context;)I
.registers 7
.parameter "context"
.prologue
const v0, 0x0
const v3, 0x1
const v4, 0x10
invoke-virtual {p1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v1
const-string v2, "config_beam_screen_on"
invoke-static {v1, v2, v3}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v2
if-eqz v2, :cond_22
const v0, 0x1
:goto_18
const-string v2, "config_beam_screen_off"
invoke-static {v1, v2, v3}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v2
if-eqz v2, :cond_21
add-int/2addr v0, v4
:cond_21
return v0
:cond_22
const v0, 0x0
goto :goto_18
.end method
Find
Code:
.method public run()V
After
Code:
.prologue
const/4 v8, 0x0
add
Code:
.line 2078
iget-object v4, p0, Lcom/android/server/PowerManagerService$BrightnessState;->this$0:Lcom/android/server/PowerManagerService;
invoke-static {v4}, Lcom/android/server/PowerManagerService;->[COLOR="Blue"]access$3400[/COLOR](Lcom/android/server/PowerManagerService;)Landroid/content/Context;
move-result-object v4
invoke-direct {p0, v4}, Lcom/android/server/PowerManagerService$BrightnessState;->getScreenAnimationMode(Landroid/content/Context;)I
move-result v4
if-nez v4, [COLOR="blue"]:cond_2f[/COLOR]
Go to the end of this method
Above
Code:
goto :goto_4e
.end method
add
Code:
iget-object v6, p0, Lcom/android/server/PowerManagerService$BrightnessState;->this$0:Lcom/android/server/PowerManagerService;
invoke-static {v6}, Lcom/android/server/PowerManagerService;->[COLOR="blue"]access$3400[/COLOR](Lcom/android/server/PowerManagerService;)Landroid/content/Context;
move-result-object v6
invoke-direct {p0, v6}, Lcom/android/server/PowerManagerService$BrightnessState;->getScreenAnimationMode(Landroid/content/Context;)I
move-result v6
Recompile services.jar
Enable CRT animation from framework-res.apk
Make Check box to control CRT effect in Settings.apk
Decompile Settings.apk
Open Settings.apk/res/xml/display_settings.xml
under
Code:
<PreferenceScreen android:title="@string/g_sensor_title" android:key="g_sensor" android:summary="@string/g_sensor_summary">
<intent android:targetPackage="com.android.settings" android:action="android.intent.action.MAIN" android:targetClass="com.android.settings.GSensorSettings" />
</PreferenceScreen>
add
Code:
<PreferenceCategory android:title="CRT Animation Control">
<CheckBoxPreference android:title="Use CRT Effect when turn on screen" android:key="config_beam_screen_on" android:defaultValue="true" android:summaryOn="Enabled" android:summaryOff="Disabled" />
<CheckBoxPreference android:title="Use CRT Effect when turn off screen" android:key="config_beam_screen_off" android:defaultValue="true" android:summaryOn="Enabled" android:summaryOff="Disabled" />
</PreferenceCategory>
Recompile Settings.apk
Maybe need change build.prob to get CRT work
open /system/build.prob
Comment(#) or del line
Code:
debug.sf.hw=1
Improve Sweep to Remove
Original thread
http://forum.xda-developers.com/showthread.php?t=1691397
1. If your rom has Sweep to Remove
Decompile SystemUI.apk
Open /smali/com/android/systemui/statusbar/ExpandedView.smali
add under # instance fields
Code:
.field mTouchDispatcher:Lcom/android/systemui/statusbar/ItemTouchDispatcher;
add this method to the end
Code:
.method public onInterceptTouchEvent(Landroid/view/MotionEvent;)Z
.locals 1
.parameter "event"
.prologue
.line 51
iget-object v0, p0, Lcom/android/systemui/statusbar/ExpandedView;->mTouchDispatcher:Lcom/android/systemui/statusbar/ItemTouchDispatcher;
invoke-virtual {v0, p1}, Lcom/android/systemui/statusbar/ItemTouchDispatcher;->needsInterceptTouch(Landroid/view/MotionEvent;)Z
move-result v0
if-eqz v0, :cond_0
.line 52
const/4 v0, 0x1
.line 54
:goto_0
return v0
:cond_0
invoke-super {p0, p1}, Landroid/widget/LinearLayout;->onInterceptTouchEvent(Landroid/view/MotionEvent;)Z
move-result v0
goto :goto_0
.end method
.method public onTouchEvent(Landroid/view/MotionEvent;)Z
.locals 2
.parameter "event"
.prologue
.line 59
iget-object v1, p0, Lcom/android/systemui/statusbar/ExpandedView;->mTouchDispatcher:Lcom/android/systemui/statusbar/ItemTouchDispatcher;
invoke-virtual {v1, p1}, Lcom/android/systemui/statusbar/ItemTouchDispatcher;->handleTouchEvent(Landroid/view/MotionEvent;)Z
move-result v0
.line 61
.local v0, handled:Z
invoke-super {p0, p1}, Landroid/widget/LinearLayout;->onTouchEvent(Landroid/view/MotionEvent;)Z
move-result v1
if-eqz v1, :cond_0
.line 62
const/4 v0, 0x1
.line 65
:cond_0
return v0
.end method
Save
Delete LatestItemContainer$1.smali and LatestItemContainer.smali
Download statusbar.rar and extract to /smali/com/android/systemui/statusbar/
Edit StatusBarService.smali
Add under # instance fields
Code:
.field mTouchDispatcher:Lcom/android/systemui/statusbar/ItemTouchDispatcher;
In .method private makeStatusBarView
above
Code:
const v8, 0x1050005
invoke-virtual {v5, v8}, Landroid/content/res/Resources;->getDimensionPixelSize(I)I
add
Code:
new-instance v6, Lcom/android/systemui/statusbar/ItemTouchDispatcher;
invoke-direct {v6, p0}, Lcom/android/systemui/statusbar/ItemTouchDispatcher;-><init>(Landroid/content/Context;)V
iput-object v6, p0, Lcom/android/systemui/statusbar/StatusBarService;->mTouchDispatcher:Lcom/android/systemui/statusbar/ItemTouchDispatcher;
above
Code:
const v8, 0x7f030004
invoke-static {p1, v8, v10}, Landroid/view/View;->inflate(Landroid/content/Context;ILandroid/view/ViewGroup;)Landroid/view/View;
add
Code:
iget-object v6, p0, Lcom/android/systemui/statusbar/StatusBarService;->mTouchDispatcher:Lcom/android/systemui/statusbar/ItemTouchDispatcher;
iput-object v6, v2, Lcom/android/systemui/statusbar/ExpandedView;->mTouchDispatcher:Lcom/android/systemui/statusbar/ItemTouchDispatcher;
Replace method makeNotificationView ( from begin to end)
with modified
Code:
.method makeNotificationView(Lcom/android/internal/statusbar/StatusBarNotification;Landroid/view/ViewGroup;)[Landroid/view/View;
.locals 19
.parameter "notification"
.parameter "parent"
.prologue
const/4 v4, 0x0
const/4 v5, 0x0
.line 574
move-object/from16 v0, p1
iget-object v0, v0, Lcom/android/internal/statusbar/StatusBarNotification;->notification:Landroid/app/Notification;
move-object/from16 v16, v0
.line 575
.local v16, n:Landroid/app/Notification;
move-object/from16 v0, v16
iget-object v0, v0, Landroid/app/Notification;->contentView:Landroid/widget/RemoteViews;
move-object/from16 v17, v0
.line 576
.local v17, remoteViews:Landroid/widget/RemoteViews;
if-nez v17, :cond_0
.line 577
.line 611
:goto_0
return-object v4
.line 581
:cond_0
const-string v4, "layout_inflater"
move-object/from16 v0, p0
move-object v1, v4
invoke-virtual {v0, v1}, Lcom/android/systemui/statusbar/StatusBarService;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
move-result-object v15
check-cast v15, Landroid/view/LayoutInflater;
.line 582
.local v15, inflater:Landroid/view/LayoutInflater;
const v4, 0x7f030008
move-object v0, v15
move v1, v4
move-object/from16 v2, p2
move v3, v5
invoke-virtual {v0, v1, v2, v3}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;Z)Landroid/view/View;
move-result-object v18
check-cast v18, Lcom/android/systemui/statusbar/LatestItemContainer;
.local v18, row:Lcom/android/systemui/statusbar/LatestItemContainer;
move-object/from16 v0, v16
iget v0, v0, Landroid/app/Notification;->flags:I
move v4, v0
and-int/lit8 v4, v4, 0x2
if-nez v4, :cond_1
move-object/from16 v0, v16
iget v0, v0, Landroid/app/Notification;->flags:I
move v4, v0
and-int/lit8 v4, v4, 0x20
if-nez v4, :cond_1
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/systemui/statusbar/StatusBarService;->mTouchDispatcher:Lcom/android/systemui/statusbar/ItemTouchDispatcher;
move-object v4, v0
new-instance v5, Lcom/android/systemui/statusbar/StatusBarService$7;
move-object v0, v5
move-object/from16 v1, p0
move-object/from16 v2, p1
invoke-direct {v0, v1, v2}, Lcom/android/systemui/statusbar/StatusBarService$7;-><init>(Lcom/android/systemui/statusbar/StatusBarService;Lcom/android/internal/statusbar/StatusBarNotification;)V
move-object/from16 v0, v18
move-object v1, v4
move-object v2, v5
invoke-virtual {v0, v1, v2}, Lcom/android/systemui/statusbar/LatestItemContainer;->setOnSwipeCallback(Lcom/android/systemui/statusbar/ItemTouchDispatcher;Ljava/lang/Runnable;)V
:cond_1
const v4, 0x7f090024
move-object/from16 v0, v18
move v1, v4
invoke-virtual {v0, v1}, Lcom/android/systemui/statusbar/LatestItemContainer;->findViewById(I)Landroid/view/View;
move-result-object v10
check-cast v10, Landroid/view/ViewGroup;
.line 586
.local v10, content:Landroid/view/ViewGroup;
const/high16 v4, 0x6
invoke-virtual {v10, v4}, Landroid/view/ViewGroup;->setDescendantFocusability(I)V
.line 587
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/systemui/statusbar/StatusBarService;->mFocusChangeListener:Landroid/view/View$OnFocusChangeListener;
move-object v4, v0
invoke-virtual {v10, v4}, Landroid/view/ViewGroup;->setOnFocusChangeListener(Landroid/view/View$OnFocusChangeListener;)V
.line 588
move-object/from16 v0, v16
iget-object v0, v0, Landroid/app/Notification;->contentIntent:Landroid/app/PendingIntent;
move-object v6, v0
.line 589
.local v6, contentIntent:Landroid/app/PendingIntent;
if-eqz v6, :cond_2
.line 590
new-instance v4, Lcom/android/systemui/statusbar/StatusBarService$Launcher;
move-object/from16 v0, p1
iget-object v0, v0, Lcom/android/internal/statusbar/StatusBarNotification;->pkg:Ljava/lang/String;
move-object v7, v0
move-object/from16 v0, p1
iget-object v0, v0, Lcom/android/internal/statusbar/StatusBarNotification;->tag:Ljava/lang/String;
move-object v8, v0
move-object/from16 v0, p1
iget v0, v0, Lcom/android/internal/statusbar/StatusBarNotification;->id:I
move v9, v0
move-object/from16 v5, p0
invoke-direct/range {v4 .. v9}, Lcom/android/systemui/statusbar/StatusBarService$Launcher;-><init>(Lcom/android/systemui/statusbar/StatusBarService;Landroid/app/PendingIntent;Ljava/lang/String;Ljava/lang/String;I)V
invoke-virtual {v10, v4}, Landroid/view/ViewGroup;->setOnClickListener(Landroid/view/View$OnClickListener;)V
.line 594
:cond_2
const/4 v13, 0x0
.line 595
.local v13, expanded:Landroid/view/View;
const/4 v12, 0x0
.line 597
.local v12, exception:Ljava/lang/Exception;
:try_start_0
move-object/from16 v0, v17
move-object/from16 v1, p0
move-object v2, v10
invoke-virtual {v0, v1, v2}, Landroid/widget/RemoteViews;->apply(Landroid/content/Context;Landroid/view/ViewGroup;)Landroid/view/View;
:try_end_0
.catch Ljava/lang/RuntimeException; {:try_start_0 .. :try_end_0} :catch_0
move-result-object v13
.line 602
:goto_1
if-nez v13, :cond_3
.line 603
new-instance v4, Ljava/lang/StringBuilder;
invoke-direct {v4}, Ljava/lang/StringBuilder;-><init>()V
move-object/from16 v0, p1
iget-object v0, v0, Lcom/android/internal/statusbar/StatusBarNotification;->pkg:Ljava/lang/String;
move-object v5, v0
invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v4
const-string v5, "/0x"
invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v4
move-object/from16 v0, p1
iget v0, v0, Lcom/android/internal/statusbar/StatusBarNotification;->id:I
move v5, v0
invoke-static {v5}, Ljava/lang/Integer;->toHexString(I)Ljava/lang/String;
move-result-object v5
invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v4
invoke-virtual {v4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v14
.line 604
.local v14, ident:Ljava/lang/String;
const-string v4, "StatusBarService"
new-instance v5, Ljava/lang/StringBuilder;
invoke-direct {v5}, Ljava/lang/StringBuilder;-><init>()V
const-string v6, "couldn\'t inflate view for notification "
.end local v6 #contentIntent:Landroid/app/PendingIntent;
invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v5
invoke-virtual {v5, v14}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v5
invoke-virtual {v5}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v5
invoke-static {v4, v5, v12}, Landroid/util/Slog;->e(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
.line 605
const/4 v4, 0x0
goto/16 :goto_0
.line 599
.end local v14 #ident:Ljava/lang/String;
.restart local v6 #contentIntent:Landroid/app/PendingIntent;
:catch_0
move-exception v11
.line 600
.local v11, e:Ljava/lang/RuntimeException;
move-object v12, v11
goto :goto_1
.line 607
.end local v11 #e:Ljava/lang/RuntimeException;
:cond_3
invoke-virtual {v10, v13}, Landroid/view/ViewGroup;->addView(Landroid/view/View;)V
.line 608
const/4 v4, 0x1
move-object/from16 v0, v18
move v1, v4
invoke-virtual {v0, v1}, Lcom/android/systemui/statusbar/LatestItemContainer;->setDrawingCacheEnabled(Z)V
.line 611
const/4 v4, 0x3
new-array v4, v4, [Landroid/view/View;
const/4 v5, 0x0
aput-object v18, v4, v5
const/4 v5, 0x1
aput-object v10, v4, v5
const/4 v5, 0x2
aput-object v13, v4, v5
goto/16 :goto_0
.end method
Recompile systemUI.apk
2. If your rom dont have Sweep to Remove
Go here first
http://forum.xda-developers.com/showthread.php?t=1483193 then comeback to this guide
Long press Volume to skip song
original thread
http://forum.xda-developers.com/showthread.php?t=1257260
Decompile android.policy.jar
go to /com/android/internal/policy/impl/
make 2 new text document, rename it to
Code:
PhoneWindowManager$12.smali
PhoneWindowManager$13.smali
Open PhoneWindowManager$12.smali
paste this
Code:
.class Lcom/android/internal/policy/impl/PhoneWindowManager$12;
.super Ljava/lang/Object;
.source "PhoneWindowManager.java"
# interfaces
.implements Ljava/lang/Runnable;
# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
value = Lcom/android/internal/policy/impl/PhoneWindowManager;
.end annotation
.annotation system Ldalvik/annotation/InnerClass;
accessFlags = 0x0
name = null
.end annotation
# instance fields
.field final synthetic this$0:Lcom/android/internal/policy/impl/PhoneWindowManager;
# direct methods
.method constructor <init>(Lcom/android/internal/policy/impl/PhoneWindowManager;)V
.registers 2
.parameter
.prologue
iput-object p1, p0, Lcom/android/internal/policy/impl/PhoneWindowManager$12;->this$0:Lcom/android/internal/policy/impl/PhoneWindowManager;
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
return-void
.end method
# virtual methods
.method public run()V
.registers 3
.prologue
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager$12;->this$0:Lcom/android/internal/policy/impl/PhoneWindowManager;
const/4 v1, 0x1
iput-boolean v1, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsLongPress:Z
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager$12;->this$0:Lcom/android/internal/policy/impl/PhoneWindowManager;
const/16 v1, 0x57
invoke-virtual {v0, v1}, Lcom/android/internal/policy/impl/PhoneWindowManager;->sendMediaButtonEvent(I)V
return-void
.end method
Open PhoneWindowManager$13.smali
paste this
Code:
.class Lcom/android/internal/policy/impl/PhoneWindowManager$13;
.super Ljava/lang/Object;
.source "PhoneWindowManager.java"
# interfaces
.implements Ljava/lang/Runnable;
# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
value = Lcom/android/internal/policy/impl/PhoneWindowManager;
.end annotation
.annotation system Ldalvik/annotation/InnerClass;
accessFlags = 0x0
name = null
.end annotation
# instance fields
.field final synthetic this$0:Lcom/android/internal/policy/impl/PhoneWindowManager;
# direct methods
.method constructor <init>(Lcom/android/internal/policy/impl/PhoneWindowManager;)V
.registers 2
.parameter
.prologue
iput-object p1, p0, Lcom/android/internal/policy/impl/PhoneWindowManager$13;->this$0:Lcom/android/internal/policy/impl/PhoneWindowManager;
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
return-void
.end method
# virtual methods
.method public run()V
.registers 3
.prologue
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager$13;->this$0:Lcom/android/internal/policy/impl/PhoneWindowManager;
const/4 v1, 0x1
iput-boolean v1, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsLongPress:Z
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager$13;->this$0:Lcom/android/internal/policy/impl/PhoneWindowManager;
const/16 v1, 0x58
invoke-virtual {v0, v1}, Lcom/android/internal/policy/impl/PhoneWindowManager;->sendMediaButtonEvent(I)V
return-void
.end method
Open PhoneWindowManager.smali
In # static fields
add
Code:
.field private static final LONG_PRESS_TIMEOUT:I = 0x3e8[COLOR="Blue"]/*=1000ms in hex*/[/COLOR]
in # instance fields
add
Code:
.field mIsLongPress:Z
.field mVolumeDownLongPress:Ljava/lang/Runnable;
.field mVolumeUpLongPress:Ljava/lang/Runnable;
find
Code:
.method public constructor <init>()V
go to the end of this method above
Code:
.line 2855
return-void
.end method
add
Code:
new-instance v0, Lcom/android/internal/policy/impl/PhoneWindowManager$12;
invoke-direct {v0, p0}, Lcom/android/internal/policy/impl/PhoneWindowManager$12;-><init>(Lcom/android/internal/policy/impl/PhoneWindowManager;)V
iput-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolumeUpLongPress:Ljava/lang/Runnable;
new-instance v0, Lcom/android/internal/policy/impl/PhoneWindowManager$13;
invoke-direct {v0, p0}, Lcom/android/internal/policy/impl/PhoneWindowManager$13;-><init>(Lcom/android/internal/policy/impl/PhoneWindowManager;)V
iput-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolumeDownLongPress:Ljava/lang/Runnable;
add this to the end of file
Code:
.method handleVolumeLongPress(I)V
.registers 6
.parameter "keycode"
.prologue
const/16 v1, 0x18
if-ne p1, v1, :cond_f
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolumeUpLongPress:Ljava/lang/Runnable;
.local v0, btnHandler:Ljava/lang/Runnable;
:goto_6
iget-object v1, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHandler:Landroid/os/Handler;
sget v2, Lcom/android/internal/policy/impl/PhoneWindowManager;->LONG_PRESS_TIMEOUT:I
int-to-long v2, v2
invoke-virtual {v1, v0, v2, v3}, Landroid/os/Handler;->postDelayed(Ljava/lang/Runnable;J)Z
return-void
.end local v0 #btnHandler:Ljava/lang/Runnable;
:cond_f
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolumeDownLongPress:Ljava/lang/Runnable;
.restart local v0 #btnHandler:Ljava/lang/Runnable;
goto :goto_6
.end method
.method handleVolumeLongPressAbort()V
.registers 3
.prologue
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHandler:Landroid/os/Handler;
iget-object v1, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolumeUpLongPress:Ljava/lang/Runnable;
invoke-virtual {v0, v1}, Landroid/os/Handler;->removeCallbacks(Ljava/lang/Runnable;)V
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHandler:Landroid/os/Handler;
iget-object v1, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolumeDownLongPress:Ljava/lang/Runnable;
invoke-virtual {v0, v1}, Landroid/os/Handler;->removeCallbacks(Ljava/lang/Runnable;)V
return-void
.end method
.method protected sendMediaButtonEvent(I)V
.registers 15
.parameter "code"
.prologue
invoke-static {}, Landroid/os/SystemClock;->uptimeMillis()J
move-result-wide v1
.local v1, eventtime:J
new-instance v11, Landroid/content/Intent;
const-string v4, "android.intent.action.MEDIA_BUTTON"
const/4 v5, 0x0
invoke-direct {v11, v4, v5}, Landroid/content/Intent;-><init>(Ljava/lang/String;Landroid/net/Uri;)V
.local v11, downIntent:Landroid/content/Intent;
new-instance v0, Landroid/view/KeyEvent;
const/4 v5, 0x0
const/4 v7, 0x0
move-wide v3, v1
move v6, p1
invoke-direct/range {v0 .. v7}, Landroid/view/KeyEvent;-><init>(JJIII)V
.local v0, downEvent:Landroid/view/KeyEvent;
const-string v4, "android.intent.extra.KEY_EVENT"
invoke-virtual {v11, v4, v0}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Landroid/os/Parcelable;)Landroid/content/Intent;
iget-object v4, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mContext:Landroid/content/Context;
const/4 v5, 0x0
invoke-virtual {v4, v11, v5}, Landroid/content/Context;->sendOrderedBroadcast(Landroid/content/Intent;Ljava/lang/String;)V
new-instance v12, Landroid/content/Intent;
const-string v4, "android.intent.action.MEDIA_BUTTON"
const/4 v5, 0x0
invoke-direct {v12, v4, v5}, Landroid/content/Intent;-><init>(Ljava/lang/String;Landroid/net/Uri;)V
.local v12, upIntent:Landroid/content/Intent;
new-instance v3, Landroid/view/KeyEvent;
const/4 v8, 0x1
const/4 v10, 0x0
move-wide v4, v1
move-wide v6, v1
move v9, p1
invoke-direct/range {v3 .. v10}, Landroid/view/KeyEvent;-><init>(JJIII)V
.local v3, upEvent:Landroid/view/KeyEvent;
const-string v4, "android.intent.extra.KEY_EVENT"
invoke-virtual {v12, v4, v3}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Landroid/os/Parcelable;)Landroid/content/Intent;
iget-object v4, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mContext:Landroid/content/Context;
const/4 v5, 0x0
invoke-virtual {v4, v12, v5}, Landroid/content/Context;->sendOrderedBroadcast(Landroid/content/Intent;Ljava/lang/String;)V
return-void
.end method
Now we moding
Code:
.method public interceptKeyBeforeQueueing(JIIIIIZ)I
There are alot of minor code
So compare with your method or just extract attacment and use my file
*Bonus can make long press to kill app, change FM channel. All are in XDA
Make FM Radio work without Earphone and in Airplane mode
Decompile FmRadio.apk
Edit /smali/com/samsung/app/fmradio/FmRadioPlaybackService.smali
Bypass Earphone plugged check
find all line
Code:
iget-boolean v2, p0, Lcom/samsung/app/fmradio/FmRadioPlaybackService;->mHeadsetPlugged:Z
replace 1st and 3rd line with
Code:
const/4 v2, 0x1
Bypass Airplane Mode check
Find all line
Code:
iget-boolean v2, p0, Lcom/samsung/app/fmradio/FmRadioPlaybackService;->mAirplaneMode:Z
replace 1st and 3rd line with
Code:
const/4 v2, 0x0
Save and recopile FmRadio.apk
*Note: without Earphone FM signal very bad. or you can cut an 3.5mm jack and plug to phone so you have better signal while sound still at phone speaker
Nice bro
GOod work mahn..
What the thread is about???
Sent from my GT-S5670 using xda app-developers app
that crt on guide ...is it a improvement to crt on or jus adding a switch to settings ??
It's called optimize code: less edit > less code to run >system run smooth( theoretically, because 1 code doesnot make system slower XD)
the swipe to remove mod made it swipe function really smoother !! gr8
Before know this, i hate sweep to remove it's annoying
Tổng hợp đầy đủ lắm anh, thêm vài bài hay nữa cho em học hỏi nào :x
So great. Thanks so much!
Anh Sơn ơi, u can make a tut mod this launcher ?
http://forum.xda-developers.com/showthread.php?t=1689249
Click to expand...
Click to collapse
Hì, thanks anh!
any rom with all des features ?
Those Are Really Helpful..! Specially For Every One Who Are Building There Own Rom..
shocklads said:
Tổng hợp đầy đủ lắm anh, thêm vài bài hay nữa cho em học hỏi nào :x
So great. Thanks so much!
Anh Sơn ơi, u can make a tut mod this launcher ?
Hì, thanks anh!
Click to expand...
Click to collapse
ofcourse it will have guide.
zcop said:
ofcourse it will have guide.
Click to expand...
Click to collapse
Awesome. Keep fighting, master
Custom Date, Clock style on StatusBar
After unsolved problem with Kahvitahra's mods
I start new mod. It's not good as Kahvitahra's mods but for now it's ok
So let's start
Decompile SystemUI.apk
open DateView.smali
Find
Code:
.method private final updateClock()V
Delete all this method
paste the new one
Code:
.method private final updateClock()V
.locals 7
.prologue
.line 78
new-instance v4, Ljava/text/SimpleDateFormat;
[COLOR="blue"]# total options[/COLOR]
const/16 v1, 0x5
const/16 v2, 0x0
iget-object v0, p0, Lcom/android/systemui/statusbar/DateView;->mContext:Landroid/content/Context;
invoke-virtual {v0}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v0
const-string v3, "custom_date_format"
invoke-static {v0, v3, v1}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v0
[COLOR="Blue"]# Option number 1[/COLOR]
const/16 v2, 0x1
if-eq v2, v0, :cond_0
[COLOR="blue"]# Option number 2[/COLOR]
const/16 v2, 0x2
if-eq v2, v0, :cond_1
const/16 v2, 0x3
if-eq v2, v0, :cond_2
const/16 v2, 0x4
if-eq v2, v0, :cond_3
const/16 v2, 0x5
if-eq v2, v0, :cond_4
[COLOR="blue"]# you can add option number N after here[/COLOR]
[COLOR="green"]# const/16 v2, 0xN
# if-eq v2, v0, :cond_N-1[/COLOR]
[COLOR="Blue"]#all date, time is in[/COLOR] [COLOR="Red"]Simple Date Format[/COLOR].[COLOR="blue"] Google it[/COLOR]
[COLOR="Blue"]#Format of Style number 1[/COLOR]
:cond_0
const-string v5, "yyyy-MM-dd HH:mm:ss.SSSZ"
goto :goto_0
[COLOR="blue"]# Format of style number 2[/COLOR]
:cond_1
const-string v5, "yyyy-MM-dd HH:mm:ssZ"
goto :goto_0
:cond_2
const-string v5, "yyyy-MM-dd HH:mmZ"
goto :goto_0
:cond_3
const-string v5, "yyyy-MM-dd"
goto :goto_0
:cond_4
const-string v5, "HH:mm"
goto :goto_0
[COLOR="blue"]# After here put style number N[/COLOR]
[COLOR="green"] :cond_N-1
const-string v5, "dd/MM/yy E HH:mm"
goto :goto_0[/COLOR]
[COLOR="Purple"]# Below is Display date format to statusbar, no need to change[/COLOR]
:goto_0
invoke-direct {v4,v5}, Ljava/text/SimpleDateFormat;-><init>(Ljava/lang/String;)V
.line 85
.local v4, sdf:Ljava/text/SimpleDateFormat;
new-instance v6, Ljava/util/Date;
invoke-direct {v6}, Ljava/util/Date;-><init>()V
.local v6, now:Ljava/util/Date;
invoke-virtual {v4, v6}, Ljava/text/SimpleDateFormat;->format(Ljava/util/Date;)Ljava/lang/String;
move-result-object v6
invoke-virtual {p0, v6}, Lcom/android/systemui/statusbar/DateView;->setText(Ljava/lang/CharSequence;)V
.line 87
return-void
.end method
Recomplie SystemUI.apk
Decompile Settings.apk( or Decompile yourPart.apk if you want to put it in Part)
open /res/values/arrays.xml
Add
Code:
<array name="custom_date_entries">
<item>yyyy-MM-dd HH:mm:ss.SSSZ</item>
<item>yyyy-MM-dd HH:mm:ssZ</item>
<item>yyyy-MM-dd HH:mmZ</item>
<item>yyyy-MM-dd</item>
<item>HH:mm</item>
[COLOR="Blue"]/*add new option Name after this */[/COLOR]
</array>
<string-array name="custom_date_values">
<item>1</item>
<item>2</item>
<item>3</item>
<item>4</item>
<item>5</item>
[COLOR="Blue"]/*add new option number( [COLOR="Green"]N[/COLOR] ) after this */[/COLOR]
</string-array>
Put option in Settings.apk
Open /res/xml/date_time_prefs.xml
Put option in Part
open /res/xml/settings.xml
go to the end of file
above
Code:
</PreferenceScreen>
paste
Code:
<PreferenceCategory android:title="StatusBar Date">
<CheckBoxPreference android:title="Enable Custom Date" android:key="custom_date" android:summaryOn="Enabled" android:summaryOff="Disabled" android:defaultValue="false" />
<ListPreference android:persistent="true" android:entries="@array/custom_date_entries" android:title="Choose custom date" android:key="custom_date_format" android:defaultValue="4" android:entryValues="@array/custom_date_values" android:dependency="custom_date" />
</PreferenceCategory>
Recompile Settings.apk or yourPart.apk
If you want to add more option
Just do folow the COLOR TEXT
I dont think this perfect.
here is perfect
Try to port it for me
Here is a compilation of my Verizon Samsung Galaxy S3 Tutorials.
Some have included Zips, some do not. Due to time constraints and the many different ROMs it is impossible to make flashables for all of them. These tutotials are meant for DEVs who want to implement these MODs into thier ROMs.
Also, some tutorials are for different Rom versions, not always the current ROM. This is okay, because the information contained in these tutorials is a good base to get the MODs working even if the you are on different firmware. Many of my MODs were re-written, updated, and converted to work with the S3 from other carriers, tutorials, and snippits of code.
I will add to this thread as I get time.
Thanks button if this helps!
[MOD] [GUIDE] Remove the GPS Icon from the Status Bar (the right way)
REMOVE GPS ICON FROM STATUS BAR
ORIGINAL THREAD
Here is a guide to remove the GPS (location) Icon from the status bar. This is not the current method of going into the drawables XML and removing or making the PNGs transparent. This is a smali edit to prevent the ICON from displaying thus removing the space the icon utilizes from the status bar. If you like this MOD hit the thanks button.
DEVs feel free to use this MOD just shoot me a thanks and some credit.
We will be working within SystemUI.apk
Decompile SystemUI.apk
Navigate to smali/com/android/systemui/statusbar/policy/LocationController.smali
Find the three instances of the following:
Code:
"Gps icon State"
In each instance remove the very next "invoke-virtual" line
Thats it!
Recompile
Chmod 644
Push to System/app or make a flashable ZIP.
[MOD][GUIDE] Status Bar Clock Mods
Status Bar Clock Mods
ORIGINALTHREAD
DEVS, If you want to incorporate this into your ROMs feel free, just shoot me some thanks and some credit.
I would like to thank the following for helping with these MODs:
Jeboo & Shoman94 - They pretty much wrote the toggle portion of the code for the GS2, I just ported over to work with the GS3
RMarkWald - Helped me straighten out some of the identifiers
Clark44 - General thanks
Okay,thats all for that. Lets get to the good stuff.....
This MOD will do the following based on how you want it to look.
-Center the clock in the Status Bar.
-Roll the clock out of the way if you get a notification.
-Make the AM/PM text size a step smaller.
-Add toggle On/Off functionality in Settings/Time and Date.
-Allow you to either toggle on/off am/pm or am/pm & Time all together
This guide assumes you are familiar with de/recompiling. If you are not, there are a bunch of how-to's floating around.
The following APK's will be modified:
SystemUI.apk
SecSettings.apk
We will start with SecSettings.apk
THIS PART OF THE GUIDE WILL ADD THE TOGGLES TO REMOVE AM/PM AND OR TIME. THIER FUNCTIONALITY CAN BE FOUND IN SETTING/DATE AND TIME
Navigate to:
res/values/public.xml
find the following identifiers:
Code:
0x7f0d05f8
0x7f0d05f9
0x7f0d05fa
0x7f0d05fb
Change the entire lines to match the ones below in red
Code:
<public type="string" name="tts_default_settings_section" id="0x7f0d05f7" />
[COLOR="Red"]<public type="string" name="disable_ampm" id="0x7f0d05f8" />
<public type="string" name="disable_ampm_text" id="0x7f0d05f9" />
<public type="string" name="disable_time" id="0x7f0d05fa" />
<public type="string" name="disable_time_text" id="0x7f0d05fb" />
[/COLOR] <public type="string" name="tts_default_pitch_title" id="0x7f0d05fc" />
Navigate to:
res/values/strings.xml
Add the following lines below in red.
Code:
<string name="tts_default_settings_section">Default settings</string>
[COLOR="Red"]<string name="disable_ampm">Hide AM/PM</string>
<string name="disable_ampm_text">Remove AM/PM from time in status bar</string>
<string name="disable_time">Hide Time</string>
<string name="disable_time_text">Remove time from status bar</string>
[/COLOR] <string name="tts_default_pitch_title">Pitch</string>
Navigate to:
res/xml/date_time_prefs.xml
Add the following below in red
Code:
<ListPreference android:title="@string/date_time_date_format" android:key="date_format" android:summary="mm/dd/yyyy" android:widgetLayout="@layout/round_more_icon" />
[COLOR="Red"]<CheckBoxPreference android:title="@string/disable_time" android:key="hide_time" android:summary="@string/disable_time_text" />
<CheckBoxPreference android:title="@string/disable_ampm" android:key="hide_ampm" android:summary="@string/disable_ampm_text" />[/COLOR]
</PreferenceScreen>
Pause - At this point I suggest you compile SecSettings.apk and push to /system/app to verify the new toggles are in place. I like to stop every few steps to verify that the APK will at least compile so I know if I have made any mistakes.
Continuing on with SecSettings.apk....
Navigate to:
smali/com/android/settings/DateTimeSettings.smali
Add the following below in red
Code:
.field private mDummyDate:Ljava/util/Calendar;
.[COLOR="red"]field private mHideAmPm:Landroid/preference/Preference;
.field private mHideTime:Landroid/preference/Preference;
[/COLOR]
.field private mIntentReceiver:Landroid/content/BroadcastReceiver;
Find the following code
Code:
iget-object v7, p0, Lcom/android/settings/DateTimeSettings;->mTimePref:Landroid/preference/Preference;
Starting with the very next line, delete everything up to and including the first ".end Method" you come to and paste the following code in its place
Code:
if-nez v0, :cond_6
move v4, v5
:goto_0
invoke-virtual {v7, v4}, Landroid/preference/Preference;->setEnabled(Z)V
.line 193
iget-object v7, p0, Lcom/android/settings/DateTimeSettings;->mDatePref:Landroid/preference/Preference;
if-nez v0, :cond_7
move v4, v5
:goto_1
invoke-virtual {v7, v4}, Landroid/preference/Preference;->setEnabled(Z)V
.line 194
iget-object v4, p0, Lcom/android/settings/DateTimeSettings;->mTimeZone:Landroid/preference/Preference;
if-nez v1, :cond_8
:goto_2
invoke-virtual {v4, v5}, Landroid/preference/Preference;->setEnabled(Z)V
.line 197
invoke-direct {p0}, Lcom/android/settings/DateTimeSettings;->applyEDMDateTimeChangePolicy()V
const-string v4, "hide_time"
invoke-virtual {p0, v4}, Lcom/android/settings/DateTimeSettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v4
check-cast v4, Landroid/preference/Preference;
iput-object v4, p0, Lcom/android/settings/DateTimeSettings;->mHideTime:Landroid/preference/Preference;
const-string v4, "hide_ampm"
invoke-virtual {p0, v4}, Lcom/android/settings/DateTimeSettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v4
check-cast v4, Landroid/preference/Preference;
iput-object v4, p0, Lcom/android/settings/DateTimeSettings;->mHideAmPm:Landroid/preference/Preference;
iget-object v0, p0, Lcom/android/settings/DateTimeSettings;->mHideTime:Landroid/preference/Preference;
check-cast v0, Landroid/preference/CheckBoxPreference;
invoke-virtual {v0}, Landroid/preference/CheckBoxPreference;->isChecked()Z
move-result v0
if-eqz v0, :cond_4
const/4 v0, 0x0
iget-object v4, p0, Lcom/android/settings/DateTimeSettings;->mHideAmPm:Landroid/preference/Preference;
invoke-virtual {v4, v0}, Landroid/preference/Preference;->setEnabled(Z)V
iget-object v4, p0, Lcom/android/settings/DateTimeSettings;->mTime24Pref:Landroid/preference/Preference;
invoke-virtual {v4, v0}, Landroid/preference/Preference;->setEnabled(Z)V
:cond_4
iget-object v0, p0, Lcom/android/settings/DateTimeSettings;->mTime24Pref:Landroid/preference/Preference;
check-cast v0, Landroid/preference/CheckBoxPreference;
invoke-virtual {v0}, Landroid/preference/CheckBoxPreference;->isChecked()Z
move-result v0
if-eqz v0, :cond_5
const/4 v0, 0x0
iget-object v4, p0, Lcom/android/settings/DateTimeSettings;->mHideAmPm:Landroid/preference/Preference;
invoke-virtual {v4, v0}, Landroid/preference/Preference;->setEnabled(Z)V
:cond_5
return-void
:cond_6
move v4, v6
.line 192
goto :goto_0
:cond_7
move v4, v6
.line 193
goto :goto_1
:cond_8
move v5, v6
.line 194
goto :goto_2
.end method
Find the following code
Code:
.method public onPreferenceTreeClick(Landroid/preference/PreferenceScreen;Landroid/preference/Preference;)Z
Starting with the very next line, delete everything up to and including the first ".end Method" you come to and paste the following code in its place
Code:
.locals 6
.parameter "preferenceScreen"
.parameter "preference"
.prologue
const/4 v1, 0x1
.line 486
iget-object v0, p0, Lcom/android/settings/DateTimeSettings;->mDatePref:Landroid/preference/Preference;
if-ne p2, v0, :cond_1
.line 487
const/4 v0, 0x0
invoke-virtual {p0, v0}, Lcom/android/settings/DateTimeSettings;->showDialog(I)V
.line 497
:cond_0
:goto_0
invoke-super {p0, p1, p2}, Lcom/android/settings/SettingsPreferenceFragment;->onPreferenceTreeClick(Landroid/preference/PreferenceScreen;Landroid/preference/Preference;)Z
move-result v0
return v0
.line 488
:cond_1
iget-object v0, p0, Lcom/android/settings/DateTimeSettings;->mTimePref:Landroid/preference/Preference;
if-ne p2, v0, :cond_2
.line 490
invoke-virtual {p0, v1}, Lcom/android/settings/DateTimeSettings;->removeDialog(I)V
.line 491
invoke-virtual {p0, v1}, Lcom/android/settings/DateTimeSettings;->showDialog(I)V
goto :goto_0
.line 492
:cond_2
iget-object v0, p0, Lcom/android/settings/DateTimeSettings;->mTime24Pref:Landroid/preference/Preference;
if-ne p2, v0, :cond_4
.line 493
iget-object v0, p0, Lcom/android/settings/DateTimeSettings;->mTime24Pref:Landroid/preference/Preference;
check-cast v0, Landroid/preference/CheckBoxPreference;
invoke-virtual {v0}, Landroid/preference/CheckBoxPreference;->isChecked()Z
move-result v0
invoke-direct {p0, v0}, Lcom/android/settings/DateTimeSettings;->set24Hour(Z)V
iget-object v1, p0, Lcom/android/settings/DateTimeSettings;->mHideAmPm:Landroid/preference/Preference;
if-nez v0, :cond_3
const/4 v0, 0x1
goto :goto_1
:cond_3
const/4 v0, 0x0
:goto_1
invoke-virtual {v1, v0}, Landroid/preference/Preference;->setEnabled(Z)V
.line 494
:goto_2
invoke-virtual {p0}, Lcom/android/settings/DateTimeSettings;->getActivity()Landroid/app/Activity;
move-result-object v0
invoke-virtual {p0, v0}, Lcom/android/settings/DateTimeSettings;->updateTimeAndDateDisplay(Landroid/content/Context;)V
.line 495
invoke-direct {p0}, Lcom/android/settings/DateTimeSettings;->timeUpdated()V
goto :goto_0
:cond_4
const-string v3, "hide_ampm"
iget-object v0, p0, Lcom/android/settings/DateTimeSettings;->mHideAmPm:Landroid/preference/Preference;
if-ne p2, v0, :cond_5
iget-object v0, p0, Lcom/android/settings/DateTimeSettings;->mHideAmPm:Landroid/preference/Preference;
check-cast v0, Landroid/preference/CheckBoxPreference;
invoke-virtual {v0}, Landroid/preference/CheckBoxPreference;->isChecked()Z
move-result v2
invoke-virtual {p0}, Lcom/android/settings/DateTimeSettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v3
const-string v4, "hide_ampm"
invoke-static {v3, v4, v2}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z
goto :goto_2
:cond_5
const-string v3, "hide_time"
iget-object v0, p0, Lcom/android/settings/DateTimeSettings;->mHideTime:Landroid/preference/Preference;
if-ne p2, v0, :cond_0
iget-object v0, p0, Lcom/android/settings/DateTimeSettings;->mHideTime:Landroid/preference/Preference;
check-cast v0, Landroid/preference/CheckBoxPreference;
invoke-virtual {v0}, Landroid/preference/CheckBoxPreference;->isChecked()Z
move-result v2
invoke-virtual {p0}, Lcom/android/settings/DateTimeSettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v3
const-string v4, "hide_time"
invoke-static {v3, v4, v2}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z
if-nez v2, :cond_6
const/4 v2, 0x1
goto :goto_3
:cond_6
const/4 v2, 0x0
:goto_3
iget-object v1, p0, Lcom/android/settings/DateTimeSettings;->mHideAmPm:Landroid/preference/Preference;
invoke-virtual {v1, v2}, Landroid/preference/Preference;->setEnabled(Z)V
iget-object v1, p0, Lcom/android/settings/DateTimeSettings;->mTime24Pref:Landroid/preference/Preference;
invoke-virtual {v1, v2}, Landroid/preference/Preference;->setEnabled(Z)V
goto :goto_2
.end method
Thats it for SecSettins.apk. Recompile and push to /system/app and make sure the toggles are there. They wont function yet but they should be clickable at this point.
Decompile SystemUI
Navigate to smali/com/android/systemui/statusbar/policy/clock.smali
In the next step you will basically be C&P'ing the entire method. If you would like to use your editor to compare code and make only the changes you need thats fine, but for the sake of this guide and time, I am just having you copy and paste the entire method. I suggest you copy half the code and paste, then copy the other half and paste. Its too much to copy at one time..
Find the code
Code:
.method private final getSmallTime()Ljava/lang/CharSequence;
Starting with the very next line, delete everything up to and including the first ".end Method" you come to and paste (half at a time as described above) the following code in its place
Code:
.locals 22
invoke-virtual/range {p0 .. p0}, Lcom/android/systemui/statusbar/policy/Clock;->getContext()Landroid/content/Context;
move-result-object v8
invoke-virtual {v8}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v2
const-string v7, "hide_time"
const/4 v0, 0x0
invoke-static {v2, v7, v0}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v7
const/4 v0, 0x0
if-eqz v7, :cond_0
const/16 v0, 0x8
:cond_0
const v1, 0x7f0f0027
move-object/from16 v2, p0
invoke-virtual {v2, v1}, Landroid/view/View;->findViewById(I)Landroid/view/View;
move-result-object v1
invoke-virtual {v1, v0}, Landroid/view/View;->setVisibility(I)V
invoke-static {v8}, Landroid/text/format/DateFormat;->is24HourFormat(Landroid/content/Context;)Z
move-result v6
if-eqz v6, :cond_5
const v16, 0x104007e
:goto_0
const v2, 0xef00
const v3, 0xef01
move/from16 v0, v16
invoke-virtual {v8, v0}, Landroid/content/Context;->getString(I)Ljava/lang/String;
move-result-object v9
if-nez v6, :cond_1
invoke-virtual {v8}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v2
const-string v3, "hide_ampm"
const/4 v0, 0x0
invoke-static {v2, v3, v0}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v7
const-string v0, "ampm"
new-instance v1, Ljava/lang/StringBuilder;
invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
const-string v2, "getint returned="
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v1
invoke-virtual {v1, v7}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
move-result-object v1
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v1
invoke-static {v0, v1}, Landroid/util/Slog;->i(Ljava/lang/String;Ljava/lang/String;)I
move v2, v7
if-eqz v2, :cond_1
const-string v9, "h:mm"
:cond_1
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/systemui/statusbar/policy/Clock;->mClockFormatString:Ljava/lang/String;
move-object/from16 v20, v0
move-object/from16 v0, v20
invoke-virtual {v9, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v20
if-eqz v20, :cond_2
if-nez v6, :cond_a
move-object/from16 v0, p0
iget-boolean v0, v0, Lcom/android/systemui/statusbar/policy/Clock;->mLocaleChanged:Z
move/from16 v20, v0
if-eqz v20, :cond_a
:cond_2
const/16 v20, 0x0
move/from16 v0, v20
move-object/from16 v1, p0
iput-boolean v0, v1, Lcom/android/systemui/statusbar/policy/Clock;->mLocaleChanged:Z
sget v20, Lcom/android/systemui/statusbar/policy/Clock;->AM_PM_STYLE:I
if-eqz v20, :cond_9
const/4 v4, -0x1
const/4 v15, 0x0
const/4 v11, 0x0
:goto_1
invoke-virtual {v9}, Ljava/lang/String;->length()I
move-result v20
move/from16 v0, v20
if-ge v11, v0, :cond_4
invoke-virtual {v9, v11}, Ljava/lang/String;->charAt(I)C
move-result v7
const/16 v20, 0x27
move/from16 v0, v20
if-ne v7, v0, :cond_3
if-nez v15, :cond_6
const/4 v15, 0x1
:cond_3
:goto_2
if-nez v15, :cond_7
const/16 v20, 0x61
move/from16 v0, v20
if-ne v7, v0, :cond_7
move v4, v11
:cond_4
if-ltz v4, :cond_9
move v5, v4
:goto_3
if-lez v4, :cond_8
add-int/lit8 v20, v4, -0x1
move/from16 v0, v20
invoke-virtual {v9, v0}, Ljava/lang/String;->charAt(I)C
move-result v20
invoke-static/range {v20 .. v20}, Ljava/lang/Character;->isWhitespace(C)Z
move-result v20
if-eqz v20, :cond_8
add-int/lit8 v4, v4, -0x1
goto :goto_3
:cond_5
const v16, 0x104007d
goto/16 :goto_0
:cond_6
const/4 v15, 0x0
goto :goto_2
:cond_7
add-int/lit8 v11, v11, 0x1
goto :goto_1
:cond_8
new-instance v20, Ljava/lang/StringBuilder;
invoke-direct/range {v20 .. v20}, Ljava/lang/StringBuilder;-><init>()V
const/16 v21, 0x0
move/from16 v0, v21
invoke-virtual {v9, v0, v4}, Ljava/lang/String;->substring(II)Ljava/lang/String;
move-result-object v21
invoke-virtual/range {v20 .. v21}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v20
const v21, 0xef00
invoke-virtual/range {v20 .. v21}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder;
move-result-object v20
invoke-virtual {v9, v4, v5}, Ljava/lang/String;->substring(II)Ljava/lang/String;
move-result-object v21
invoke-virtual/range {v20 .. v21}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v20
const-string v21, "a"
invoke-virtual/range {v20 .. v21}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v20
const v21, 0xef01
invoke-virtual/range {v20 .. v21}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder;
move-result-object v20
add-int/lit8 v21, v5, 0x1
move/from16 v0, v21
invoke-virtual {v9, v0}, Ljava/lang/String;->substring(I)Ljava/lang/String;
move-result-object v21
invoke-virtual/range {v20 .. v21}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v20
invoke-virtual/range {v20 .. v20}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v9
:cond_9
new-instance v18, Ljava/text/SimpleDateFormat;
move-object/from16 v0, v18
invoke-direct {v0, v9}, Ljava/text/SimpleDateFormat;-><init>(Ljava/lang/String;)V
move-object/from16 v0, v18
move-object/from16 v1, p0
iput-object v0, v1, Lcom/android/systemui/statusbar/policy/Clock;->mClockFormat:Ljava/text/SimpleDateFormat;
move-object/from16 v0, p0
iput-object v9, v0, Lcom/android/systemui/statusbar/policy/Clock;->mClockFormatString:Ljava/lang/String;
:goto_4
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/systemui/statusbar/policy/Clock;->mCalendar:Ljava/util/Calendar;
move-object/from16 v20, v0
invoke-virtual/range {v20 .. v20}, Ljava/util/Calendar;->getTime()Ljava/util/Date;
move-result-object v20
move-object/from16 v0, v18
move-object/from16 v1, v20
invoke-virtual {v0, v1}, Ljava/text/SimpleDateFormat;->format(Ljava/util/Date;)Ljava/lang/String;
move-result-object v17
sget v20, Lcom/android/systemui/statusbar/policy/Clock;->AM_PM_STYLE:I
if-eqz v20, :cond_e
const v20, 0xef00
move-object/from16 v0, v17
move/from16 v1, v20
invoke-virtual {v0, v1}, Ljava/lang/String;->indexOf(I)I
move-result v12
const v20, 0xef01
move-object/from16 v0, v17
move/from16 v1, v20
invoke-virtual {v0, v1}, Ljava/lang/String;->indexOf(I)I
move-result v13
if-ltz v12, :cond_e
if-le v13, v12, :cond_e
new-instance v10, Landroid/text/SpannableStringBuilder;
move-object/from16 v0, v17
invoke-direct {v10, v0}, Landroid/text/SpannableStringBuilder;-><init>(Ljava/lang/CharSequence;)V
sget v20, Lcom/android/systemui/statusbar/policy/Clock;->AM_PM_STYLE:I
const/16 v21, 0x2
move/from16 v0, v20
move/from16 v1, v21
if-ne v0, v1, :cond_b
add-int/lit8 v20, v13, 0x1
move/from16 v0, v20
invoke-virtual {v10, v12, v0}, Landroid/text/SpannableStringBuilder;->delete(II)Landroid/text/SpannableStringBuilder;
:goto_5
return-object v10
:cond_a
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/systemui/statusbar/policy/Clock;->mClockFormat:Ljava/text/SimpleDateFormat;
move-object/from16 v18, v0
goto :goto_4
:cond_b
sget v20, Lcom/android/systemui/statusbar/policy/Clock;->AM_PM_STYLE:I
const/16 v21, 0x1
move/from16 v0, v20
move/from16 v1, v21
if-ne v0, v1, :cond_d
const v14, 0x3f333333
sget-boolean v20, Lcom/android/systemui/statusbar/StatusBar;->useTouchWizGUI:Z
if-eqz v20, :cond_c
sget-boolean v20, Lcom/android/systemui/statusbar/StatusBar;->canStatusBarHide:Z
if-nez v20, :cond_c
const/high16 v14, 0x3f00
:cond_c
new-instance v19, Landroid/text/style/RelativeSizeSpan;
move-object/from16 v0, v19
invoke-direct {v0, v14}, Landroid/text/style/RelativeSizeSpan;-><init>(F)V
const/16 v20, 0x22
move-object/from16 v0, v19
move/from16 v1, v20
invoke-virtual {v10, v0, v12, v13, v1}, Landroid/text/SpannableStringBuilder;->setSpan(Ljava/lang/Object;III)V
:cond_d
add-int/lit8 v20, v13, 0x1
move/from16 v0, v20
invoke-virtual {v10, v13, v0}, Landroid/text/SpannableStringBuilder;->delete(II)Landroid/text/SpannableStringBuilder;
add-int/lit8 v20, v12, 0x1
move/from16 v0, v20
invoke-virtual {v10, v12, v0}, Landroid/text/SpannableStringBuilder;->delete(II)Landroid/text/SpannableStringBuilder;
goto :goto_5
:cond_e
move-object/from16 v10, v17
goto :goto_5
.end method
Thats it for clock.smali
Navigate to smali/com/android/systemui/statusbar/phone/PhoneStatusBar.smali
Find the code
Code:
.method public showClock(Z)V
Starting with the very next line, delete everything up to and including the first ".end Method" you come to and paste the following code in its place
Code:
.locals 3
iget-object v1, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarView:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
const v2, 0x7f0f0027
invoke-virtual {v1, v2}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->findViewById(I)Landroid/view/View;
move-result-object v0
if-eqz v0, :cond_1
if-eqz p1, :cond_2
const/4 v1, 0x0
iget-object v2, p0, Lcom/android/systemui/SystemUI;->mContext:Landroid/content/Context;
invoke-virtual {v2}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v2
const-string p0, "hide_time"
invoke-static {v2, p0, v1}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v2
if-eqz v2, :cond_0
const/16 v1, 0x8
:cond_0
:goto_0
invoke-virtual {v0, v1}, Landroid/view/View;->setVisibility(I)V
:cond_1
return-void
:cond_2
const/16 v1, 0x8
goto :goto_0
.end method
Thats it for the toggles, if you want you can recompile and push APK's to /system/app or you can continue adding some more functions below.
THIS PART OF THE CODE WILL CENTER THE CLOCK IN THE STATUS BAR
Still in SystemUI.apk
Navigate to res/layout/tw_status_bar.xml
Find the following code and DELETE it
Code:
<com.android.systemui.statusbar.policy.Clock android:textSize="@dimen/status_bar_clock_text_size" android:textColor="#ff959595" android:gravity="left|center" android:id="@id/clock" android:paddingLeft="3.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" android:includeFontPadding="false" />
FInd the following code
Code:
xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui">
Add this right below it
Code:
<LinearLayout android:gravity="center" android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="fill_parent">
<com.android.systemui.statusbar.policy.Clock android:textSize="@dimen/status_bar_clock_text_size" android:textColor="#ff959595" android:gravity="center" android:id="@id/clock" android:paddingTop="3.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" android:includeFontPadding="false" android:layout_weight="1.0" />
</LinearLayout>
Find the following code
Code:
<LinearLayout android:orientation="horizontal" android:id="@id/ticker" android:paddingLeft="6.0dip" android:animationCache="false" android:layout_width="fill_parent" android:layout_height="fill_parent">
Change it to this
Code:
<LinearLayout android:orientation="horizontal" android:id="@id/ticker" android:background="@drawable/status_bar_bg_tile" android:paddingLeft="6.0dip" android:animationCache="false" android:layout_width="fill_parent" android:layout_height="fill_parent">
THIS PART WILL MAKE THE AM/PM A SIZE SMALLER
Navigate to smali/com/android/systemui/statusbar/policy/clock.smali
Find the following code and remove whats in red and add whats in green
Code:
# direct methods
.method static constructor <clinit>()V
.locals 1
.prologue
.line 78
[COLOR="Red"] const/4 v0, 0x0[/COLOR]
[COLOR="SeaGreen"]const/4 v0, 0x1[/COLOR]
sput v0, Lcom/android/systemui/statusbar/policy/Clock;->AM_PM_STYLE:I
return-void
.end method
Thats it!!
Recompile
Chmod 644
Push to /system/app or create a zip and flash away.
IF YOU LIKE THIS MOD HIT THE THANKS BUTTON
[MOD] [GUIDE] Remove / Restore keyboard icon in status bar
Remove / Restore keyboard icon in status bar
ORIGINAL THREAD
This will remove the keyboard notification icon in the status bar. For some (like me) its annoying. If you are running a custom ROM with changes to services.jar this will over write them. Best bet is to do a Nandroid before flashing. Thank me if this helps you.
Decompile: services.jar in framework.
Browse to: smali/com/android/server/InputMethodManagerService.smali
Scroll down to line (aprox) 8755 and look for the code:
Code:
iget-object v12, v0, Lcom/android/server/InputMethodManagerService;->mCurToken:Landroid/os/IBinder;
move-object/from16 v0, p1
[COLOR="Red"] if-eq v12, v0, :cond_1
[/COLOR]
.line 1369
:cond_0
const-string v12, "InputManagerService"
new-instance v13, Ljava/lang/StringBuilder;
Comment out or delete the line above in red.
Recompile
Chmod 644 and push to /system/framework
Enjoy!
[MOD] [GUIDE] Lockscreen Torch LG7
Lockscreen Torch LG7
New Thread for JB BLK1
ORIGINAL THREAD
The lockscreen torch will allow you to quickly turn on your flashlight from the lockscreen. Simply hold the home button in for torch, let it go and it will turn off. It is meant to function this way so you dont accidentally turn it on in your pocket or something and forget about it. Not sure who originally wrote the MOD but I have spent some time re-writing it to fit the GS3 based on a dozen or so other tutorials.
After reboot, it will take about 20 seconds before the MOD will engage. Then it will work at will as long as you are on the lockscreen.
I will include the three files that are being modified in the zip below so you can use them in your compare tool.
DEVs if you want to use this in your ROM feel free, just shoot me some credit and some thanks!
Hit the Thanks Button!
Here is the guide.....
First you will need to download the torch file below and drop it in /system/app. This will be in the zip file with the smali files.
We will be working with three smali files inside of android.policy.jar.
Navigate to smali/com/android/internal/policy/impl/KeyguardViewMediator$2.smali
Find the following code and add the part in RED
Code:
packed-switch v2, :pswitch_data_0
.line 1172
:goto_0
[COLOR="Red"][B] :pswitch_0
[/B][/COLOR] return-void
Find the 13 : pswitch_ lines and increase them by 1. For example
Code:
:pswitch_0 becomes :pswitch_1
:pswitch_1 becomes :pswitch_2
:pswitch_2 becomes :pswitch_3
:pswitch_3 becomes :pswitch_4
:pswitch_4 becomes :pswitch_5
:pswitch_5 becomes :pswitch_6
:pswitch_6 becomes :pswitch_7
:pswitch_7 becomes :pswitch_8
:pswitch_8 becomes :pswitch_9
:pswitch_9 becomes :pswitch_a
:pswitch_a becomes :pswitch_b
:pswitch_b becomes :pswitch_c
:pswitch_c becomes :pswitch_d
Find the following code
Code:
invoke-static {v0}, Lcom/android/internal/policy/impl/KeyguardViewMediator;->access$300(Lcom/android/internal/policy/impl/KeyguardViewMediator;)V
.line 1169
monitor-exit v1
goto :goto_0
Add the following directly after
Code:
.line 974
:pswitch_e
iget-object v2, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator$2;->this$0:Lcom/android/internal/policy/impl/KeyguardViewMediator;
iget v3, p1, Landroid/os/Message;->arg1:I
if-eqz v3, :cond_2
move v3, v0
:goto_3
#calls: Lcom/android/internal/policy/impl/KeyguardViewMediator;->handleSetTorch(Z)V
invoke-static {v2, v3}, Lcom/android/internal/policy/impl/KeyguardViewMediator;->access$1900(Lcom/android/internal/policy/impl/KeyguardViewMediator;Z)V
goto :goto_0
:cond_2
move v3, v1
goto :goto_3
Find the "nop' at the end and add another one right below it
Code:
throw v0
.line 1129
nop
nop
Find the stack of : pswitch_ lines at the end of the smali and delete : pswitch_0
Then add the following so the entire stack will end up looking like this
Code:
.packed-switch 0x1
:pswitch_1
:pswitch_2
:pswitch_3
:pswitch_4
:pswitch_5
:pswitch_6
:pswitch_7
:pswitch_8
:pswitch_9
:pswitch_a
:pswitch_b
:pswitch_c
:pswitch_d
:pswitch_0
:pswitch_0
:pswitch_0
:pswitch_0
:pswitch_0
:pswitch_0
:pswitch_e
.end packed-switch
.end method
Thats it for KeyguardViewMediator$2.smali. Save and close the file.
Navigate to smali/com/android/internal/policy/impl/KeyguardViewMediator.smali
Find the following code
Code:
.field private static final SET_HIDDEN:I = 0xc
Add this right after
Code:
[hide]
.field private static final SET_TORCH:I = 0x14
Find the following code
Code:
.field private mTelephonyManager:Landroid/telephony/TelephonyManager;
Add this right after
Code:
.field private mTorchEnabled:Z
.field private mTorchStateChanged:Z
Find the following code
Code:
const/4 v10, 0x0
const/4 v9, 0x1
.line 301
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
Add this after
Code:
iput-boolean v9, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mTorchEnabled:Z
Find the following code
Code:
iput-object v0, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mHandler:Landroid/os/Handler;
.line 302
iput-object p1, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mContext:Landroid/content/Context;
.line 304
iput-object p3, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mRealPowerManager:Landroid/os/LocalPowerManager;
Add this after
Code:
iput-boolean v10, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mTorchEnabled:Z
.line 1188
iput-boolean v10, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mTorchStateChanged:Z
Find this method
Code:
.method static synthetic access$200(Lcom/android/internal/policy/impl/KeyguardViewMediator;)V
Add this entire NEW method RIGHT BEFORE it.
Code:
.method static synthetic access$1900(Lcom/android/internal/policy/impl/KeyguardViewMediator;Z)V
.locals 0
.parameter "x0"
.parameter "x1"
.prologue
invoke-direct {p0, p1}, Lcom/android/internal/policy/impl/KeyguardViewMediator;->handleSetTorch(Z)V
return-void
.end method
Find the following code
Code:
const/4 v0, 0x1
invoke-direct {p0, v0}, Lcom/android/internal/policy/impl/KeyguardViewMediator;->adjustLocked(Z)V
.line 1315
monitor-exit p0
Add this right after
Code:
invoke-direct {p0}, Lcom/android/internal/policy/impl/KeyguardViewMediator;->resetTorchState()V
Find the following code
Code:
.line 1496
iget-object v0, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mKeyguardViewManager:Lcom/android/internal/policy/impl/KeyguardViewManager;
invoke-virtual {v0}, Lcom/android/internal/policy/impl/KeyguardViewManager;->onScreenTurnedOff()V
.line 1497
monitor-exit p0
Add this directly after
Code:
invoke-direct {p0}, Lcom/android/internal/policy/impl/KeyguardViewMediator;->resetTorchState()V
Find the following code
Code:
iput-boolean p1, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mHidden:Z
.line 611
invoke-direct {p0}, Lcom/android/internal/policy/impl/KeyguardViewMediator;->adjustUserActivityLocked()V
.line 612
invoke-direct {p0}, Lcom/android/internal/policy/impl/KeyguardViewMediator;->adjustStatusBarLocked()V
Add this directly after
Code:
invoke-direct {p0}, Lcom/android/internal/policy/impl/KeyguardViewMediator;->resetTorchState()V
Find the following code
Code:
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
throw v0
.end method
Add this ENTIRE NEW METHOD directly after
Code:
.method private handleSetTorch(Z)V
.locals 6
.parameter "enable"
.prologue
const/4 v5, 0x0
const/4 v4, 0x1
.line 504
:try_start_0
iget-boolean v1, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mTorchStateChanged:Z
if-nez v1, :cond_1
.line 505
iput-boolean v1, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mTorchEnabled:Z
.line 506
const/4 v1, 0x1
iput-boolean v1, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mTorchStateChanged:Z
.line 515
:cond_0
:goto_0
return-void
.line 507
:cond_1
iget-boolean v1, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mTorchEnabled:Z
if-eq v1, p1, :cond_0
.line 508
iput-boolean p1, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mTorchEnabled:Z
.line 509
new-instance v0, Landroid/content/Intent;
const-string v1, "net.cactii.flash2.TOGGLE_FLASHLIGHT"
invoke-direct {v0, v1}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V
.line 510
.local v0, intent:Landroid/content/Intent;
const-string v1, "net.cactii.flash2.EXTRA_DISABLE_NOTIFICATION"
const/4 v2, 0x1
invoke-virtual {v0, v1, v2}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Z)Landroid/content/Intent;
.line 511
iget-object v1, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mContext:Landroid/content/Context;
invoke-virtual {v1, v0}, Landroid/content/Context;->sendBroadcast(Landroid/content/Intent;)V
:try_end_0
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
goto :goto_0
.line 514
.end local v0 #intent:Landroid/content/Intent;
:catch_0
move-exception v1
goto :goto_0
.end method
Find the following code
Code:
:goto_1
:try_start_2
iget-object v0, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mShowKeyguardWakeLock:Landroid/os/PowerManager$WakeLock;
invoke-virtual {v0}, Landroid/os/PowerManager$WakeLock;->release()V
Add the following after
Code:
.line 995
const/4 v0, 0x1
iput-boolean v0, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mTorchStateChanged:Z
Find the following code
Code:
iget-object v1, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mHandler:Landroid/os/Handler;
invoke-virtual {v1, v0}, Landroid/os/Handler;->sendMessage(Landroid/os/Message;)Z
.line 752
return-void
.end method
Add this ENTIRE NEW METHOD after
Code:
.method private resetTorchState()V
.locals 1
.prologue
.line 1193
iget-boolean v0, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mTorchStateChanged:Z
if-eqz v0, :cond_0
.line 1194
const/4 v0, 0x0
invoke-direct {p0, v0}, Lcom/android/internal/policy/impl/KeyguardViewMediator;->handleSetTorch(Z)V
.line 1196
:cond_0
return-void
.end method
Find the following code
Code:
:try_end_3
.catchall {:try_start_3 .. :try_end_3} :catchall_0
goto :goto_1
.end method
Add this ENTIRE NEW METHOD after
Code:
.method public setTorch(Z)V
.locals 5
.parameter "enable"
.prologue
const/16 v4, 0x14
const/4 v3, 0x0
.line 1155
iget-boolean v1, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mScreenOn:Z
if-eqz v1, :cond_0
.line 1157
iget-object v1, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mHandler:Landroid/os/Handler;
invoke-virtual {v1, v4}, Landroid/os/Handler;->removeMessages(I)V
.line 1158
iget-object v1, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mHandler:Landroid/os/Handler;
if-eqz p1, :cond_1
const/4 v2, 0x1
:goto_0
invoke-virtual {v1, v4, v2, v3}, Landroid/os/Handler;->obtainMessage(III)Landroid/os/Message;
move-result-object v0
.line 1159
.local v0, msg:Landroid/os/Message;
iget-object v1, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mHandler:Landroid/os/Handler;
invoke-virtual {v1, v0}, Landroid/os/Handler;->sendMessage(Landroid/os/Message;)Z
.line 1161
.end local v0 #msg:Landroid/os/Message;
:cond_0
return-void
:cond_1
move v2, v3
.line 1158
goto :goto_0
.end method
Thats it for KeyguardViewMediator.smali. Save the file and close.
Navigate to smali/com/android/internal/policy/impl/PhoneWindowManager.smali
Find the following code
Code:
const/16 v41, 0x3
move/from16 v0, v22
move/from16 v1, v41
Change the next line to the following
Code:
if-ne v0, v1, :cond_2b
Find the following code
Code:
invoke-static/range {v41 .. v42}, Landroid/util/safelog/Log;->i(Ljava/lang/String;Ljava/lang/String;)I
goto :goto_a
:cond_20
Change the next line to the following
Code:
if-eqz v4, :cond_26
Find the following code
Code:
const/16 v41, 0x7d9
move/from16 v0, v38
move/from16 v1, v41
Change the next line to the following
Code:
if-ne v0, v1, :cond_23
Directly after that last change in code, add the following
Code:
:cond_21
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mKeyguardMediator:Lcom/android/internal/policy/impl/KeyguardViewMediator;
move-object/from16 v41, v0
invoke-virtual/range {v41 .. v41}, Lcom/android/internal/policy/impl/KeyguardViewMediator;->isShowingAndNotHidden()Z
move-result v41
if-eqz v41, :cond_22
.line 1275
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mKeyguardMediator:Lcom/android/internal/policy/impl/KeyguardViewMediator;
move-object/from16 v41, v0
move-object/from16 v0, v41
move v1, v8
invoke-virtual {v0, v1}, Lcom/android/internal/policy/impl/KeyguardViewMediator;->setTorch(Z)V
.line 1276
rem-int/lit8 v41, v31, 0xf
if-nez v41, :cond_22
.line 1277
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mKeyguardMediator:Lcom/android/internal/policy/impl/KeyguardViewMediator;
move-object/from16 v41, v0
invoke-virtual/range {v41 .. v41}, Lcom/android/internal/policy/impl/KeyguardViewMediator;->pokeWakelock()V
:cond_22
Here is a sort of tricky part. Starting right after the above code change you need to comb the rest of this entire method for all references to ":cond_X" and increment them by one. THERE ARE A LOT! Take your time and find them all. For example
Code:
:cond_23 becomes :cond_24
:cond_29 becomes :cond_2a
:cond_3f becomes :cond_40
....etc. MAKE SURE YOU FIND THEM ALL! The last one you change should be :cond_47.
[/hide]
Thats it. Save all fines, recompile and push to /system/framework.
Enjoy and hit the Thanks Butto
[MOD][GUIDE] How-to add abbreviated day of week in stsatus bar
Add abbreviated day of week in stsatus bar
ORIGINAL THREAD
This will add an abbreviated day of the week (Mon, Tue, Wed, etc) to your status bar
This will modify the status bar on the lock screen status bar, regular screen status bar, and expanded status bar.
This will work for LG7 and the new leak too i believe.
Here is the guide:
This will cover two scenarios.
1. Center Clock Applications
2. Stock Clock Applications
First one will be for Center Clock....
Decompile SystemUI and navigate to res/layout/tw_status_bar.xml
Find the following code
Code:
<com.android.systemui.statusbar.policy.Clock
Right above this line paste the following code
Code:
<com.android.systemui.statusbar.policy.DateView android:textAppearance="@style/TextAppearance.StatusBar.Date" android:gravity="right" android:id="@id/date" android:paddingRight="2.0dip" android:paddingTop="7.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" android:includeFontPadding="false" android:layout_weight="1.0" />
Navigate to smali/com/android/systemui/statusbar/policy/dateview.smali
Find the following code
Code:
.method private final updateClock()V
Starting with and including the very next line, delete everything all the way to and including the first "end Method you come to and paste the following code in its place
Code:
.locals 9
.prologue
const v8, [B][COLOR="Red"]0x7f080002
[/COLOR][/B]
const/4 v5, 0x2
const/4 v7, 0x1
const/4 v6, 0x0
.line 92
invoke-virtual {p0}, Lcom/android/systemui/statusbar/policy/DateView;->getContext()Landroid/content/Context;
move-result-object v0
.line 93
.local v0, context:Landroid/content/Context;
new-instance v3, Ljava/util/Date;
invoke-direct {v3}, Ljava/util/Date;-><init>()V
.line 94
.local v3, now:Ljava/util/Date;
const-string v4, "EEE"
invoke-static {v4, v3}, Landroid/text/format/DateFormat;->format(Ljava/lang/CharSequence;Ljava/util/Date;)Ljava/lang/CharSequence;
move-result-object v2
.line 95
.local v2, dow:Ljava/lang/CharSequence;
invoke-static {v0}, Landroid/text/format/DateFormat;->getLongDateFormat(Landroid/content/Context;)Ljava/text/DateFormat;
move-result-object v4
invoke-virtual {v4, v3}, Ljava/text/DateFormat;->format(Ljava/util/Date;)Ljava/lang/String;
move-result-object v1
.line 98
.local v1, date:Ljava/lang/CharSequence;
sget-boolean v4, Lcom/android/systemui/statusbar/StatusBar;->useTouchWizGUI:Z
if-eqz v4, :cond_1
.line 99
sget-boolean v4, Lcom/android/systemui/statusbar/StatusBar;->canStatusBarHide:Z
if-eqz v4, :cond_0
.line 100
new-array v4, v5, [Ljava/lang/Object;
aput-object v1, v4, v6
aput-object v2, v4, v7
invoke-virtual {v0, v8, v4}, Landroid/content/Context;->getString(I[Ljava/lang/Object;)Ljava/lang/String;
move-result-object v4
invoke-virtual {p0, v4}, Lcom/android/systemui/statusbar/policy/DateView;->setText(Ljava/lang/CharSequence;)V
.line 108
:goto_0
return-void
.line 102
:cond_0
const v4, [B][COLOR="red"]0x7f080003
[/COLOR][/B]
new-array v5, v5, [Ljava/lang/Object;
aput-object v2, v5, v6
aput-object v1, v5, v7
invoke-virtual {v0, v4, v5}, Landroid/content/Context;->getString(I[Ljava/lang/Object;)Ljava/lang/String;
move-result-object v4
invoke-virtual {p0, v4}, Lcom/android/systemui/statusbar/policy/DateView;->setText(Ljava/lang/CharSequence;)V
goto :goto_0
.line 105
:cond_1
new-array v4, v5, [Ljava/lang/Object;
aput-object v2, v4, v6
aput-object v1, v4, v7
invoke-virtual {v0, v8, v4}, Landroid/content/Context;->getString(I[Ljava/lang/Object;)Ljava/lang/String;
move-result-object v4
invoke-virtual {p0, v4}, Lcom/android/systemui/statusbar/policy/DateView;->setText(Ljava/lang/CharSequence;)V
goto :goto_0
.end method
Pay attention to the code above in RED. Those ID's must match up to the date ID's in your res/values/public.xml. If they dont you will need to change them.
Since this will also change the layout of the date in your dropdown menu, you may want to delete the date reference from there. If you do, this is how you delete it
Navigate to res/layout/tw_status_bar_expanded
Find the code that begins with the following and delete the entire line
Code:
<com.android.systemui.statusbar.policy.DateView
Thats it, recompile, chmod 644, and push to /system/app.
The next steps are for a stock clock setup. I have mine setup as a center clock so I will give you the basics for the stock clock. You may have to add some padding to tweak your location in the status bar. I will assume if you know how to de/recompile, you know how to pad your code.
In SystemUI Navigate to res/layout/tw_status_bar
Find the following code
Code:
<com.android.systemui.statusbar.policy.Clock
Add the following code on top of it
Code:
<com.android.systemui.statusbar.policy.DateView android:textAppearance="@style/TextAppearance.StatusBar.Date" android:gravity="left|center" android:id="@id/date" android:paddingLeft="4.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" android:layout_toLeftOf="@id/clock" />
Navigate to smali/com/android/systemui/statusbar/policy/dateview.smali
Find the following code
Code:
.method private final updateClock()V
Starting with and including the very next line, delete everything all the way to and including the first "end Method you come to and paste the following code in its place
Code:
.locals 9
.prologue
const v8, [B][COLOR="Red"]0x7f080002
[/COLOR][/B]
const/4 v5, 0x2
const/4 v7, 0x1
const/4 v6, 0x0
.line 92
invoke-virtual {p0}, Lcom/android/systemui/statusbar/policy/DateView;->getContext()Landroid/content/Context;
move-result-object v0
.line 93
.local v0, context:Landroid/content/Context;
new-instance v3, Ljava/util/Date;
invoke-direct {v3}, Ljava/util/Date;-><init>()V
.line 94
.local v3, now:Ljava/util/Date;
const-string v4, "EEE"
invoke-static {v4, v3}, Landroid/text/format/DateFormat;->format(Ljava/lang/CharSequence;Ljava/util/Date;)Ljava/lang/CharSequence;
move-result-object v2
.line 95
.local v2, dow:Ljava/lang/CharSequence;
invoke-static {v0}, Landroid/text/format/DateFormat;->getLongDateFormat(Landroid/content/Context;)Ljava/text/DateFormat;
move-result-object v4
invoke-virtual {v4, v3}, Ljava/text/DateFormat;->format(Ljava/util/Date;)Ljava/lang/String;
move-result-object v1
.line 98
.local v1, date:Ljava/lang/CharSequence;
sget-boolean v4, Lcom/android/systemui/statusbar/StatusBar;->useTouchWizGUI:Z
if-eqz v4, :cond_1
.line 99
sget-boolean v4, Lcom/android/systemui/statusbar/StatusBar;->canStatusBarHide:Z
if-eqz v4, :cond_0
.line 100
new-array v4, v5, [Ljava/lang/Object;
aput-object v1, v4, v6
aput-object v2, v4, v7
invoke-virtual {v0, v8, v4}, Landroid/content/Context;->getString(I[Ljava/lang/Object;)Ljava/lang/String;
move-result-object v4
invoke-virtual {p0, v4}, Lcom/android/systemui/statusbar/policy/DateView;->setText(Ljava/lang/CharSequence;)V
.line 108
:goto_0
return-void
.line 102
:cond_0
const v4, [B][COLOR="red"]0x7f080003
[/COLOR][/B]
new-array v5, v5, [Ljava/lang/Object;
aput-object v2, v5, v6
aput-object v1, v5, v7
invoke-virtual {v0, v4, v5}, Landroid/content/Context;->getString(I[Ljava/lang/Object;)Ljava/lang/String;
move-result-object v4
invoke-virtual {p0, v4}, Lcom/android/systemui/statusbar/policy/DateView;->setText(Ljava/lang/CharSequence;)V
goto :goto_0
.line 105
:cond_1
new-array v4, v5, [Ljava/lang/Object;
aput-object v2, v4, v6
aput-object v1, v4, v7
invoke-virtual {v0, v8, v4}, Landroid/content/Context;->getString(I[Ljava/lang/Object;)Ljava/lang/String;
move-result-object v4
invoke-virtual {p0, v4}, Lcom/android/systemui/statusbar/policy/DateView;->setText(Ljava/lang/CharSequence;)V
goto :goto_0
.end method
Pay attention to the code above in RED. Those ID's must match up to the date ID's in your res/values/public.xml. If they dont you will need to change them.
Since this will also change the layout of the date in your dropdown menu, you may want to delete the date reference from there. If you do, this is how you delete it
Navigate to res/layout/tw_status_bar_expanded
Find the code that begins with the following and delete the entire line
Code:
<com.android.systemui.statusbar.policy.DateView
Thats it, recompile, chmod 644, and push to /system/app.
Hit the thanks button if this has been helpful to you!
[MOD] [GUIDE] Remove Lockscreen carrier info
Remove Lockscreen carrier info
ORIGINAL THREAD
Who hates the carrier name on the lock screen? Me too,
Delete the following file and it will go away....
/system/csc/customer.xml
If you feel like figuring out which line of code generates the carrier label feel free, i didnt...lol. So I just deleted the whole file.
Enjoy
Thanks Button.
[MOD] GUIDE] Add working brightness slider and WiFi toggle to the expanded status bar
Add working brightness slider and WiFi toggle to the expanded status bar
ORIGINAL THREAD
This MOD/GUIDE will add a working brightness slider bar and Wifi quick button to your drop down status bar.
I know there are some other mods out there that do this by adding lidroid-res and a quick panel APK but this will do it with just some smali edits so no new APKs to install. This is just the brightness slider and WiFi quick button, not the 15 quickbutton mod
This has been tested on a STOCK DEODEXed LG7 ROM. If you want to add this to a custom ROM you will likely lose some other MODs/Themes.
Always Nandroid First!
Dev's, if you want to use this in your ROMs feel free but please throw me a thanks and some credit.
Here is the guide.....
We will be de/recompiling SystemUI.apk.
Navigate to res/values/arrays
find the following code
Code:
<item>Bluetooth</item>
<item>Location</item>
<item>SilentMode</item>
<item>MobileData</item>
<item>AutoRotate</item>
<item>PowerSaving</item>
<item>AirplaneMode</item>
<item>DrivingMode</item>
<item>Sync</item>
Change it to the following:
Code:
<item>Wifi</item>
<item>Location</item>
<item>Bluetooth</item>
<item>SilentMode</item>
<item>MobileData</item>
<item>AutoRotate</item>
<item>PowerSaving</item>
<item>AirplaneMode</item>
<item>DrivingMode</item>
Feel free to change the order of the code above to suit your needs. They will layout in your quickpanel in the same order you put them in above.
Navigate to res/layout/tw_status_bar_expanded.xml
Find the following code and delete the part in RED only:
Code:
<LinearLayout android:orientation="horizontal" android:focusable="true" [COLOR="Red"]android:visibility="gone"[/COLOR] android:clickable="true" android:layout_width="fill_parent" android:layout_height="56.0dip">
That will make the brightness slider visible but not yet functional.
Navigate to smali/com/android/systemui/statusbar/phone/PhoneStatusBar.smali
Add the following lines below in GREEN
Code:
.field private mBatteryTextObserver:Lcom/android/systemui/statusbar/phone/PhoneStatusBar$BatteryTextObserver;
[B][COLOR="SeaGreen"].field mBrightness:Lcom/android/systemui/statusbar/policy/BrightnessController;
[/COLOR][/B]
.field private mBroadcastReceiver:Landroid/content/BroadcastReceiver;
For the next step there are a lot of changes that need to be made in the Method. For the sake of time and this guide, we will simply C&P the entire method with the revised one. If you are anal like me and would like to see exactly what is being changed, simly use your editor compare tool to see the differences.
Find the following line:
Code:
.method interceptTouchEvent(Landroid/view/MotionEvent;)Z
Starting at (and including) the very next line delete all code all the way up to (and including) the first "end Method" you come to and paste in the following in its place. You may want to copy half the code and paste and copy the other half and paste. One C&P may not capture all the code at one time.
Code:
.locals 16
move-object/from16 v0, p0
iget v12, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mDisabled:I
const/high16 v13, 0x1
and-int/2addr v12, v13
if-eqz v12, :cond_0
const/4 v12, 0x0
:goto_0
return v12
:cond_0
const-string v12, "STATUSBAR-PhoneStatusBar"
new-instance v13, Ljava/lang/StringBuilder;
invoke-direct {v13}, Ljava/lang/StringBuilder;-><init>()V
const-string v14, "interceptTouchEvent() : "
invoke-virtual {v13, v14}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v13
move-object/from16 v0, p1
invoke-virtual {v13, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
move-result-object v13
invoke-virtual {v13}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v13
invoke-static {v12, v13}, Landroid/util/Slog;->d(Ljava/lang/String;Ljava/lang/String;)I
move-object/from16 v0, p0
iget-object v12, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mBrightness:Lcom/android/systemui/statusbar/policy/BrightnessController;
invoke-virtual {v12}, Lcom/android/systemui/statusbar/policy/BrightnessController;->syncBrightness()V
invoke-virtual/range {p1 .. p1}, Landroid/view/MotionEvent;->getAction()I
move-result v1
move-object/from16 v0, p0
iget-object v12, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarView:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
invoke-virtual {v12}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->getHeight()I
move-result v6
mul-int/lit8 v3, v6, 0x2
invoke-virtual/range {p1 .. p1}, Landroid/view/MotionEvent;->getRawY()F
move-result v12
float-to-int v10, v12
if-nez v1, :cond_7
invoke-virtual/range {p0 .. p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->isUnsecureKeyguardLocked()Z
move-result v12
if-eqz v12, :cond_1
invoke-virtual/range {p0 .. p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->pokeWakelock()V
:cond_1
move-object/from16 v0, p0
iget-boolean v12, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mExpanded:Z
if-nez v12, :cond_5
sub-int v12, v6, v10
move-object/from16 v0, p0
iput v12, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mViewDelta:I
:goto_1
move-object/from16 v0, p0
iget-boolean v12, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mExpanded:Z
if-nez v12, :cond_2
if-lt v10, v3, :cond_3
:cond_2
move-object/from16 v0, p0
iget-boolean v12, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mExpanded:Z
if-eqz v12, :cond_4
move-object/from16 v0, p0
iget-object v12, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mDisplayMetrics:Landroid/util/DisplayMetrics;
iget v12, v12, Landroid/util/DisplayMetrics;->heightPixels:I
sub-int/2addr v12, v3
if-le v10, v12, :cond_4
:cond_3
invoke-virtual/range {p1 .. p1}, Landroid/view/MotionEvent;->getRawX()F
move-result v12
float-to-int v8, v12
move-object/from16 v0, p0
iget v2, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mEdgeBorder:I
if-lt v8, v2, :cond_4
move-object/from16 v0, p0
iget-object v12, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mDisplayMetrics:Landroid/util/DisplayMetrics;
iget v12, v12, Landroid/util/DisplayMetrics;->widthPixels:I
sub-int/2addr v12, v2
if-ge v8, v12, :cond_4
move-object/from16 v0, p0
iget-boolean v12, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mExpanded:Z
if-nez v12, :cond_6
const/4 v12, 0x1
:goto_2
move-object/from16 v0, p0
invoke-virtual {v0, v10, v12}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->prepareTracking(IZ)V
invoke-direct/range {p0 .. p1}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->trackMovement(Landroid/view/MotionEvent;)V
:cond_4
:goto_3
const/4 v12, 0x0
goto/16 :goto_0
:cond_5
move-object/from16 v0, p0
iget-object v12, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mTrackingView:Lcom/android/systemui/statusbar/phone/TrackingView;
move-object/from16 v0, p0
iget-object v13, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mAbsPos:[I
invoke-virtual {v12, v13}, Lcom/android/systemui/statusbar/phone/TrackingView;->getLocationOnScreen([I)V
move-object/from16 v0, p0
iget-object v12, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mAbsPos:[I
const/4 v13, 0x1
aget v12, v12, v13
move-object/from16 v0, p0
iget-object v13, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mTrackingView:Lcom/android/systemui/statusbar/phone/TrackingView;
invoke-virtual {v13}, Lcom/android/systemui/statusbar/phone/TrackingView;->getHeight()I
move-result v13
add-int/2addr v12, v13
sub-int/2addr v12, v10
move-object/from16 v0, p0
iput v12, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mViewDelta:I
goto :goto_1
:cond_6
const/4 v12, 0x0
goto :goto_2
:cond_7
move-object/from16 v0, p0
iget-boolean v12, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mTracking:Z
if-eqz v12, :cond_4
invoke-direct/range {p0 .. p1}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->trackMovement(Landroid/view/MotionEvent;)V
move-object/from16 v0, p0
iget-object v12, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mCloseView:Lcom/android/systemui/statusbar/phone/CloseDragHandle;
invoke-virtual {v12}, Lcom/android/systemui/statusbar/phone/CloseDragHandle;->getHeight()I
move-result v12
add-int v4, v6, v12
const/4 v12, 0x2
if-ne v1, v12, :cond_a
invoke-virtual/range {p0 .. p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->isUnsecureKeyguardLocked()Z
move-result v12
if-eqz v12, :cond_8
invoke-virtual/range {p0 .. p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->pokeWakelock()V
:cond_8
move-object/from16 v0, p0
iget-boolean v12, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mAnimatingReveal:Z
if-eqz v12, :cond_9
if-lt v10, v4, :cond_4
:cond_9
const/4 v12, 0x0
move-object/from16 v0, p0
iput-boolean v12, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mAnimatingReveal:Z
move-object/from16 v0, p0
iget v12, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mViewDelta:I
add-int/2addr v12, v10
move-object/from16 v0, p0
invoke-virtual {v0, v12}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->updateExpandedViewPos(I)V
goto :goto_3
:cond_a
const/4 v12, 0x1
if-eq v1, v12, :cond_b
const/4 v12, 0x3
if-ne v1, v12, :cond_4
:cond_b
move-object/from16 v0, p0
iget-object v12, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mVelocityTracker:Landroid/view/VelocityTracker;
const/16 v13, 0x3e8
invoke-virtual {v12, v13}, Landroid/view/VelocityTracker;->computeCurrentVelocity(I)V
move-object/from16 v0, p0
iget-object v12, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mVelocityTracker:Landroid/view/VelocityTracker;
invoke-virtual {v12}, Landroid/view/VelocityTracker;->getYVelocity()F
move-result v11
const/4 v12, 0x0
cmpg-float v12, v11, v12
if-gez v12, :cond_f
const/4 v5, 0x1
:goto_4
move-object/from16 v0, p0
iget-object v12, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mVelocityTracker:Landroid/view/VelocityTracker;
invoke-virtual {v12}, Landroid/view/VelocityTracker;->getXVelocity()F
move-result v9
const/4 v12, 0x0
cmpg-float v12, v9, v12
if-gez v12, :cond_c
neg-float v9, v9
:cond_c
move-object/from16 v0, p0
iget v12, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mFlingGestureMaxXVelocityPx:F
cmpl-float v12, v9, v12
if-lez v12, :cond_d
move-object/from16 v0, p0
iget v9, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mFlingGestureMaxXVelocityPx:F
:cond_d
float-to-double v12, v11
float-to-double v14, v9
invoke-static {v12, v13, v14, v15}, Ljava/lang/Math;->hypot(DD)D
move-result-wide v12
double-to-float v7, v12
if-eqz v5, :cond_e
neg-float v7, v7
:cond_e
move-object/from16 v0, p0
iget v12, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mViewDelta:I
add-int/2addr v12, v10
const/4 v13, 0x0
move-object/from16 v0, p0
invoke-virtual {v0, v12, v7, v13}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->performFling(IFZ)V
goto/16 :goto_3
:cond_f
const/4 v5, 0x0
goto :goto_4
.end method
Find the following code and add the lines in GREEN:
Code:
iput-boolean v0, v1, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mUseStatusBarMarquee:Z
[COLOR="SeaGreen"][B]new-instance v19, Lcom/android/systemui/statusbar/policy/BrightnessController;
const v18, 0x7f0f0097
move/from16 v0, v18
invoke-virtual {v6, v0}, Lcom/android/systemui/statusbar/phone/ExpandedView;->findViewById(I)Landroid/view/View;
move-result-object v18
check-cast v18, Lcom/android/systemui/statusbar/policy/ToggleSlider;
move-object/from16 v0, v19
move-object/from16 v1, v18
invoke-direct {v0, v4, v1}, Lcom/android/systemui/statusbar/policy/BrightnessController;-><init>(Landroid/content/Context;Lcom/android/systemui/statusbar/policy/ToggleSlider;)V
move-object/from16 v0, v19
move-object/from16 v1, p0
iput-object v0, v1, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mBrightness:Lcom/android/systemui/statusbar/policy/BrightnessController;[/B]
[/COLOR]
invoke-direct/range {p0 .. p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->tw_loadNotificationShade()V
return-object v13
Find the following code and add the parts in GREEN
Code:
invoke-virtual {p0, v0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->setSystemUiVisibility(I)V
goto :goto_0
.end method
[B][COLOR="SeaGreen"].method public setMaxBrightness(I)V
.locals 1
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mBrightness:Lcom/android/systemui/statusbar/policy/BrightnessController;
invoke-virtual {v0, p1}, Lcom/android/systemui/statusbar/policy/BrightnessController;->setMaxBrightness(I)V
return-void
.end method
[/COLOR][/B]
.method setNotificationIconVisibility(ZI)V
Thats it!
Recompile
Chmod 644
Push to /system/app
Let me know how it goes.
[MOD] [Guide] Time and AM/PM Toggle
Time and AM/PM Toggle
ORIGINALTHREAD
Here is a time and am/pm toggle.
As always feel free to use these MODs with your ROM but since it took a few days to get this coded correctly just give me some thanks and some credit in your thread please.
[Q] What does this MOD do?
[A] It allows you to toggle off the TIME, the AM/PM, or both with toggles located in settings/date/time options
Here are the goodies.....
We will be working with two files.
-SecSettings
-SystemUI.apk
As always, I will assume you know how to compile/decompile so I will not be providing information how to do that.
Lets begin with SystemUI
Navigate to smali/com/android/systemui/statusbar/policy/clock.smali
This part is optional. This will make your AM/PM small or lowercase.
Find the following code
Code:
.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V
.locals 3
.parameter "context"
.parameter "attrs"
.parameter "defStyle"
.prologue
const/4 v2, [B]0x1 = small am/pm
0x0 = regular size am/pm[/B]
Find the following code
Code:
.method private final getSmallTime()Ljava/lang/CharSequence;
Replace the entire method with the following code
Code:
.method private final getSmallTime()Ljava/lang/CharSequence;
.locals 22
.prologue
.line 227
invoke-virtual/range {p0 .. p0}, Lcom/android/systemui/statusbar/policy/Clock;->getContext()Landroid/content/Context;
move-result-object v8
invoke-virtual {v8}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v2
const-string v7, "hide_time"
const/4 v0, 0x0
invoke-static {v2, v7, v0}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v7
const/4 v0, 0x0
if-eqz v7, :cond_0
const/16 v0, 0x8
:cond_0
const v1,[B][COLOR="red"] 0x7f0d003d
[/COLOR][/B]
move-object/from16 v2, p0
invoke-virtual {v2, v1}, Landroid/view/View;->findViewById(I)Landroid/view/View;
move-result-object v1
invoke-virtual {v1, v0}, Landroid/view/View;->setVisibility(I)V
invoke-static {v8}, Landroid/text/format/DateFormat;->is24HourFormat(Landroid/content/Context;)Z
move-result v6
.line 234
.local v6, b24:Z
if-eqz v6, :cond_5
.line 235
const v16, 0x10400a3
.line 249
.local v16, res:I
:goto_0
const v2, 0xef00
.line 250
.local v2, MAGIC1:C
const v3, 0xef01
.line 253
.local v3, MAGIC2:C
move/from16 v0, v16
invoke-virtual {v8, v0}, Landroid/content/Context;->getString(I)Ljava/lang/String;
move-result-object v9
if-nez v6, :cond_1
invoke-virtual {v8}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v2
const-string v3, "hide_ampm"
const/4 v0, 0x0
invoke-static {v2, v3, v0}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v7
const-string v0, "ampm"
new-instance v1, Ljava/lang/StringBuilder;
invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
const-string v2, "getint returned="
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v1
invoke-virtual {v1, v7}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
move-result-object v1
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v1
invoke-static {v0, v1}, Landroid/util/Slog;->i(Ljava/lang/String;Ljava/lang/String;)I
move v2, v7
if-eqz v2, :cond_1
const-string v9, "h:mm"
:cond_1
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/systemui/statusbar/policy/Clock;->mClockFormatString:Ljava/lang/String;
move-object/from16 v20, v0
move-object/from16 v0, v20
invoke-virtual {v9, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v20
if-eqz v20, :cond_2
if-nez v6, :cond_a
move-object/from16 v0, p0
iget-boolean v0, v0, Lcom/android/systemui/statusbar/policy/Clock;->mLocaleChanged:Z
move/from16 v20, v0
if-eqz v20, :cond_a
.line 257
:cond_2
const/16 v20, 0x0
move/from16 v0, v20
move-object/from16 v1, p0
iput-boolean v0, v1, Lcom/android/systemui/statusbar/policy/Clock;->mLocaleChanged:Z
.line 264
move-object/from16 v0, p0
iget v0, v0, Lcom/android/systemui/statusbar/policy/Clock;->AM_PM_STYLE:I
move/from16 v20, v0
if-eqz v20, :cond_9
.line 265
const/4 v4, -0x1
.line 266
.local v4, a:I
const/4 v15, 0x0
.line 267
.local v15, quoted:Z
const/4 v11, 0x0
.local v11, i:I
:goto_1
invoke-virtual {v9}, Ljava/lang/String;->length()I
move-result v20
move/from16 v0, v20
if-ge v11, v0, :cond_4
.line 268
invoke-virtual {v9, v11}, Ljava/lang/String;->charAt(I)C
move-result v7
.line 270
.local v7, c:C
const/16 v20, 0x27
move/from16 v0, v20
if-ne v7, v0, :cond_3
.line 271
if-nez v15, :cond_6
const/4 v15, 0x1
.line 273
:cond_3
:goto_2
if-nez v15, :cond_7
const/16 v20, 0x61
move/from16 v0, v20
if-ne v7, v0, :cond_7
.line 274
move v4, v11
.line 279
.end local v7 #c:C
:cond_4
if-ltz v4, :cond_9
.line 281
move v5, v4
.line 282
.local v5, b:I
:goto_3
if-lez v4, :cond_8
add-int/lit8 v20, v4, -0x1
move/from16 v0, v20
invoke-virtual {v9, v0}, Ljava/lang/String;->charAt(I)C
move-result v20
invoke-static/range {v20 .. v20}, Ljava/lang/Character;->isWhitespace(C)Z
move-result v20
if-eqz v20, :cond_8
.line 283
add-int/lit8 v4, v4, -0x1
goto :goto_3
.line 237
.end local v2 #MAGIC1:C
.end local v3 #MAGIC2:C
.end local v4 #a:I
.end local v5 #b:I
.end local v9
.end local v11 #i:I
.end local v15 #quoted:Z
.end local v16 #res:I
:cond_5
const v16, 0x10400a2
.restart local v16 #res:I
goto/16 :goto_0
.line 271
.restart local v2 #MAGIC1:C
.restart local v3 #MAGIC2:C
.restart local v4 #a:I
.restart local v7 #c:C
.restart local v9
.restart local v11 #i:I
.restart local v15 #quoted:Z
:cond_6
const/4 v15, 0x0
goto :goto_2
.line 267
:cond_7
add-int/lit8 v11, v11, 0x1
goto :goto_1
.line 285
.end local v7 #c:C
.restart local v5 #b:I
:cond_8
new-instance v20, Ljava/lang/StringBuilder;
invoke-direct/range {v20 .. v20}, Ljava/lang/StringBuilder;-><init>()V
const/16 v21, 0x0
move/from16 v0, v21
invoke-virtual {v9, v0, v4}, Ljava/lang/String;->substring(II)Ljava/lang/String;
move-result-object v21
invoke-virtual/range {v20 .. v21}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v20
const v21, 0xef00
invoke-virtual/range {v20 .. v21}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder;
move-result-object v20
invoke-virtual {v9, v4, v5}, Ljava/lang/String;->substring(II)Ljava/lang/String;
move-result-object v21
invoke-virtual/range {v20 .. v21}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v20
const-string v21, "a"
invoke-virtual/range {v20 .. v21}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v20
const v21, 0xef01
invoke-virtual/range {v20 .. v21}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder;
move-result-object v20
add-int/lit8 v21, v5, 0x1
move/from16 v0, v21
invoke-virtual {v9, v0}, Ljava/lang/String;->substring(I)Ljava/lang/String;
move-result-object v21
invoke-virtual/range {v20 .. v21}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v20
invoke-virtual/range {v20 .. v20}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v9
.line 290
.end local v4 #a:I
.end local v5 #b:I
.end local v11 #i:I
.end local v15 #quoted:Z
:cond_9
new-instance v18, Ljava/text/SimpleDateFormat;
move-object/from16 v0, v18
invoke-direct {v0, v9}, Ljava/text/SimpleDateFormat;-><init>(Ljava/lang/String;)V
.local v18, sdf:Ljava/text/SimpleDateFormat;
move-object/from16 v0, v18
move-object/from16 v1, p0
iput-object v0, v1, Lcom/android/systemui/statusbar/policy/Clock;->mClockFormat:Ljava/text/SimpleDateFormat;
.line 291
move-object/from16 v0, p0
iput-object v9, v0, Lcom/android/systemui/statusbar/policy/Clock;->mClockFormatString:Ljava/lang/String;
.line 295
:goto_4
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/systemui/statusbar/policy/Clock;->mCalendar:Ljava/util/Calendar;
move-object/from16 v20, v0
invoke-virtual/range {v20 .. v20}, Ljava/util/Calendar;->getTime()Ljava/util/Date;
move-result-object v20
move-object/from16 v0, v18
move-object/from16 v1, v20
invoke-virtual {v0, v1}, Ljava/text/SimpleDateFormat;->format(Ljava/util/Date;)Ljava/lang/String;
move-result-object v17
.line 297
.local v17, result:Ljava/lang/String;
move-object/from16 v0, p0
iget v0, v0, Lcom/android/systemui/statusbar/policy/Clock;->AM_PM_STYLE:I
move/from16 v20, v0
if-eqz v20, :cond_f
.line 298
const v20, 0xef00
move-object/from16 v0, v17
move/from16 v1, v20
invoke-virtual {v0, v1}, Ljava/lang/String;->indexOf(I)I
move-result v12
.line 299
.local v12, magic1:I
const v20, 0xef01
move-object/from16 v0, v17
move/from16 v1, v20
invoke-virtual {v0, v1}, Ljava/lang/String;->indexOf(I)I
move-result v13
.line 300
.local v13, magic2:I
if-ltz v12, :cond_f
if-le v13, v12, :cond_f
.line 301
new-instance v10, Landroid/text/SpannableStringBuilder;
move-object/from16 v0, v17
invoke-direct {v10, v0}, Landroid/text/SpannableStringBuilder;-><init>(Ljava/lang/CharSequence;)V
.line 302
.local v10, formatted:Landroid/text/SpannableStringBuilder;
move-object/from16 v0, p0
iget v0, v0, Lcom/android/systemui/statusbar/policy/Clock;->AM_PM_STYLE:I
move/from16 v20, v0
const/16 v21, 0x2
move/from16 v0, v20
move/from16 v1, v21
if-ne v0, v1, :cond_b
.line 303
add-int/lit8 v20, v13, 0x1
move/from16 v0, v20
invoke-virtual {v10, v12, v0}, Landroid/text/SpannableStringBuilder;->delete(II)Landroid/text/SpannableStringBuilder;
.line 324
.end local v10 #formatted:Landroid/text/SpannableStringBuilder;
.end local v12 #magic1:I
.end local v13 #magic2:I
:goto_5
return-object v10
.line 293
.end local v17 #result:Ljava/lang/String;
.end local v18 #sdf:Ljava/text/SimpleDateFormat;
:cond_a
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/systemui/statusbar/policy/Clock;->mClockFormat:Ljava/text/SimpleDateFormat;
move-object/from16 v18, v0
goto :goto_4
:cond_b
move-object/from16 v0, p0
iget v0, v0, Lcom/android/systemui/statusbar/policy/Clock;->AM_PM_STYLE:I
move/from16 v20, v0
const/16 v21, 0x1
move/from16 v0, v20
move/from16 v1, v21
if-ne v0, v1, :cond_e
.line 307
const v14, 0x3f333333
sget-boolean v20, Lcom/android/systemui/statusbar/BaseStatusBar;->useTouchWizGUI:Z
if-eqz v20, :cond_d
sget-boolean v20, Lcom/android/systemui/statusbar/BaseStatusBar;->canStatusBarHide:Z
if-eqz v20, :cond_c
move-object/from16 v0, p0
iget-boolean v0, v0, Lcom/android/systemui/statusbar/policy/Clock;->mExpandedHeader:Z
move/from16 v20, v0
if-eqz v20, :cond_d
.line 309
:cond_c
const/high16 v14, 0x3f00
.line 312
:cond_d
new-instance v19, Landroid/text/style/RelativeSizeSpan;
move-object/from16 v0, v19
invoke-direct {v0, v14}, Landroid/text/style/RelativeSizeSpan;-><init>(F)V
.line 314
.local v19, style:Landroid/text/style/CharacterStyle;
const/16 v20, 0x22
move-object/from16 v0, v19
move/from16 v1, v20
invoke-virtual {v10, v0, v12, v13, v1}, Landroid/text/SpannableStringBuilder;->setSpan(Ljava/lang/Object;III)V
.line 317
.end local v14
.end local v19 #style:Landroid/text/style/CharacterStyle;
:cond_e
add-int/lit8 v20, v13, 0x1
move/from16 v0, v20
invoke-virtual {v10, v13, v0}, Landroid/text/SpannableStringBuilder;->delete(II)Landroid/text/SpannableStringBuilder;
.line 318
add-int/lit8 v20, v12, 0x1
move/from16 v0, v20
invoke-virtual {v10, v12, v0}, Landroid/text/SpannableStringBuilder;->delete(II)Landroid/text/SpannableStringBuilder;
goto :goto_5
.end local v10 #formatted:Landroid/text/SpannableStringBuilder;
.end local v12 #magic1:I
.end local v13 #magic2:I
:cond_f
move-object/from16 v10, v17
.line 324
goto :goto_5
.end method
In the first section of code you will see an ID highlighted in RED. This is the CLOCK ID. Make sure this ID matches your CLOCK ID located in res/values/public of SystemUI
I know its a lot of code but to single out each change would take too long. Feel free to Diff out the individual changes if you want.
Navigate to smali/com/android/systemui/statusbar/phone/PhoneStatusBar.smali
Find the method "Method Public ShowClock"
Replace the entiremethod withthe following code
Code:
.method public showClock(Z)V
.locals 3
.parameter "show"
.prologue
.line 1606
iget-object v1, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarView:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
if-nez v1, :cond_1
.line 1616
:cond_0
:goto_0
return-void
.line 1607
:cond_1
iget-object v1, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarView:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
const v2, 0x7f0d003d
invoke-virtual {v1, v2}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->findViewById(I)Landroid/view/View;
move-result-object v0
.line 1608
.local v0, clock:Landroid/view/View;
if-eqz v0, :cond_0
.line 1609
if-eqz p1, :cond_2
const/4 v1, 0x0
iget-object v2, p0, Lcom/android/systemui/SystemUI;->mContext:Landroid/content/Context;
invoke-virtual {v2}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v2
const-string v3, "hide_time"
invoke-static {v2, v3, v1}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v2
if-eqz v2, :goto_0
const/16 v1, 0x8
:goto_1
invoke-virtual {v0, v1}, Landroid/view/View;->setVisibility(I)V
.line 1612
sget-boolean v1, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->useTouchWizGUI:Z
if-eqz v1, :cond_0
sget-boolean v1, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->alwaysShowMenuKey:Z
if-eqz v1, :cond_0
.line 1613
iget-object v1, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mNavigationBarView:Lcom/android/systemui/statusbar/phone/NavigationBarView;
invoke-virtual {v1, p1}, Lcom/android/systemui/statusbar/phone/NavigationBarView;->setMenuButtonVisibilityForLockscreen(Z)V
goto :goto_0
.line 1609
:cond_2
const/16 v1, 0x8
goto :goto_1
.end method
Thats it for SystemUI. Compile and push to /system/app
See Post #2 for the rest of the tutorial.
[MOD] [Guide] Time and AM/PM Toggle Part 2
Time and AM/PM Toggle Part 2
Part 2
Now for SecSettings.
Navigate to res/values/
Add the following code somewhere in this file. Middle or end, it doesnt matter.
Code:
<string name="disable_time">Hide Time</string>
<string name="disable_time_text">Remove time from status bar</string>
<string name="disable_ampm">Hide AM/PM</string>
<string name="disable_ampm_text">Remove AM/PM from time in status bar</string>
Navigate to res/xml/Date_Time_Prefs.xml
Add the following code below in RED.
Code:
<CheckBoxPreference android:title="@string/zone_auto" android:key="auto_zone" android:summaryOn="@string/zone_auto_summaryOn" android:summaryOff="@string/zone_auto_summaryOff" />
[COLOR="red"] <CheckBoxPreference android:title="@string/disable_time" android:key="hide_time" android:summary="@string/disable_time_text" />
<CheckBoxPreference android:title="@string/disable_ampm" android:key="hide_ampm" android:summary="@string/disable_ampm_text" />
[/COLOR] <PreferenceScreen android:title="@string/date_time_set_timezone" android:key="timezone" android:summary="GMT-8:00" android:fragment="com.android.settings.ZonePicker" />
Now for some smali
Navigate to smali/com/android/settings/DateTimeSettings.smali
Add the following code below in RED
Code:
.field private mDummyDate:Ljava/util/Calendar;
[COLOR="red"].field private mHideAmPm:Landroid/preference/Preference;
.field private mHideTime:Landroid/preference/Preference;
[/COLOR]
.field private mIntentReceiver:Landroid/content/BroadcastReceiver;
Find the following method
Code:
.method private initUI()V
Replace that entire method with the following code
Code:
.method private initUI()V
.locals 8
.prologue
const/4 v5, 0x1
const/4 v6, 0x0
.line 152
const-string v4, "auto_time"
invoke-direct {p0, v4}, Lcom/android/settings/DateTimeSettings;->getAutoState(Ljava/lang/String;)Z
move-result v0
.line 153
.local v0, autoTimeEnabled:Z
const-string v4, "auto_time_zone"
invoke-direct {p0, v4}, Lcom/android/settings/DateTimeSettings;->getAutoState(Ljava/lang/String;)Z
move-result v1
.line 155
.local v1, autoTimeZoneEnabled:Z
invoke-virtual {p0}, Lcom/android/settings/DateTimeSettings;->getActivity()Landroid/app/Activity;
move-result-object v4
invoke-virtual {v4}, Landroid/app/Activity;->getIntent()Landroid/content/Intent;
move-result-object v2
.line 156
.local v2, intent:Landroid/content/Intent;
const-string v4, "firstRun"
invoke-virtual {v2, v4, v6}, Landroid/content/Intent;->getBooleanExtra(Ljava/lang/String;Z)Z
move-result v3
.line 158
.local v3, isFirstRun:Z
invoke-static {}, Ljava/util/Calendar;->getInstance()Ljava/util/Calendar;
move-result-object v4
iput-object v4, p0, Lcom/android/settings/DateTimeSettings;->mDummyDate:Ljava/util/Calendar;
.line 160
const-string v4, "auto_time"
invoke-virtual {p0, v4}, Lcom/android/settings/DateTimeSettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v4
check-cast v4, Landroid/preference/CheckBoxPreference;
iput-object v4, p0, Lcom/android/settings/DateTimeSettings;->mAutoTimePref:Landroid/preference/CheckBoxPreference;
.line 161
iget-object v4, p0, Lcom/android/settings/DateTimeSettings;->mAutoTimePref:Landroid/preference/CheckBoxPreference;
invoke-virtual {v4, v0}, Landroid/preference/CheckBoxPreference;->setChecked(Z)V
.line 162
const-string v4, "auto_zone"
invoke-virtual {p0, v4}, Lcom/android/settings/DateTimeSettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v4
check-cast v4, Landroid/preference/CheckBoxPreference;
iput-object v4, p0, Lcom/android/settings/DateTimeSettings;->mAutoTimeZonePref:Landroid/preference/CheckBoxPreference;
.line 165
invoke-virtual {p0}, Lcom/android/settings/DateTimeSettings;->getActivity()Landroid/app/Activity;
move-result-object v4
invoke-static {v4}, Lcom/android/settings/Utils;->isWifiOnly(Landroid/content/Context;)Z
move-result v4
if-nez v4, :cond_0
if-eqz v3, :cond_2
.line 166
:cond_0
invoke-virtual {p0}, Lcom/android/settings/DateTimeSettings;->getPreferenceScreen()Landroid/preference/PreferenceScreen;
move-result-object v4
iget-object v7, p0, Lcom/android/settings/DateTimeSettings;->mAutoTimeZonePref:Landroid/preference/CheckBoxPreference;
invoke-virtual {v4, v7}, Landroid/preference/PreferenceScreen;->removePreference(Landroid/preference/Preference;)Z
.line 167
invoke-virtual {p0}, Lcom/android/settings/DateTimeSettings;->getActivity()Landroid/app/Activity;
move-result-object v4
invoke-static {v4}, Lcom/android/settings/Utils;->isWifiOnly(Landroid/content/Context;)Z
move-result v4
if-eqz v4, :cond_1
.line 168
invoke-virtual {p0}, Lcom/android/settings/DateTimeSettings;->getPreferenceScreen()Landroid/preference/PreferenceScreen;
move-result-object v4
iget-object v7, p0, Lcom/android/settings/DateTimeSettings;->mAutoTimePref:Landroid/preference/CheckBoxPreference;
invoke-virtual {v4, v7}, Landroid/preference/PreferenceScreen;->removePreference(Landroid/preference/Preference;)Z
.line 169
invoke-virtual {p0}, Lcom/android/settings/DateTimeSettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v4
const-string v7, "auto_time_zone"
invoke-static {v4, v7, v6}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z
.line 171
invoke-virtual {p0}, Lcom/android/settings/DateTimeSettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v4
const-string v7, "auto_time"
invoke-static {v4, v7, v6}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z
.line 173
const/4 v0, 0x0
.line 175
:cond_1
const/4 v1, 0x0
.line 177
:cond_2
iget-object v4, p0, Lcom/android/settings/DateTimeSettings;->mAutoTimeZonePref:Landroid/preference/CheckBoxPreference;
invoke-virtual {v4, v1}, Landroid/preference/CheckBoxPreference;->setChecked(Z)V
.line 179
const-string v4, "time"
invoke-virtual {p0, v4}, Lcom/android/settings/DateTimeSettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v4
iput-object v4, p0, Lcom/android/settings/DateTimeSettings;->mTimePref:Landroid/preference/Preference;
.line 180
const-string v4, "24 hour"
invoke-virtual {p0, v4}, Lcom/android/settings/DateTimeSettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v4
iput-object v4, p0, Lcom/android/settings/DateTimeSettings;->mTime24Pref:Landroid/preference/Preference;
.line 181
const-string v4, "timezone"
invoke-virtual {p0, v4}, Lcom/android/settings/DateTimeSettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v4
iput-object v4, p0, Lcom/android/settings/DateTimeSettings;->mTimeZone:Landroid/preference/Preference;
.line 182
const-string v4, "date"
invoke-virtual {p0, v4}, Lcom/android/settings/DateTimeSettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v4
iput-object v4, p0, Lcom/android/settings/DateTimeSettings;->mDatePref:Landroid/preference/Preference;
.line 183
const-string v4, "date_format"
invoke-virtual {p0, v4}, Lcom/android/settings/DateTimeSettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v4
check-cast v4, Landroid/preference/ListPreference;
iput-object v4, p0, Lcom/android/settings/DateTimeSettings;->mDateFormat:Landroid/preference/ListPreference;
.line 184
if-eqz v3, :cond_3
.line 185
invoke-virtual {p0}, Lcom/android/settings/DateTimeSettings;->getPreferenceScreen()Landroid/preference/PreferenceScreen;
move-result-object v4
iget-object v7, p0, Lcom/android/settings/DateTimeSettings;->mTime24Pref:Landroid/preference/Preference;
invoke-virtual {v4, v7}, Landroid/preference/PreferenceScreen;->removePreference(Landroid/preference/Preference;)Z
.line 186
invoke-virtual {p0}, Lcom/android/settings/DateTimeSettings;->getPreferenceScreen()Landroid/preference/PreferenceScreen;
move-result-object v4
iget-object v7, p0, Lcom/android/settings/DateTimeSettings;->mDateFormat:Landroid/preference/ListPreference;
invoke-virtual {v4, v7}, Landroid/preference/PreferenceScreen;->removePreference(Landroid/preference/Preference;)Z
.line 189
:cond_3
invoke-virtual {p0}, Lcom/android/settings/DateTimeSettings;->updateDateFormatEntries()V
.line 192
iget-object v7, p0, Lcom/android/settings/DateTimeSettings;->mTimePref:Landroid/preference/Preference;
if-nez v0, :cond_6
move v4, v5
:goto_0
invoke-virtual {v7, v4}, Landroid/preference/Preference;->setEnabled(Z)V
.line 193
iget-object v7, p0, Lcom/android/settings/DateTimeSettings;->mDatePref:Landroid/preference/Preference;
if-nez v0, :cond_7
move v4, v5
:goto_1
invoke-virtual {v7, v4}, Landroid/preference/Preference;->setEnabled(Z)V
.line 194
iget-object v4, p0, Lcom/android/settings/DateTimeSettings;->mTimeZone:Landroid/preference/Preference;
if-nez v1, :cond_8
:goto_2
invoke-virtual {v4, v5}, Landroid/preference/Preference;->setEnabled(Z)V
.line 197
invoke-direct {p0}, Lcom/android/settings/DateTimeSettings;->applyEDMDateTimeChangePolicy()V
const-string v4, "hide_time"
invoke-virtual {p0, v4}, Lcom/android/settings/DateTimeSettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v4
check-cast v4, Landroid/preference/Preference;
iput-object v4, p0, Lcom/android/settings/DateTimeSettings;->mHideTime:Landroid/preference/Preference;
const-string v4, "hide_ampm"
invoke-virtual {p0, v4}, Lcom/android/settings/DateTimeSettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v4
check-cast v4, Landroid/preference/Preference;
iput-object v4, p0, Lcom/android/settings/DateTimeSettings;->mHideAmPm:Landroid/preference/Preference;
iget-object v0, p0, Lcom/android/settings/DateTimeSettings;->mHideTime:Landroid/preference/Preference;
check-cast v0, Landroid/preference/CheckBoxPreference;
invoke-virtual {v0}, Landroid/preference/CheckBoxPreference;->isChecked()Z
move-result v0
if-eqz v0, :cond_4
const/4 v0, 0x0
iget-object v4, p0, Lcom/android/settings/DateTimeSettings;->mHideAmPm:Landroid/preference/Preference;
invoke-virtual {v4, v0}, Landroid/preference/Preference;->setEnabled(Z)V
iget-object v4, p0, Lcom/android/settings/DateTimeSettings;->mTime24Pref:Landroid/preference/Preference;
invoke-virtual {v4, v0}, Landroid/preference/Preference;->setEnabled(Z)V
:cond_4
iget-object v0, p0, Lcom/android/settings/DateTimeSettings;->mTime24Pref:Landroid/preference/Preference;
check-cast v0, Landroid/preference/CheckBoxPreference;
invoke-virtual {v0}, Landroid/preference/CheckBoxPreference;->isChecked()Z
move-result v0
if-eqz v0, :cond_5
const/4 v0, 0x0
iget-object v4, p0, Lcom/android/settings/DateTimeSettings;->mHideAmPm:Landroid/preference/Preference;
invoke-virtual {v4, v0}, Landroid/preference/Preference;->setEnabled(Z)V
:cond_5
return-void
:cond_6
move v4, v6
.line 192
goto :goto_0
:cond_7
move v4, v6
.line 193
goto :goto_1
:cond_8
move v5, v6
.line 194
goto :goto_2
.end method
Find the following method
Code:
.method public onPreferenceTreeClick(Landroid/preference/PreferenceScreen;Landroid/preference/Preference;)Z
Replace the entire method with the following code.
Code:
.method public onPreferenceTreeClick(Landroid/preference/PreferenceScreen;Landroid/preference/Preference;)Z
.locals 6
.parameter "preferenceScreen"
.parameter "preference"
.prologue
const/4 v2, 0x1
const/4 v1, 0x0
.line 486
iget-object v0, p0, Lcom/android/settings/DateTimeSettings;->mDatePref:Landroid/preference/Preference;
if-ne p2, v0, :cond_1
.line 487
invoke-virtual {p0, v1}, Lcom/android/settings/DateTimeSettings;->removeDialog(I)V
.line 488
invoke-virtual {p0, v1}, Lcom/android/settings/DateTimeSettings;->showDialog(I)V
.line 498
:cond_0
:goto_0
invoke-super {p0, p1, p2}, Lcom/android/settings/SettingsPreferenceFragment;->onPreferenceTreeClick(Landroid/preference/PreferenceScreen;Landroid/preference/Preference;)Z
move-result v0
return v0
.line 489
:cond_1
iget-object v0, p0, Lcom/android/settings/DateTimeSettings;->mTimePref:Landroid/preference/Preference;
if-ne p2, v0, :cond_2
.line 491
invoke-virtual {p0, v2}, Lcom/android/settings/DateTimeSettings;->removeDialog(I)V
.line 492
invoke-virtual {p0, v2}, Lcom/android/settings/DateTimeSettings;->showDialog(I)V
goto :goto_0
.line 493
:cond_2
iget-object v0, p0, Lcom/android/settings/DateTimeSettings;->mTime24Pref:Landroid/preference/Preference;
if-ne p2, v0, :cond_4
.line 494
iget-object v0, p0, Lcom/android/settings/DateTimeSettings;->mTime24Pref:Landroid/preference/Preference;
check-cast v0, Landroid/preference/CheckBoxPreference;
invoke-virtual {v0}, Landroid/preference/CheckBoxPreference;->isChecked()Z
move-result v0
invoke-direct {p0, v0}, Lcom/android/settings/DateTimeSettings;->set24Hour(Z)V
iget-object v1, p0, Lcom/android/settings/DateTimeSettings;->mHideAmPm:Landroid/preference/Preference;
if-nez v0, :cond_3
const/4 v0, 0x1
goto :goto_1
:cond_3
const/4 v0, 0x0
:goto_1
invoke-virtual {v1, v0}, Landroid/preference/Preference;->setEnabled(Z)V
.line 494
:goto_2
invoke-virtual {p0}, Lcom/android/settings/DateTimeSettings;->getActivity()Landroid/app/Activity;
move-result-object v0
invoke-virtual {p0, v0}, Lcom/android/settings/DateTimeSettings;->updateTimeAndDateDisplay(Landroid/content/Context;)V
.line 496
invoke-direct {p0}, Lcom/android/settings/DateTimeSettings;->timeUpdated()V
goto :goto_0
:cond_4
const-string v3, "hide_ampm"
iget-object v0, p0, Lcom/android/settings/DateTimeSettings;->mHideAmPm:Landroid/preference/Preference;
if-ne p2, v0, :cond_5
iget-object v0, p0, Lcom/android/settings/DateTimeSettings;->mHideAmPm:Landroid/preference/Preference;
check-cast v0, Landroid/preference/CheckBoxPreference;
invoke-virtual {v0}, Landroid/preference/CheckBoxPreference;->isChecked()Z
move-result v2
invoke-virtual {p0}, Lcom/android/settings/DateTimeSettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v3
const-string v4, "hide_ampm"
invoke-static {v3, v4, v2}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z
goto :goto_2
:cond_5
const-string v3, "hide_time"
iget-object v0, p0, Lcom/android/settings/DateTimeSettings;->mHideTime:Landroid/preference/Preference;
if-ne p2, v0, :cond_0
iget-object v0, p0, Lcom/android/settings/DateTimeSettings;->mHideTime:Landroid/preference/Preference;
check-cast v0, Landroid/preference/CheckBoxPreference;
invoke-virtual {v0}, Landroid/preference/CheckBoxPreference;->isChecked()Z
move-result v2
invoke-virtual {p0}, Lcom/android/settings/DateTimeSettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v3
const-string v4, "hide_time"
invoke-static {v3, v4, v2}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z
if-nez v2, :cond_6
const/4 v2, 0x1
goto :goto_3
:cond_6
const/4 v2, 0x0
:goto_3
iget-object v1, p0, Lcom/android/settings/DateTimeSettings;->mHideAmPm:Landroid/preference/Preference;
invoke-virtual {v1, v2}, Landroid/preference/Preference;->setEnabled(Z)V
iget-object v1, p0, Lcom/android/settings/DateTimeSettings;->mTime24Pref:Landroid/preference/Preference;
invoke-virtual {v1, v2}, Landroid/preference/Preference;->setEnabled(Z)V
goto :goto_2
.end method
Thats it for SecSettings. Recompile and push to /system/app
[MOD] [GUIDE] AOSP LockScreen with Toggle
AOSP LockScreen with Toggle
ORIGINAL THREAD
As always feel free to use these MODs with your ROM but since it took a few days to get this coded correctly just give me some thanks and some credit in your thread please.
[Q] What does this MOD do?
[A] It allows you to toggle between TW lock screen or AOSP lock screen.
*****EDIT******
If you experience your lock screen freezing when you turn it to landscape mode, just go to lockscreen options and make sure all settings are UNTICKED......except for AOSP lockscreen that is .
Thanks to jdub251 for the feedback.
Here are the goodies.....
We will be working in two files.
-SecSettings
-android.policy
As always, I will assume you know how to compile/decompile so I will not be providing information how to do that.
Lets begin with the easiest file, Android.policy.jar
Navigate to smali/com/android/internal/policy/imp/LockPatternKeyguardView
Find the following code
Code:
.method createLockScreen()Landroid/view/View;
We are going to replace the whole method with the following code.
Code:
.method createLockScreen()Landroid/view/View;
.locals 6
.prologue
.line 1268
const/4 v0, 0x0
iget-object v5, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mContext:Landroid/content/Context;
invoke-virtual {v5}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v5
const-string v4, "enable_aosp_lock"
invoke-static {v5, v4, v0}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v5
if-nez v5, :cond_0
.line 1044
new-instance v0, Lcom/android/internal/policy/impl/sec/CircleLockScreen;
iget-object v1, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mContext:Landroid/content/Context;
iget-object v2, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mConfiguration:Landroid/content/res/Configuration;
iget-object v3, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mLockPatternUtils:Lcom/android/internal/widget/LockPatternUtils;
iget-object v4, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mUpdateMonitor:Lcom/android/internal/policy/impl/KeyguardUpdateMonitor;
iget-object v5, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mKeyguardScreenCallback:Lcom/android/internal/policy/impl/KeyguardScreenCallback;
invoke-direct/range {v0 .. v5}, Lcom/android/internal/policy/impl/sec/CircleLockScreen;-><init>(Landroid/content/Context;Landroid/content/res/Configuration;Lcom/android/internal/widget/LockPatternUtils;Lcom/android/internal/policy/impl/KeyguardUpdateMonitor;Lcom/android/internal/policy/impl/KeyguardScreenCallback;)V
.line 1274
.local v0, lockView:Landroid/view/View;
:goto_0
invoke-direct {p0, v0}, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->initializeTransportControlView(Landroid/view/View;)V
.line 1275
return-object v0
:cond_0
new-instance v0, Lcom/android/internal/policy/impl/LockScreen;
iget-object v1, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mContext:Landroid/content/Context;
iget-object v2, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mConfiguration:Landroid/content/res/Configuration;
iget-object v3, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mLockPatternUtils:Lcom/android/internal/widget/LockPatternUtils;
iget-object v4, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mUpdateMonitor:Lcom/android/internal/policy/impl/KeyguardUpdateMonitor;
iget-object v5, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mKeyguardScreenCallback:Lcom/android/internal/policy/impl/KeyguardScreenCallback;
invoke-direct/range {v0 .. v5}, Lcom/android/internal/policy/impl/LockScreen;-><init>(Landroid/content/Context;Landroid/content/res/Configuration;Lcom/android/internal/widget/LockPatternUtils;Lcom/android/internal/policy/impl/KeyguardUpdateMonitor;Lcom/android/internal/policy/impl/KeyguardScreenCallback;)V
.line 1274
goto :goto_0
.end method
Thats it for android.policy.jar. Recompile and push to /system/app. If you want to Diff out the exact changes feel free.
Now for SecSettings.
Navigate to res/values/strings
Add the following lines somewhere in this file. In the middle or end, it doesnt matter.
Code:
<string name="enable_aosp_lock">Enable AOSP lockscreen</string>
<string name="enable_aosp_lock_text">Enable AOSP lockscreen in place of circle lockscreen</string>
Navigate to res/xml/Lockscreen_Settings.xml
Add the following line below in RED.
Code:
<PreferenceCategory android:title="@string/display_settings" />
[COLOR="red"]<CheckBoxPreference android:title="@string/enable_aosp_lock" android:key="enable_aosp_lock" android:summary="@string/enable_aosp_lock_text" />
[/COLOR] <SwitchPreferenceScreen android:title="@string/lock_screen_shortcut_title" android:key="lock_screen_shortcut" android:summary="@string/lock_screen_shortcut_summary">
Now lets hit some smali.....
Still in SecSettings, lets navigate to smali/com/android/settings/LockScreenSettings
Find the following code
Code:
.field private mWeather:Landroid/preference/SwitchPreferenceScreen;
Add this line below it
Code:
.field private mAospLock:Landroid/preference/CheckBoxPreference;
Find the following code and add the parts in RED
Code:
.method private updateState()V
.locals 9
.prologue
const/4 v5, 0x1
const/4 v6, 0x0
.line 263
[COLOR="Red"]iget-object v7, p0, Lcom/android/settings/LockScreenSettings;->mAospLock:Landroid/preference/CheckBoxPreference;
invoke-virtual {p0}, Lcom/android/settings/LockScreenSettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v4
const-string v8, "enable_aosp_lock"
invoke-static {v4, v8, v6}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v4
if-eqz v4, :cond_7
move v4, v5
invoke-virtual {v7, v4}, Landroid/preference/CheckBoxPreference;->setChecked(Z)V
.line 265
invoke-virtual {p0}, Lcom/android/settings/LockScreenSettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v4
[/COLOR]
iget-object v7, p0, Lcom/android/settings/LockScreenSettings;->mClock:Landroid/preference/CheckBoxPreference;
invoke-virtual {p0}, Lcom/android/settings/LockScreenSettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v4
const-string v8, "show_clock"
Find the following code and add the parts in RED
Code:
iget-object v9, p0, Lcom/android/settings/LockScreenSettings;->mClock:Landroid/preference/CheckBoxPreference;
const/4 v10, 0x0
invoke-virtual {v9, v10}, Landroid/preference/CheckBoxPreference;->setPersistent(Z)V
[COLOR="red"]const-string v9, "enable_aosp_lock"
invoke-virtual {p0, v9}, Lcom/android/settings/LockScreenSettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v9
check-cast v9, Landroid/preference/CheckBoxPreference;
iput-object v9, p0, Lcom/android/settings/LockScreenSettings;->mAospLock:Landroid/preference/CheckBoxPreference;
.line 159
iget-object v9, p0, Lcom/android/settings/LockScreenSettings;->mAospLock:Landroid/preference/CheckBoxPreference;
const/4 v10, 0x0
invoke-virtual {v9, v10}, Landroid/preference/CheckBoxPreference;->setPersistent(Z)V
[/COLOR]
.line 161
const-string v9, "weather"
invoke-virtual {p0, v9}, Lcom/android/settings/LockScreenSettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v9
Find the following code and add the parts in RED
Code:
:cond_9
iget-object v4, p0, Lcom/android/settings/LockScreenSettings;->mSayCommand:Landroid/preference/CheckBoxPreference;
invoke-virtual {p2, v4}, Ljava/lang/Object;->equals(Ljava/lang/Object;)Z
move-result v4
if-eqz v4, [COLOR="red"]:cond_b
[/COLOR]
.line 338
invoke-virtual {p0}, Lcom/android/settings/LockScreenSettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v4
const-string v5, "wake_up_lock_screen"
iget-object v6, p0, Lcom/android/settings/LockScreenSettings;->mSayCommand:Landroid/preference/CheckBoxPreference;
invoke-virtual {v6}, Landroid/preference/CheckBoxPreference;->isChecked()Z
move-result v6
if-eqz v6, :cond_a
Find the following code and add the parts in RED
Code:
invoke-static {v4, v5, v2}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z
goto/16 :goto_1
:cond_a
move v2, v3
goto :goto_5
[COLOR="red"]:cond_b
iget-object v4, p0, Lcom/android/settings/LockScreenSettings;->mAospLock:Landroid/preference/CheckBoxPreference;
invoke-virtual {p2, v4}, Ljava/lang/Object;->equals(Ljava/lang/Object;)Z
move-result v4
if-eqz v4, :cond_0
.line 313
invoke-virtual {p0}, Lcom/android/settings/LockScreenSettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v4
const-string v5, "enable_aosp_lock"
iget-object v6, p0, Lcom/android/settings/LockScreenSettings;->mAospLock:Landroid/preference/CheckBoxPreference;
invoke-virtual {v6}, Landroid/preference/CheckBoxPreference;->isChecked()Z
move-result v6
if-eqz v6, :cond_c
:goto_6
invoke-static {v4, v5, v2}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z
.line 314
invoke-direct {p0}, Lcom/android/settings/LockScreenSettings;->updateState()V
.line 340
invoke-super {p0, p1, p2}, Lcom/android/settings/SettingsPreferenceFragment;->onPreferenceTreeClick(Landroid/preference/PreferenceScreen;Landroid/preference/Preference;)Z
move-result v2
return v2
:cond_c
move v2, v3
.line 313
goto :goto_6
[/COLOR]
.line 337
.end method
.method public onResume()V
.locals 0
.prologue
.line 257
invoke-super {p0}, Lcom/android/settings/SettingsPreferenceFragment;->onResume()V
.line 258
invoke-direct {p0}, Lcom/android/settings/LockScreenSettings;->updateState()V
Thats it! Recompile and push to /system/app
You will find your new toggle in lockscreen options.
Enjoy!
FLASHABLE ZIP FOR BLK1 Deodexed ROMs NANDROID FIRST!!!!!
Thanks Button!
[MOD] [GUIDE] AOSP Lockscreen shortcuts
AOSP Lockscreen shortcuts
ORIGINAL THREAD
[Q] What will this MOD do?
[A] If you have implemented my AOSP lockscreen toggle MOD, this will add two more shortcuts to the lockscreen. SMS and Phone.
Using this guide you can also extrapolate the means necassary to add other shortcuts as well. All you would need are the pngs and xml files to do so.
I am including in this guide a zip file that will have the needed pngs and xmls for the SMS and Phone shortcuts. The xmls are simple and easily modified if you choose to get creative and try some new shortcuts.
This will work for stock phone and SMS apps. If you are using handscent or someother sms client it will still shortcut you to the stock sms client not handscent.
Lets get on with it......
We will be working with several files to get the job done here.
framework-res.apk
framework2.jar
android.policy.jar
We will begin with framework-res
Before we get going if you have implemented the AOSP lock already, you may have noticed that the carrier info is still on the screens in both portrait and landscape modes. Let get rid of them first. If you dont care about them....move on to the next step.
Navigate to res/values/layout/keyguard_screen_tab_unlock.xml
Locate the following code and ADD the parts in RED
Code:
<TextView android:textAppearance="?textAppearanceMedium" android:textSize="@dimen/keyguard_lockscreen_status_line_font_size" android:textColor="?textColorSecondary" android:ellipsize="marquee" android:gravity="center_horizontal" android:id="@id/carrier" [COLOR="red"]android:visibility="gone"[/COLOR] android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginBottom="12.0dip" android:singleLine="true" android:layout_alignParentBottom="true" />
<TextView android:textAppearance="?textAppearanceMedium" android:ellipsize="marquee" android:id="@id/statement" [COLOR="red"]android:visibility="gone"[/COLOR] android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="12.0dip" android:singleLine="true" android:drawablePadding="4.0dip" android:layout_below="@id/carrier" android:layout_centerHorizontal="true" android:marqueeRepeatLimit="marquee_forever" />
Navigate to res/values/layout/keyguard_screen_tab_unlock_land.xml
Locate the following code and ADD the parts in RED
Code:
<TextView android:textAppearance="?textAppearanceMedium" android:textSize="@dimen/keyguard_lockscreen_status_line_font_size" android:textColor="?textColorSecondary" android:ellipsize="marquee" android:gravity="right" android:layout_gravity="fill_horizontal" android:id="@id/carrier" [COLOR="Red"]android:visibility="gone"[/COLOR] android:layout_width="0.0dip" android:layout_marginBottom="12.0dip" android:singleLine="true" />
<TextView android:textAppearance="?textAppearanceMedium" android:ellipsize="marquee" android:id="@id/statement" [COLOR="red"]android:visibility="gone"[/COLOR] android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="24.0dip" android:layout_marginTop="12.0dip" android:singleLine="true" android:drawablePadding="4.0dip" android:layout_below="@id/carrier" android:marqueeRepeatLimit="marquee_forever" />
Okay, thats it for the carrier stuff. Lets add some shortcuts.
Code:
[B]Using the supplied zip file put the following files in the following locations[/B].
ic_lockscreen_phone_activated.png
ic_lockscreen_phone_normal.png
ic_lockscreen_sms_activated.png
ic_lockscreen_sms_normal.png
....all go in /res/drawable-hdpi
[B]Using the supplied zip file put the following files in the following locations.[/B]
ic_lockscreen_phone.xml
ic_lockscreen_sms.xml
......all go in /res/drawable
Navigate to res/values/arrays
Find the following line
Code:
<array name="lockscreen_targets_with_camera">
Make the entire array look like this
Code:
<array name="lockscreen_targets_with_camera">
<item>@drawable/ic_lockscreen_unlock</item>
<item>@drawable/ic_lockscreen_sms</item>
<item>@drawable/ic_action_assist_generic</item>
<item>@drawable/ic_lockscreen_phone</item>
<item>@drawable/ic_lockscreen_camera</item>
<item>@null</item>
<item>@null</item>
<item>@null</item>
</array>
Find the following line
Code:
<array name="lockscreen_target_descriptions_with_camera">
Make the entire array look like this
Code:
<array name="lockscreen_target_descriptions_with_camera">
<item>@string/description_target_unlock</item>
<item>@string/description_target_sms</item>
<item>@string/description_target_search</item>
<item>@string/description_target_phone</item>
<item>@string/description_target_camera</item>
<item>@null</item>
<item>@null</item>
<item>@null</item>
</array>
Navigate to res/values-land/arrays.xml
Find the following line
Code:
<array name="lockscreen_targets_with_camera">
Make the entire array look like this
Code:
<array name="lockscreen_targets_with_camera">
<item>@null</item>
<item>@null</item>
<item>@drawable/ic_lockscreen_unlock</item>
<item>@drawable/ic_lockscreen_sms</item>
<item>@drawable/ic_action_assist_generic</item>
<item>@drawable/ic_lockscreen_phone</item>
<item>@drawable/ic_lockscreen_camera</item>
<item>@null</item>
</array>
Find the following line
Code:
<array name="lockscreen_target_descriptions_with_camera">
Make the entire array look like this
Code:
<array name="lockscreen_target_descriptions_with_camera">
<item>@null</item>
<item>@null</item>
<item>@string/description_target_unlock</item>
<item>@string/description_target_sms</item>
<item>@string/description_target_search</item>
<item>@string/description_target_phone</item>
<item>@string/description_target_camera</item>
<item>@null</item>
</array>
Navigate to res/values/strings and add the following to the file
Code:
<string name="description_target_sms">Sms</string>
<string name="description_target_phone">Phone</string>
A this point you need to recompile framework-res and then decompile it. We do this because we are allowing system to generate public IDs for the info we just added. So recompile framework-res and delete the old apk. Decompile the new apk and continue.....
Navigate to res/values/public
Find the following lines and write down thier IDs in the order you see them below and set aside for a step later in the tutorial. Make sure you have the correct ID, some will have more than one instance but only one will look EXACTLY like whats below.
Code:
ic_action_assist_generic
ic_lockscreen_camera
ic_lockscreen_silent
ic_lockscreen_unlock
ic_lockscreen_unlock_phantom
ic_lockscreen_phone
ic_lockscreen_sms
[/hide/
Recompile framework-res and move to the next step
Decompile framework2.jar
Navigate to com/android/internal/widget/multiwaveview/GlowPadView.smali
Locate the following method
Code:
.method private getDirectionDescription(I)Ljava/lang/String;
Replace the entire method with the following code
Code:
.method private getDirectionDescription(I)Ljava/lang/String;
.locals 4
.parameter "index"
.prologue
.line 1119
iget-object v2, p0, Lcom/android/internal/widget/multiwaveview/GlowPadView;->mDirectionDescriptions:Ljava/util/ArrayList;
if-eqz v2, :cond_0
iget-object v2, p0, Lcom/android/internal/widget/multiwaveview/GlowPadView;->mDirectionDescriptions:Ljava/util/ArrayList;
invoke-virtual {v2}, Ljava/util/ArrayList;->isEmpty()Z
move-result v2
if-eqz v2, :cond_1
.line 1120
:cond_0
iget v2, p0, Lcom/android/internal/widget/multiwaveview/GlowPadView;->mDirectionDescriptionsResourceId:I
invoke-direct {p0, v2}, Lcom/android/internal/widget/multiwaveview/GlowPadView;->loadDescriptions(I)Ljava/util/ArrayList;
move-result-object v2
iput-object v2, p0, Lcom/android/internal/widget/multiwaveview/GlowPadView;->mDirectionDescriptions:Ljava/util/ArrayList;
.line 1121
iget-object v2, p0, Lcom/android/internal/widget/multiwaveview/GlowPadView;->mTargetDrawables:Ljava/util/ArrayList;
invoke-virtual {v2}, Ljava/util/ArrayList;->size()I
move-result v2
iget-object v3, p0, Lcom/android/internal/widget/multiwaveview/GlowPadView;->mDirectionDescriptions:Ljava/util/ArrayList;
invoke-virtual {v3}, Ljava/util/ArrayList;->size()I
move-result v3
if-eq v2, v3, :cond_1
.line 1122
const-string v2, "GlowPadView"
const-string v3, "The number of target drawables must be equal to the number of direction descriptions."
invoke-static {v2, v3}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I
.line 1124
const/4 v0, 0x0
.line 1133
:goto_0
return-object v0
.line 1130
:cond_1
:try_start_0
iget-object v2, p0, Lcom/android/internal/widget/multiwaveview/GlowPadView;->mDirectionDescriptions:Ljava/util/ArrayList;
invoke-virtual {v2, p1}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;
move-result-object v0
check-cast v0, Ljava/lang/String;
:try_end_0
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
.line 1131
.local v0, directionZ:Ljava/lang/String;
goto :goto_0
.line 1132
.end local v0 #directionZ:Ljava/lang/String;
:catch_0
move-exception v1
.line 1133
.local v1, e:Ljava/lang/Exception;
const-string v0, ""
goto :goto_0
.end method
Find the following method
Code:
.method private getTargetDescription(I)Ljava/lang/String;
Replace the entire method with the following code
Code:
.method private getTargetDescription(I)Ljava/lang/String;
.locals 4
.parameter "index"
.prologue
.line 1099
iget-object v2, p0, Lcom/android/internal/widget/multiwaveview/GlowPadView;->mTargetDescriptions:Ljava/util/ArrayList;
if-eqz v2, :cond_0
iget-object v2, p0, Lcom/android/internal/widget/multiwaveview/GlowPadView;->mTargetDescriptions:Ljava/util/ArrayList;
invoke-virtual {v2}, Ljava/util/ArrayList;->isEmpty()Z
move-result v2
if-eqz v2, :cond_1
.line 1100
:cond_0
iget v2, p0, Lcom/android/internal/widget/multiwaveview/GlowPadView;->mTargetDescriptionsResourceId:I
invoke-direct {p0, v2}, Lcom/android/internal/widget/multiwaveview/GlowPadView;->loadDescriptions(I)Ljava/util/ArrayList;
move-result-object v2
iput-object v2, p0, Lcom/android/internal/widget/multiwaveview/GlowPadView;->mTargetDescriptions:Ljava/util/ArrayList;
.line 1101
iget-object v2, p0, Lcom/android/internal/widget/multiwaveview/GlowPadView;->mTargetDrawables:Ljava/util/ArrayList;
invoke-virtual {v2}, Ljava/util/ArrayList;->size()I
move-result v2
iget-object v3, p0, Lcom/android/internal/widget/multiwaveview/GlowPadView;->mTargetDescriptions:Ljava/util/ArrayList;
invoke-virtual {v3}, Ljava/util/ArrayList;->size()I
move-result v3
if-eq v2, v3, :cond_1
.line 1102
const-string v2, "GlowPadView"
const-string v3, "The number of target drawables must be equal to the number of target descriptions."
invoke-static {v2, v3}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I
.line 1104
const/4 v1, 0x0
.line 1114
:goto_0
return-object v1
.line 1109
:cond_1
const-string v1, ""
.line 1111
.local v1, targetZ:Ljava/lang/String;
:try_start_0
iget-object v2, p0, Lcom/android/internal/widget/multiwaveview/GlowPadView;->mTargetDescriptions:Ljava/util/ArrayList;
invoke-virtual {v2, p1}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;
move-result-object v2
move-object v0, v2
check-cast v0, Ljava/lang/String;
move-object v1, v0
:try_end_0
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
goto :goto_0
.line 1112
:catch_0
move-exception v2
goto :goto_0
.end method
Thats it for framework2. Recopile framework2.
Decompile android.policy.jar
Navigate to com/android/internal/policy/impl/LockScreen.smali and find the following method
Code:
.method static synthetic access$1300(Lcom/android/internal/policy/impl/LockScreen;)Landroid/content/Context;
Add the following methods right after the END of the above method
Code:
.method static synthetic access$1400(Lcom/android/internal/policy/impl/LockScreen;)Landroid/content/Context;
.locals 1
.parameter "x0"
.prologue
.line 56
iget-object v0, p0, Lcom/android/internal/policy/impl/LockScreen;->mContext:Landroid/content/Context;
return-object v0
.end method
.method static synthetic access$1500(Lcom/android/internal/policy/impl/LockScreen;)Landroid/content/Context;
.locals 1
.parameter "x0"
.prologue
.line 56
iget-object v0, p0, Lcom/android/internal/policy/impl/LockScreen;->mContext:Landroid/content/Context;
return-object v0
.end method
Navigate to com/android/internal/policy/impl/LockScreen$GlowPadViewMethods.smali.
Find the following method
Code:
.method public onTrigger(Landroid/view/View;I)V
Replace the entire method with the following code
Code:
.method public onTrigger(Landroid/view/View;I)V
.locals 7
.parameter "v"
.parameter "target"
.prologue
const/high16 v6, 0x1000
.line 313
iget-object v4, p0, Lcom/android/internal/policy/impl/LockScreen$GlowPadViewMethods;->mGlowPadView:Lcom/android/internal/widget/multiwaveview/GlowPadView;
invoke-virtual {v4, p2}, Lcom/android/internal/widget/multiwaveview/GlowPadView;->getResourceIdForTarget(I)I
move-result v3
.line 321
.local v3, resId:I
sparse-switch v3, :sswitch_data_0
.line 367
:goto_0
return-void
.line 323
:sswitch_0
iget-object v4, p0, Lcom/android/internal/policy/impl/LockScreen$GlowPadViewMethods;->this$0:Lcom/android/internal/policy/impl/LockScreen;
invoke-static {v4}, Lcom/android/internal/policy/impl/LockScreen;->access$1200(Lcom/android/internal/policy/impl/LockScreen;)Landroid/content/Context;
move-result-object v4
invoke-static {v4}, Landroid/app/SearchManager;->getAssistIntent(Landroid/content/Context;)Landroid/content/Intent;
move-result-object v0
.line 324
.local v0, assistIntent:Landroid/content/Intent;
if-eqz v0, :cond_0
.line 325
invoke-direct {p0, v0}, Lcom/android/internal/policy/impl/LockScreen$GlowPadViewMethods;->launchActivity(Landroid/content/Intent;)V
.line 329
:goto_1
iget-object v4, p0, Lcom/android/internal/policy/impl/LockScreen$GlowPadViewMethods;->this$0:Lcom/android/internal/policy/impl/LockScreen;
invoke-static {v4}, Lcom/android/internal/policy/impl/LockScreen;->access$400(Lcom/android/internal/policy/impl/LockScreen;)Lcom/android/internal/policy/impl/KeyguardScreenCallback;
move-result-object v4
invoke-interface {v4}, Lcom/android/internal/policy/impl/KeyguardScreenCallback;->pokeWakelock()V
goto :goto_0
.line 327
:cond_0
const-string v4, "LockScreen"
const-string v5, "Failed to get intent for assist activity"
invoke-static {v4, v5}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I
goto :goto_1
.line 333
.end local v0 #assistIntent:Landroid/content/Intent;
:sswitch_1
new-instance v4, Landroid/content/Intent;
const-string v5, "android.media.action.STILL_IMAGE_CAMERA"
invoke-direct {v4, v5}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V
invoke-direct {p0, v4}, Lcom/android/internal/policy/impl/LockScreen$GlowPadViewMethods;->launchActivity(Landroid/content/Intent;)V
.line 334
iget-object v4, p0, Lcom/android/internal/policy/impl/LockScreen$GlowPadViewMethods;->this$0:Lcom/android/internal/policy/impl/LockScreen;
invoke-static {v4}, Lcom/android/internal/policy/impl/LockScreen;->access$400(Lcom/android/internal/policy/impl/LockScreen;)Lcom/android/internal/policy/impl/KeyguardScreenCallback;
move-result-object v4
invoke-interface {v4}, Lcom/android/internal/policy/impl/KeyguardScreenCallback;->pokeWakelock()V
goto :goto_0
.line 339
:sswitch_2
new-instance v2, Landroid/content/Intent;
const-string v4, "android.intent.action.MAIN"
invoke-direct {v2, v4}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V
.line 340
.local v2, phoneIntent:Landroid/content/Intent;
const-string v4, "com.android.contacts"
const-string v5, "com.android.contacts.activities.DialtactsActivity"
invoke-virtual {v2, v4, v5}, Landroid/content/Intent;->setClassName(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;
.line 341
invoke-virtual {v2, v6}, Landroid/content/Intent;->setFlags(I)Landroid/content/Intent;
.line 342
iget-object v4, p0, Lcom/android/internal/policy/impl/LockScreen$GlowPadViewMethods;->this$0:Lcom/android/internal/policy/impl/LockScreen;
invoke-static {v4}, Lcom/android/internal/policy/impl/LockScreen;->access$1300(Lcom/android/internal/policy/impl/LockScreen;)Landroid/content/Context;
move-result-object v4
invoke-virtual {v4, v2}, Landroid/content/Context;->startActivity(Landroid/content/Intent;)V
.line 343
iget-object v4, p0, Lcom/android/internal/policy/impl/LockScreen$GlowPadViewMethods;->this$0:Lcom/android/internal/policy/impl/LockScreen;
invoke-static {v4}, Lcom/android/internal/policy/impl/LockScreen;->access$400(Lcom/android/internal/policy/impl/LockScreen;)Lcom/android/internal/policy/impl/KeyguardScreenCallback;
move-result-object v4
invoke-interface {v4}, Lcom/android/internal/policy/impl/KeyguardScreenCallback;->goToUnlockScreen()V
goto :goto_0
.line 348
.end local v2 #phoneIntent:Landroid/content/Intent;
:sswitch_3
new-instance v1, Landroid/content/Intent;
const-string v4, "android.intent.action.MAIN"
invoke-direct {v1, v4}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V
.line 349
.local v1, mmsIntent:Landroid/content/Intent;
const-string v4, "com.android.mms"
const-string v5, "com.android.mms.ui.ConversationList"
invoke-virtual {v1, v4, v5}, Landroid/content/Intent;->setClassName(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;
.line 350
invoke-virtual {v1, v6}, Landroid/content/Intent;->setFlags(I)Landroid/content/Intent;
.line 351
iget-object v4, p0, Lcom/android/internal/policy/impl/LockScreen$GlowPadViewMethods;->this$0:Lcom/android/internal/policy/impl/LockScreen;
invoke-static {v4}, Lcom/android/internal/policy/impl/LockScreen;->access$1400(Lcom/android/internal/policy/impl/LockScreen;)Landroid/content/Context;
move-result-object v4
invoke-virtual {v4, v1}, Landroid/content/Context;->startActivity(Landroid/content/Intent;)V
.line 352
iget-object v4, p0, Lcom/android/internal/policy/impl/LockScreen$GlowPadViewMethods;->this$0:Lcom/android/internal/policy/impl/LockScreen;
invoke-static {v4}, Lcom/android/internal/policy/impl/LockScreen;->access$400(Lcom/android/internal/policy/impl/LockScreen;)Lcom/android/internal/policy/impl/KeyguardScreenCallback;
move-result-object v4
invoke-interface {v4}, Lcom/android/internal/policy/impl/KeyguardScreenCallback;->goToUnlockScreen()V
goto :goto_0
.line 357
.end local v1 #mmsIntent:Landroid/content/Intent;
:sswitch_4
iget-object v4, p0, Lcom/android/internal/policy/impl/LockScreen$GlowPadViewMethods;->this$0:Lcom/android/internal/policy/impl/LockScreen;
invoke-static {v4}, Lcom/android/internal/policy/impl/LockScreen;->access$500(Lcom/android/internal/policy/impl/LockScreen;)V
.line 358
iget-object v4, p0, Lcom/android/internal/policy/impl/LockScreen$GlowPadViewMethods;->this$0:Lcom/android/internal/policy/impl/LockScreen;
invoke-static {v4}, Lcom/android/internal/policy/impl/LockScreen;->access$400(Lcom/android/internal/policy/impl/LockScreen;)Lcom/android/internal/policy/impl/KeyguardScreenCallback;
move-result-object v4
invoke-interface {v4}, Lcom/android/internal/policy/impl/KeyguardScreenCallback;->pokeWakelock()V
goto/16 :goto_0
.line 364
:sswitch_5
iget-object v4, p0, Lcom/android/internal/policy/impl/LockScreen$GlowPadViewMethods;->this$0:Lcom/android/internal/policy/impl/LockScreen;
invoke-static {v4}, Lcom/android/internal/policy/impl/LockScreen;->access$400(Lcom/android/internal/policy/impl/LockScreen;)Lcom/android/internal/policy/impl/KeyguardScreenCallback;
move-result-object v4
invoke-interface {v4}, Lcom/android/internal/policy/impl/KeyguardScreenCallback;->goToUnlockScreen()V
goto/16 :goto_0
.line 321
:sswitch_data_0
.sparse-switch
0x1080294 -> :sswitch_0
0x10802dd -> :sswitch_1
0x10802f6 -> :sswitch_4
0x10802fe -> :sswitch_5
0x1080301 -> :sswitch_5
0x1080604 -> :sswitch_2
0x1080607 -> :sswitch_3
.end sparse-switch
.end method
Now, we need to go back to the IDs you wrote down from framework-res. See the last part of the code you just added with the switches? There are 7 generic IDs associated with those switches. You need to add the IDs you wrote down to the switches in the order you wrote them down. For example, when I was done my switches looked like this
Code:
0x010802ca -> :sswitch_0
0x01080325 -> :sswitch_1
0x01080341 -> :sswitch_4
0x0108034c -> :sswitch_5
0x0108034f -> :sswitch_5
0x01080a0f -> :sswitch_2
0x01080a12 -> :sswitch_3
Yours may be slightly different. Just make sure you use the right order in which you wrote them down.
Recompile android.policy.jar
Push all files to /system/framework
Done!
Hit that thanks button if this was useful!
Remove Ongoing WiFi Notification
Original Thread
This is a quick way to remove the aggrivating Ongoing WiFi notification in the drop down menu. There may be other ways to do it via smali or xml but I have not found them yet so this will work for now.
I am including a flashable ZIP as well but it "may" cause issues if your on a custom ROM.
The Guide....
Decompile framework-res.apk
First verify these lines are not already there, if not, add the following code to res/values/drawables
Code:
<item type="drawable" name="stat_sys_wifi_connected">false</item>
<item type="drawable" name="stat_sys_wifi_disabled">false</item>
<item type="drawable" name="stat_sys_wifi_dummy">false</item>
<item type="drawable" name="stat_sys_wifi_no_network">false</item>
<item type="drawable" name="stat_sys_wifi_not_connected">false</item>
Remove the following .pngs from res/drawables-hdpi and drawables-xhdpi
Code:
stat_sys_wifi_connected.png
stat_sys_wifi_disabled.png
stat_sys_wifi_dummy.png
stat_sys_wifi_no_network.png
stat_sys_wifi_not_connected.png
Recompile and push to /system/framework
This is meant for a stock deodexed BLK3 Rom. Nandroid First!
Ongoing Removal Zip Download
Time and AM/PM Statusbar Clock Mods V2.0
Original thread here
I have been working on this MOD for a long time now and can finally say finally I got it working 100%!
What Does this MOD do?
- This is a much improved version of the older time and am/pm mod that allowed you to remove time and/or am/pm from the statusbar. This new version introduces a list preference UI with several new options the older MOD did not have. See attached Pictures.
This new MOD will allow you to:
Code:
[B][COLOR="DarkRed"][CENTER]Remove time
Center the clock in statusbar
move the clock to stock location
remove clock from statusbar
remove am/pm
change am/pm to small size
change am/pm to large size
add abbreviated day of week to status bar small size
add abbreviated day of week to status bar large size
remove abbreviated day of week from the status bar[/CENTER]
[/COLOR][/B]
All these changes will work on the fly with no reboot necessary.
There are a few new smali files that had to be created and exstensive changes to some existing smali files. Due to the large amount of changes needed this guide will only cover the changes that are semi-easy to show/explain. For the new files and the files with large amounts of changes I will be uploading a zip with the entire smali file and notes on where they need to be placed.
I used a lot of examples from the CM team to code this MOD and it would have been very difficult without those examples so big props go to them !!
There is a lot to do here so lets get started....
We will be working with several system files. They include:
SystemUI
SecSettings
framework-res
Lets begin with SecSettings.
Decompile SecSettings and navigate to res/values/arrays
Add the following at the end of the file
Code:
<string-array name="clock_ampm_entries">
<item>"Don't show"</item>
<item>Small AM/PM</item>
<item>Regular AM/PM</item>
</string-array>
<string-array name="clock_ampm_values">
<item>2</item>
<item>1</item>
<item>0</item>
</string-array>
<string-array name="clock_weekday_entries">
<item>"Don't show"</item>
<item>Small weekday</item>
<item>Regular weekday</item>
</string-array>
<string-array name="clock_weekday_values">
<item>0</item>
<item>1</item>
<item>2</item>
</string-array>
Navigate to res/values/strings and add the following
Code:
<string name="enable_clock_weekday">Day of the week</string>
<string name="enable_clock_weekday_summary">Abbreviated day of the week in statusbar</string>
<string name="clock_cat">Clock options</string>
<string name="clock_title_enable">Clock style</string>
<string name="title_clock_ampm_entries">AM/PM style</string>
Navigate to res/xml/date_time_prefs.xml and replace all code with the following
Code:
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen android:title="@string/date_and_time"
xmlns:android="http://schemas.android.com/apk/res/android">
<CheckBoxPreference android:title="@string/date_time_auto" android:key="auto_time" android:summaryOn="@string/date_time_auto_summaryOn" android:summaryOff="@string/date_time_auto_summaryOff" />
<Preference android:title="@string/date_time_set_date" android:key="date" android:summary="03/10/2008" android:widgetLayout="@layout/round_more_icon" />
<Preference android:title="@string/date_time_set_time" android:key="time" android:summary="12:00am" android:widgetLayout="@layout/round_more_icon" />
<PreferenceCategory android:title="@string/clock_cat" android:key="clock_category">
<ListPreference android:entries="@array/clock_style_entries" android:title="@string/clock_title_enable" android:key="clock_style" android:entryValues="@array/clock_style_values" />
<ListPreference android:entries="@array/clock_ampm_entries" android:title="@string/title_clock_ampm_entries" android:key="clock_am_pm_style" android:entryValues="@array/clock_ampm_values" />
<ListPreference android:entries="@array/clock_weekday_entries" android:title="@string/enable_clock_weekday" android:key="clock_weekday" android:summary="@string/enable_clock_weekday_summary" android:entryValues="@array/clock_weekday_values" />
</PreferenceCategory>
<CheckBoxPreference android:title="@string/zone_auto" android:key="auto_zone" android:summaryOn="@string/zone_auto_summaryOn" android:summaryOff="@string/zone_auto_summaryOff" />
<PreferenceScreen android:title="@string/date_time_set_timezone" android:key="timezone" android:summary="GMT-8:00" android:fragment="com.android.settings.ZonePicker" />
<CheckBoxPreference android:title="@string/date_time_24hour" android:key="24 hour" android:summaryOn="@string/date_time_24_hour_sample" android:summaryOff="@string/date_time_12_hour_sample" />
<ListPreference android:title="@string/date_time_date_format" android:key="date_format" android:summary="mm/dd/yyyy" android:widgetLayout="@layout/round_more_icon" />
</PreferenceScreen>
Navigate to smali/com/android/settings/DateTimeSettings.smali and find the following method
Code:
.method public onCreate(Landroid/os/Bundle;)V
Replace that entire method with the following code
Code:
.method public onCreate(Landroid/os/Bundle;)V
.locals 4
.parameter "savedInstanceState"
.prologue
.line 132
invoke-super {p0, p1}, Lcom/android/settings/SettingsPreferenceFragment;->onCreate(Landroid/os/Bundle;)V
invoke-virtual {p0}, Lcom/android/settings/DateTimeSettings;->getActivity()Landroid/app/Activity;
move-result-object v0
invoke-virtual {v0}, Landroid/app/Activity;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v3
.line 134
const v0, 0x7f07001c
invoke-virtual {p0, v0}, Lcom/android/settings/DateTimeSettings;->addPreferencesFromResource(I)V
const-string v0, "clock_style"
invoke-virtual {p0, v0}, Lcom/android/settings/DateTimeSettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v0
check-cast v0, Landroid/preference/ListPreference;
iput-object v0, p0, Lcom/android/settings/DateTimeSettings;->mClockStyle:Landroid/preference/ListPreference;
const-string v0, "clock_style"
const/4 v1, 0x0
invoke-static {v3, v0, v1}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v0
iget-object v2, p0, Lcom/android/settings/DateTimeSettings;->mClockStyle:Landroid/preference/ListPreference;
invoke-static {v0}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;
move-result-object v1
invoke-virtual {v2, v1}, Landroid/preference/ListPreference;->setValue(Ljava/lang/String;)V
iget-object v2, p0, Lcom/android/settings/DateTimeSettings;->mClockStyle:Landroid/preference/ListPreference;
invoke-virtual {v2, p0}, Landroid/preference/SwitchPreferenceScreen;->setOnPreferenceChangeListener(Landroid/preference/Preference$OnPreferenceChangeListener;)V
const-string v0, "clock_am_pm_style"
invoke-virtual {p0, v0}, Lcom/android/settings/DateTimeSettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v0
check-cast v0, Landroid/preference/ListPreference;
iput-object v0, p0, Lcom/android/settings/DateTimeSettings;->mClockAmPmstyle:Landroid/preference/ListPreference;
const-string v0, "clock_am_pm_style"
const/4 v1, 0x0
invoke-static {v3, v0, v1}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v0
iget-object v2, p0, Lcom/android/settings/DateTimeSettings;->mClockAmPmstyle:Landroid/preference/ListPreference;
invoke-static {v0}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;
move-result-object v1
invoke-virtual {v2, v1}, Landroid/preference/ListPreference;->setValue(Ljava/lang/String;)V
iget-object v2, p0, Lcom/android/settings/DateTimeSettings;->mClockAmPmstyle:Landroid/preference/ListPreference;
invoke-virtual {v2, p0}, Landroid/preference/SwitchPreferenceScreen;->setOnPreferenceChangeListener(Landroid/preference/Preference$OnPreferenceChangeListener;)V
const-string v0, "clock_weekday"
invoke-virtual {p0, v0}, Lcom/android/settings/DateTimeSettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v0
check-cast v0, Landroid/preference/ListPreference;
iput-object v0, p0, Lcom/android/settings/DateTimeSettings;->mClockWeekday:Landroid/preference/ListPreference;
const-string v0, "clock_weekday"
const/4 v1, 0x0
invoke-static {v3, v0, v1}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v0
iget-object v2, p0, Lcom/android/settings/DateTimeSettings;->mClockWeekday:Landroid/preference/ListPreference;
invoke-static {v0}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;
move-result-object v1
invoke-virtual {v2, v1}, Landroid/preference/ListPreference;->setValue(Ljava/lang/String;)V
iget-object v2, p0, Lcom/android/settings/DateTimeSettings;->mClockWeekday:Landroid/preference/ListPreference;
invoke-virtual {v2, p0}, Landroid/preference/SwitchPreferenceScreen;->setOnPreferenceChangeListener(Landroid/preference/Preference$OnPreferenceChangeListener;)V
.line 135
invoke-virtual {p0}, Lcom/android/settings/DateTimeSettings;->getResources()Landroid/content/res/Resources;
move-result-object v0
sput-object v0, Lcom/android/settings/DateTimeSettings;->resources:Landroid/content/res/Resources;
.line 136
invoke-direct {p0}, Lcom/android/settings/DateTimeSettings;->initUI()V
.line 139
new-instance v0, Lcom/android/settings/DateTimeSettings$SettingsObserver;
new-instance v1, Landroid/os/Handler;
invoke-direct {v1}, Landroid/os/Handler;-><init>()V
invoke-direct {v0, p0, v1}, Lcom/android/settings/DateTimeSettings$SettingsObserver;-><init>(Lcom/android/settings/DateTimeSettings;Landroid/os/Handler;)V
iput-object v0, p0, Lcom/android/settings/DateTimeSettings;->mSettingsObserver:Lcom/android/settings/DateTimeSettings$SettingsObserver;
.line 141
return-void
.end method
You will now create the following new method by pasting the following code right after the "oncreate" method you just pasted
Code:
.method public onPreferenceChange(Landroid/preference/Preference;Ljava/lang/Object;)Z
.locals 3
.parameter "preference"
.parameter "objValue"
iget-object v0, p0, Lcom/android/settings/DateTimeSettings;->mClockStyle:Landroid/preference/ListPreference;
if-ne p1, v0, :cond_0
check-cast p2, Ljava/lang/String;
invoke-static {p2}, Ljava/lang/Integer;->valueOf(Ljava/lang/String;)Ljava/lang/Integer;
move-result-object v0
invoke-virtual {v0}, Ljava/lang/Integer;->intValue()I
move-result v1
invoke-virtual {p0}, Lcom/android/settings/DateTimeSettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v0
const-string v2, "clock_style"
invoke-static {v0, v2, v1}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z
:cond_0
iget-object v0, p0, Lcom/android/settings/DateTimeSettings;->mClockAmPmstyle:Landroid/preference/ListPreference;
if-ne p1, v0, :cond_1
check-cast p2, Ljava/lang/String;
invoke-static {p2}, Ljava/lang/Integer;->valueOf(Ljava/lang/String;)Ljava/lang/Integer;
move-result-object v0
invoke-virtual {v0}, Ljava/lang/Integer;->intValue()I
move-result v1
invoke-virtual {p0}, Lcom/android/settings/DateTimeSettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v0
const-string v2, "clock_am_pm_style"
invoke-static {v0, v2, v1}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z
:cond_1
iget-object v0, p0, Lcom/android/settings/DateTimeSettings;->mClockWeekday:Landroid/preference/ListPreference;
if-ne p1, v0, :cond_2
check-cast p2, Ljava/lang/String;
invoke-static {p2}, Ljava/lang/Integer;->valueOf(Ljava/lang/String;)Ljava/lang/Integer;
move-result-object v0
invoke-virtual {v0}, Ljava/lang/Integer;->intValue()I
move-result v1
invoke-virtual {p0}, Lcom/android/settings/DateTimeSettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v0
const-string v2, "clock_weekday"
invoke-static {v0, v2, v1}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z
:cond_2
const/4 v0, 0x1
return v0
.end method
Thats it for SecSettings, recompile and set it aside.
Decompile SystemUI and navigate to res/values/layout/tw_status_bar.xml
Replace the entire file with the following code
Code:
<?xml version="1.0" encoding="utf-8"?>
<com.android.systemui.statusbar.phone.PhoneStatusBarView android:orientation="vertical" android:id="@id/status_bar" android:background="@drawable/status_bar_background" android:focusable="true" android:fitsSystemWindows="true" android:descendantFocusability="afterDescendants"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui">
<LinearLayout android:gravity="center" android:orientation="horizontal" android:id="@id/center_clock_layout" android:layout_width="fill_parent" android:layout_height="fill_parent">
<com.android.systemui.statusbar.policy.ClockCenter android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:gravity="center" android:id="@id/center_clock" android:paddingLeft="6.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" />
</LinearLayout>
<ImageView android:id="@id/notification_lights_out" android:paddingLeft="6.0dip" android:paddingBottom="2.0dip" android:visibility="gone" android:layout_width="@dimen/status_bar_icon_size" android:layout_height="fill_parent" android:src="@drawable/ic_sysbar_lights_out_dot_small" android:scaleType="center" />
<LinearLayout android:orientation="horizontal" android:id="@id/icons" android:paddingLeft="0.0dip" android:paddingRight="2.0dip" android:layout_width="fill_parent" android:layout_height="fill_parent">
<LinearLayout android:orientation="horizontal" android:id="@id/left_icons" android:paddingLeft="4.0dip" android:layout_width="0.0dip" android:layout_height="fill_parent" android:layout_weight="1.0">
<TextView android:textSize="15.0dip" android:gravity="center_vertical" android:id="@id/carrierLabel" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" />
<ImageView android:id="@id/operatorLogoIcon" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="fill_parent" android:src="@drawable/tw_stat_notify_operator_logo" />
<ImageView android:id="@id/doNotDisturbIcon" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/tw_dnd" android:alpha="0.7" android:scaleX="0.85" android:scaleY="0.85" />
<com.android.systemui.statusbar.StatusBarIconView android:id="@id/moreIcon" android:visibility="gone" android:layout_width="@dimen/status_bar_icon_size" android:layout_height="fill_parent" android:src="@drawable/stat_notify_more" />
<com.android.systemui.statusbar.phone.IconMerger android:gravity="center_vertical" android:orientation="horizontal" android:id="@id/notificationIcons" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_alignParentLeft="true" />
</LinearLayout>
<LinearLayout android:orientation="horizontal" android:id="@id/right_icons" android:paddingRight="4.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_alignParentRight="true">
<LinearLayout android:gravity="center_vertical" android:orientation="horizontal" android:id="@id/statusIcons" android:layout_width="wrap_content" android:layout_height="fill_parent" />
<LinearLayout android:gravity="center" android:orientation="horizontal" android:id="@id/signal_battery_cluster" android:paddingLeft="2.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent">
<include android:id="@id/signal_cluster" android:layout_width="wrap_content" android:layout_height="wrap_content" layout="@layout/tw_signal_cluster_view" />
<TextView android:textSize="12.0dip" android:textColor="#ffa6a6a6" android:layout_gravity="center" android:id="@id/battery_text" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/status_bar_network_name_separator" />
<ImageView android:gravity="center" android:id="@id/battery" android:layout_width="wrap_content" android:layout_height="wrap_content" />
</LinearLayout>
<com.android.systemui.statusbar.policy.Clock android:textSize="@dimen/status_bar_clock_text_size" android:textColor="#ff959595" android:ellipsize="none" android:gravity="left|center" android:id="@id/clock" android:paddingLeft="3.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" android:includeFontPadding="false" />
</LinearLayout>
</LinearLayout>
<LinearLayout android:orientation="horizontal" android:id="@id/ticker" android:paddingLeft="6.0dip" android:animationCache="false" android:layout_width="fill_parent" android:layout_height="fill_parent">
<ImageSwitcher android:id="@id/tickerIcon" android:layout_width="@dimen/status_bar_icon_size" android:layout_height="@dimen/status_bar_icon_size" android:layout_marginRight="4.0dip">
<com.android.systemui.statusbar.AnimatedImageView android:layout_width="@dimen/status_bar_icon_size" android:layout_height="@dimen/status_bar_icon_size" android:scaleType="centerInside" />
<com.android.systemui.statusbar.AnimatedImageView android:layout_width="@dimen/status_bar_icon_size" android:layout_height="@dimen/status_bar_icon_size" android:scaleType="centerInside" />
</ImageSwitcher>
<com.android.systemui.statusbar.phone.TickerView android:id="@id/tickerText" android:paddingTop="2.0dip" android:paddingRight="10.0dip" android:layout_width="0.0dip" android:layout_height="wrap_content" android:layout_weight="1.0">
<TextView android:textAppearance="@style/TextAppearance.StatusBar.PhoneTicker" android:id="@id/ticker_text_view_old" android:layout_width="fill_parent" android:layout_height="wrap_content" android:singleLine="true" />
<TextView android:textAppearance="@style/TextAppearance.StatusBar.PhoneTicker" android:id="@id/ticker_text_view_new" android:layout_width="fill_parent" android:layout_height="wrap_content" android:singleLine="true" />
</com.android.systemui.statusbar.phone.TickerView>
</LinearLayout>
</com.android.systemui.statusbar.phone.PhoneStatusBarView>
Navigate to res/values/ids
Past the following somewhere in the file
Code:
<item type="id" name="center_clock">false</item>
<item type="id" name="center_clock_layout">false</item>
Navigte to smali/com/android/systemui/phone/PhoneStatusBar.smali
Find the following method
Code:
.method public showClock(Z)V
Replace the entire method with the following code
Code:
.method public showClock(Z)V
.locals 8
.parameter
.prologue
const/16 v3, 0x8
const/4 v2, 0x0
const/4 v1, 0x1
.line 1151
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarView:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
if-nez v0, :cond_1
.line 1162
:cond_0
:goto_0
return-void
.line 1152
:cond_1
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarView:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
const v4, 0x7f0d003d
invoke-virtual {v0, v4}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->findViewById(I)Landroid/view/View;
move-result-object v4
.line 1153
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarView:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
const v5, 0x7f0d011f
invoke-virtual {v0, v5}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->findViewById(I)Landroid/view/View;
move-result-object v5
.line 1154
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mContext:Landroid/content/Context;
invoke-virtual {v0}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v0
const-string v6, "clock_style"
invoke-static {v0, v6, v1}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v0
if-ne v0, v1, :cond_3
move v0, v1
.line 1155
:goto_1
iget-object v6, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mContext:Landroid/content/Context;
invoke-virtual {v6}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v6
const-string v7, "clock_style"
invoke-static {v6, v7, v1}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v6
const/4 v7, 0x2
if-ne v6, v7, :cond_4
.line 1156
:goto_2
if-eqz v0, :cond_2
if-eqz v4, :cond_2
.line 1157
if-eqz p1, :cond_5
move v0, v2
:goto_3
invoke-virtual {v4, v0}, Landroid/view/View;->setVisibility(I)V
.line 1159
:cond_2
if-eqz v1, :cond_0
if-eqz v5, :cond_0
.line 1160
if-eqz p1, :cond_6
:goto_4
invoke-virtual {v5, v2}, Landroid/view/View;->setVisibility(I)V
goto :goto_0
:cond_3
move v0, v2
.line 1154
goto :goto_1
:cond_4
move v1, v2
.line 1155
goto :goto_2
:cond_5
move v0, v3
.line 1157
goto :goto_3
:cond_6
move v2, v3
.line 1160
goto :goto_4
.end method
Now comes the part where we have ALOT of changes. I am going to attach a zip file that will contain the following files
Code:
-PhoneStatusBar$MyTicker.smali - this file goes in smali/com/android/systemui/phone
-Clock.smali - this file goes in smali/com/android/systemui/policy
-Clock$1.smali - this file goes in smali/com/android/systemui/policy
-Clock$SettingsObserver.smali - this file goes in smali/com/android/systemui/policy
-ClockCenter.smali - this file goes in smali/com/android/systemui/policy
-ClockStock$1.smali - this file goes in smali/com/android/systemui/policy
-ClockStock.smali - this file goes in smali/com/android/systemui/policy
Add and/or replace the existing files with the new ones above
I mentioned we will be working with framework-res and while we are not modifing any files in framework-res you will need to refer to res/values/public if you run into issues with copy and pasting the new code/files. There are quite a few unique ID's that need to match those in the "public" xmlboth in SystemUI and framework-res. If you have issues getting this working, you will need to verify you have the right IDs in the new and revided files. Like I said, its a tough MOD with a lot involved. I will be posting up a flashable zip later tomorrow but it will have other MODs built into it in addition to this time MOD.
Good luck, enjoy and feel free to ask questions if you have them. Thereis an outside chance I forgot something in this guide but I am sure we will figure it out once DEVs get going with it.
DEVs, feel free to use this MOD, just shoot me some credit and hit the thanks button.
See original thread for attachments
Have fun!!
Reserved for even more again.......
Reserved for another ......
Reserved for another one......
Okay guys....post away....LOL
Thanks for your patience.
Thanks for tutorials!
Thanks for the tutorials they worked great on the latest Synergy rom. I woukd thank you more but I already used them up thanking you earlier today!!!
Sent from my SCH-I535 using Tapatalk 2
Here is a new LockScreen Torch MOD updated for use on the new JB leak BLK1. I have made a few changes this time around (hopefully fr the better )
This new version (due to code within android.policy.jar) allows the torch to stay on until the screen times out or you unlock it. No need to hold the button in. Again, not my doing, just changes in the policy.
I have implemented a toggle to allow the user to enable or disable the torch. I did this because I love toggles, Im on a toggle kick right now
****EDIT****
This is an updated version to the LockScreen Torch guide.
It is for the newest firmware BLK1
It now includes an on/off toggle located in LockScreen Settings
Enjoy!
THE FLASHABLE ZIP IS MEANT FOR STOCK BLK1 DEODEXED ROMs. IT WILL ADD A FEW OTHER MODs AS WELL. IF YOUR ON A CUSTOM ROM IT WILL PROBABLY STILL WORK BUT IT WILL BREAK ANY THEMES YOU MAY HAVE.
LOCKSCREEN TORCH ZIP DOWNLOAD
The lockscreen torch will allow you to quickly turn on your flashlight from the lockscreen. Simply push the home button in for torch, it will go off when you unlock, hit the power button or it times out. Not sure who originally wrote the MOD but I have spent some time re-writing it to fit the GS3 based on a dozen or so other tutorials.
After reboot, it will take about 60 seconds before the MOD will engage. Then it will work at will as long as you are on the lockscreen.
DEVs if you want to use this in your ROM feel free, just shoot me some credit and some thanks!
Hit the Thanks Button!
Here is the guide.....
GUIDE New Version with toggle! For BLK1
First you will need to download the torch file below and drop it in /system/app, do not install.....just drop in the folder. This will be in the zip file with the smali files.
We will be working with two system files
SecSettings.apk
android.policy.jar
We will begin with SecSettings
Navigate to res/values/strings
Add the following lines somewhere in the middle or end, it doesnt matter.
Code:
<string name="enable_lockscreen_torch">LockScreen Torch</string>
<string name="enable_lockscreen_torch_text">Enables torch for lockscreen</string>
Navigate to res/xml/Lockscreen_Settings.xml
Add the following lines in RED (this assumes you have the aosplock also, if not just ignore it)
Code:
<PreferenceCategory android:title="@string/display_settings" />
<CheckBoxPreference android:title="@string/enable_aosp_lock" android:key="enable_aosp_lock" android:summary="@string/enable_aosp_lock_text" />
[COLOR="Red"]<CheckBoxPreference android:title="@string/enable_lockscreen_torch" android:key="enable_lockscreen_torch" android:summary="@string/enable_lockscreen_torch_text" />
[/COLOR] <SwitchPreferenceScreen android:title="@string/lock_screen_shortcut_title" android:key="lock_screen_shortcut" android:summary="@string/lock_screen_shortcut_summary">
<intent android:targetPackage="com.android.settings" android:action="android.intent.action.MAIN" android:targetClass="com.android.settings.lockscreenshortcut.LockScreenShortcutSettings" />
</SwitchPreferenceScreen>
Navigate to com/android/settings/LockScreenSettings.smali
Add the following code in RED (again, this assumes you havethe AOSP lockscreen. If not, ignore that code)
Code:
.method private updateState()V
.locals 9
.prologue
const/4 v5, 0x1
const/4 v6, 0x0
.line 263
[COLOR="Red"]iget-object v7, p0, Lcom/android/settings/LockScreenSettings;->mLockScreenTorch:Landroid/preference/CheckBoxPreference;
invoke-virtual {p0}, Lcom/android/settings/LockScreenSettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v4
const-string v8, "enable_lockscreen_torch"
invoke-static {v4, v8, v6}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v4
if-eqz v4, :cond_7
move v4, v5
invoke-virtual {v7, v4}, Landroid/preference/CheckBoxPreference;->setChecked(Z)V
.line 265
invoke-virtual {p0}, Lcom/android/settings/LockScreenSettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v4
[/COLOR]
iget-object v7, p0, Lcom/android/settings/LockScreenSettings;->mAospLock:Landroid/preference/CheckBoxPreference;
invoke-virtual {p0}, Lcom/android/settings/LockScreenSettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v4
const-string v8, "enable_aosp_lock"
invoke-static {v4, v8, v6}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v4
if-eqz v4, :cond_7
move v4, v5
invoke-virtual {v7, v4}, Landroid/preference/CheckBoxPreference;->setChecked(Z)V
.line 265
invoke-virtual {p0}, Lcom/android/settings/LockScreenSettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v4
iget-object v7, p0, Lcom/android/settings/LockScreenSettings;->mClock:Landroid/preference/CheckBoxPreference;
invoke-virtual {p0}, Lcom/android/settings/LockScreenSettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v4
const-string v8, "show_clock"
invoke-static {v4, v8, v6}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v4
if-eqz v4, :cond_7
Code:
:cond_0
const-string v9, "clock"
invoke-virtual {p0, v9}, Lcom/android/settings/LockScreenSettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v9
check-cast v9, Landroid/preference/CheckBoxPreference;
iput-object v9, p0, Lcom/android/settings/LockScreenSettings;->mClock:Landroid/preference/CheckBoxPreference;
.line 159
iget-object v9, p0, Lcom/android/settings/LockScreenSettings;->mClock:Landroid/preference/CheckBoxPreference;
const/4 v10, 0x0
invoke-virtual {v9, v10}, Landroid/preference/CheckBoxPreference;->setPersistent(Z)V
const-string v9, "enable_aosp_lock"
invoke-virtual {p0, v9}, Lcom/android/settings/LockScreenSettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v9
check-cast v9, Landroid/preference/CheckBoxPreference;
iput-object v9, p0, Lcom/android/settings/LockScreenSettings;->mAospLock:Landroid/preference/CheckBoxPreference;
.line 159
iget-object v9, p0, Lcom/android/settings/LockScreenSettings;->mAospLock:Landroid/preference/CheckBoxPreference;
const/4 v10, 0x0
invoke-virtual {v9, v10}, Landroid/preference/CheckBoxPreference;->setPersistent(Z)V
[COLOR="red"]const-string v9, "enable_lockscreen_torch"
invoke-virtual {p0, v9}, Lcom/android/settings/LockScreenSettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v9
check-cast v9, Landroid/preference/CheckBoxPreference;
iput-object v9, p0, Lcom/android/settings/LockScreenSettings;->mLockScreenTorch:Landroid/preference/CheckBoxPreference;
.line 159
iget-object v9, p0, Lcom/android/settings/LockScreenSettings;->mLockScreenTorch:Landroid/preference/CheckBoxPreference;
const/4 v10, 0x0
invoke-virtual {v9, v10}, Landroid/preference/CheckBoxPreference;->setPersistent(Z)V
[/COLOR]
.line 161
const-string v9, "weather"
invoke-virtual {p0, v9}, Lcom/android/settings/LockScreenSettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v9
Code:
:cond_9
iget-object v4, p0, Lcom/android/settings/LockScreenSettings;->mSayCommand:Landroid/preference/CheckBoxPreference;
invoke-virtual {p2, v4}, Ljava/lang/Object;->equals(Ljava/lang/Object;)Z
move-result v4
if-eqz v4, :cond_b
.line 338
invoke-virtual {p0}, Lcom/android/settings/LockScreenSettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v4
const-string v5, "wake_up_lock_screen"
iget-object v6, p0, Lcom/android/settings/LockScreenSettings;->mSayCommand:Landroid/preference/CheckBoxPreference;
invoke-virtual {v6}, Landroid/preference/CheckBoxPreference;->isChecked()Z
move-result v6
if-eqz v6, :cond_a
:goto_5
invoke-static {v4, v5, v2}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z
goto/16 :goto_1
:cond_a
move v2, v3
goto :goto_5
:cond_b
iget-object v4, p0, Lcom/android/settings/LockScreenSettings;->mAospLock:Landroid/preference/CheckBoxPreference;
invoke-virtual {p2, v4}, Ljava/lang/Object;->equals(Ljava/lang/Object;)Z
move-result v4
[COLOR="red"] if-eqz v4, :cond_d
[/COLOR]
.line 313
invoke-virtual {p0}, Lcom/android/settings/LockScreenSettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v4
const-string v5, "enable_aosp_lock"
iget-object v6, p0, Lcom/android/settings/LockScreenSettings;->mAospLock:Landroid/preference/CheckBoxPreference;
invoke-virtual {v6}, Landroid/preference/CheckBoxPreference;->isChecked()Z
move-result v6
if-eqz v6, :cond_c
:goto_6
invoke-static {v4, v5, v2}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z
.line 314
goto/16 :goto_1
:cond_c
move v2, v3
.line 313
goto :goto_6
[COLOR="red"]:cond_d
iget-object v4, p0, Lcom/android/settings/LockScreenSettings;->mLockScreenTorch:Landroid/preference/CheckBoxPreference;
invoke-virtual {p2, v4}, Ljava/lang/Object;->equals(Ljava/lang/Object;)Z
move-result v4
if-eqz v4, :cond_0
.line 400
invoke-virtual {p0}, Lcom/android/settings/LockScreenSettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v4
const-string v5, "enable_lockscreen_torch"
iget-object v6, p0, Lcom/android/settings/LockScreenSettings;->mLockScreenTorch:Landroid/preference/CheckBoxPreference;
invoke-virtual {v6}, Landroid/preference/CheckBoxPreference;->isChecked()Z
move-result v6
if-eqz v6, :cond_e
:goto_7
invoke-static {v4, v5, v2}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z
.line 450
goto/16 :goto_1
:cond_e
move v2, v3
.line 550
goto :goto_7
[/COLOR] .line 600
.end method
.method public onResume()V
Thats it for SecSettings!
Now for android.policy.jar
See next post to continue.......
PART 2 android.policy.jar
Navigate to smali/com/android/internal/policy/impl/KeyguardViewMediator$4.smali
Find the following code and add the part in RED
Code:
packed-switch v2, :pswitch_data_0
.line 1172
:goto_0
[COLOR="Red"][B] :pswitch_0
[/B][/COLOR] return-void
Find the 13 : pswitch_ lines and increase them by 1. For example
Code:
:pswitch_0 becomes :pswitch_1
:pswitch_1 becomes :pswitch_2
:pswitch_2 becomes :pswitch_3
:pswitch_3 becomes :pswitch_4
:pswitch_4 becomes :pswitch_5
:pswitch_5 becomes :pswitch_6
:pswitch_6 becomes :pswitch_7
:pswitch_7 becomes :pswitch_8
:pswitch_8 becomes :pswitch_9
:pswitch_9 becomes :pswitch_a
:pswitch_a becomes :pswitch_b
:pswitch_b becomes :pswitch_c
:pswitch_c becomes :pswitch_d
Find the following code
Code:
invoke-static {v0}, Lcom/android/internal/policy/impl/KeyguardViewMediator;->access$300(Lcom/android/internal/policy/impl/KeyguardViewMediator;)V
.line 1169
monitor-exit v1
goto :goto_0
Add the following directly after
Code:
.line 974
:pswitch_e
iget-object v2, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator$4;->this$0:Lcom/android/internal/policy/impl/KeyguardViewMediator;
iget v3, p1, Landroid/os/Message;->arg1:I
if-eqz v3, :cond_2
move v3, v0
:goto_3
#calls: Lcom/android/internal/policy/impl/KeyguardViewMediator;->handleSetTorch(Z)V
invoke-static {v2, v3}, Lcom/android/internal/policy/impl/KeyguardViewMediator;->access$1900(Lcom/android/internal/policy/impl/KeyguardViewMediator;Z)V
goto :goto_0
:cond_2
move v3, v1
goto :goto_3
Find the "nop' at the end and add another one right below it
Code:
throw v0
.line 1129
nop
nop
Find the stack of : pswitch_ lines at the end of the smali and delete : pswitch_0
Then add the following so the entire stack will end up looking like this
Code:
.packed-switch 0x1
:pswitch_1
:pswitch_2
:pswitch_3
:pswitch_4
:pswitch_5
:pswitch_6
:pswitch_7
:pswitch_8
:pswitch_9
:pswitch_a
:pswitch_b
:pswitch_c
:pswitch_d
:pswitch_0
:pswitch_0
:pswitch_0
:pswitch_0
:pswitch_0
:pswitch_0
:pswitch_e
.end packed-switch
.end method
Thats it for KeyguardViewMediator$4.smali. Save and close the file.
Navigate to smali/com/android/internal/policy/impl/KeyguardViewMediator.smali
Add the following in RED
Code:
.field private static final SET_HIDDEN:I = 0xc
[COLOR="Red"].field private static final SET_TORCH:I = 0x14[/COLOR]
.field private static final SHOW:I = 0x2
Code:
.field private mTelephonyManager:Landroid/telephony/TelephonyManager;
[COLOR="red"].field private mTorchEnabled:Z
.field private mTorchStateChanged:Z
[/COLOR]
.field private mUnlockSoundId:I
Code:
# direct methods
.method public constructor <init>(Landroid/content/Context;Lcom/android/internal/policy/impl/PhoneWindowManager;Landroid/os/LocalPowerManager;)V
.locals 11
.parameter "context"
.parameter "callback"
.parameter "powerManager"
.prologue
.line 299
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
[COLOR="red"]const/4 v0, 0x1
iput-boolean v0, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mTorchEnabled:Z
[/COLOR]
.line 179
const/4 v0, 0x1
iput-boolean v0, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mSuppressNextLockSound:Z
.line 180
const/4 v0, 0x1
Code:
iput-object p1, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mContext:Landroid/content/Context;
.line 302
iput-object p3, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mRealPowerManager:Landroid/os/LocalPowerManager;
[COLOR="red"] const/4 v0, 0x0
iput-boolean v0, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mTorchEnabled:Z
iput-boolean v0, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mTorchStateChanged:Z
[/COLOR]
.line 303
const-string v0, "power"
invoke-virtual {p1, v0}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
move-result-object v0
check-cast v0, Landroid/os/PowerManager;
iput-object v0, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mPM:Landroid/os/PowerManager;
.line 304
iget-object v0, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mPM:Landroid/os/PowerManager;
const v1, 0x1000001a
Code:
.method static synthetic access$2300(Lcom/android/internal/policy/impl/KeyguardViewMediator;Z)V
.locals 0
.parameter "x0"
.parameter "x1"
.prologue
.line 103
invoke-direct {p0, p1}, Lcom/android/internal/policy/impl/KeyguardViewMediator;->handleSetHidden(Z)V
return-void
.end method
[COLOR="red"].method static synthetic access$2400(Lcom/android/internal/policy/impl/KeyguardViewMediator;Z)V
.locals 0
invoke-direct {p0, p1}, Lcom/android/internal/policy/impl/KeyguardViewMediator;->handleSetTorch(Z)V
return-void
.end method
[/COLOR]
.method static synthetic access$300(Lcom/android/internal/policy/impl/KeyguardViewMediator;I)V
Code:
invoke-direct {p0, v0}, Lcom/android/internal/policy/impl/KeyguardViewMediator;->adjustLocked(Z)V
.line 1411
monitor-exit p0
[COLOR="red"] invoke-direct {p0}, Lcom/android/internal/policy/impl/KeyguardViewMediator;->resetTorchState()V
[/COLOR]
goto :goto_0
:catchall_0
move-exception v0
monitor-exit p0
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
throw v0
.end method
.method private handleKeyguardDone(Z)V
Code:
invoke-virtual {v0}, Lcom/android/internal/policy/impl/KeyguardViewManager;->onScreenTurnedOff()V
.line 1562
monitor-exit p0
[COLOR="red"]invoke-direct {p0}, Lcom/android/internal/policy/impl/KeyguardViewMediator;->resetTorchState()V[/COLOR]
.line 1563
return-void
.line 1562
:catchall_0
move-exception v0
monitor-exit p0
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
throw v0
.end method
.method private handleNotifyScreenOn(Lcom/android/internal/policy/impl/KeyguardViewManager$ShowListener;)V
.locals 2
Code:
invoke-direct {p0}, Lcom/android/internal/policy/impl/KeyguardViewMediator;->adjustUserActivityLocked()V
.line 682
invoke-direct {p0}, Lcom/android/internal/policy/impl/KeyguardViewMediator;->adjustStatusBarLocked()V
[COLOR="red"] invoke-direct {p0}, Lcom/android/internal/policy/impl/KeyguardViewMediator;->resetTorchState()V
[/COLOR]
.line 684
:cond_0
monitor-exit p0
.line 685
return-void
.line 684
:catchall_0
move-exception v0
monitor-exit p0
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
throw v0
.end method
[COLOR="red"].method private handleSetTorch(Z)V
.locals 6
const/4 v0, 0x0
iget-object v5, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mContext:Landroid/content/Context;
invoke-virtual {v5}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v5
const-string v4, "enable_lockscreen_torch"
invoke-static {v5, v4, v0}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v5
if-eqz v5, :cond_0
const/4 v5, 0x0
const/4 v4, 0x1
:try_start_0
iget-boolean v1, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mTorchStateChanged:Z
if-nez v1, :cond_1
iput-boolean v1, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mTorchEnabled:Z
const/4 v1, 0x1
iput-boolean v1, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mTorchStateChanged:Z
:cond_0
:goto_0
return-void
:cond_1
iget-boolean v1, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mTorchEnabled:Z
if-eq v1, p1, :cond_0
iput-boolean p1, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mTorchEnabled:Z
new-instance v0, Landroid/content/Intent;
const-string v1, "net.cactii.flash2.TOGGLE_FLASHLIGHT"
invoke-direct {v0, v1}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V
const-string v1, "net.cactii.flash2.EXTRA_DISABLE_NOTIFICATION"
const/4 v2, 0x1
invoke-virtual {v0, v1, v2}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Z)Landroid/content/Intent;
iget-object v1, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mContext:Landroid/content/Context;
invoke-virtual {v1, v0}, Landroid/content/Context;->sendBroadcast(Landroid/content/Intent;)V
:try_end_0
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
goto :goto_0
:catch_0
move-exception v1
goto :goto_0
.end method
[/COLOR]
.method private handleShow()V
Code:
invoke-interface {v0, v1}, Landroid/app/IActivityManager;->closeSystemDialogs(Ljava/lang/String;)V
:try_end_1
.catchall {:try_start_1 .. :try_end_1} :catchall_0
.catch Landroid/os/RemoteException; {:try_start_1 .. :try_end_1} :catch_0
.line 1380
:goto_1
:try_start_2
iget-object v0, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mShowKeyguardWakeLock:Landroid/os/PowerManager$WakeLock;
invoke-virtual {v0}, Landroid/os/PowerManager$WakeLock;->release()V
[COLOR="red"]const/4 v0, 0x1
iput-boolean v0, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mTorchStateChanged:Z
[/COLOR]
.line 1381
monitor-exit p0
goto :goto_0
:catchall_0
move-exception v0
monitor-exit p0
:try_end_2
.catchall {:try_start_2 .. :try_end_2} :catchall_0
Code:
.end method
[COLOR="red"].method private resetTorchState()V
.locals 1
iget-boolean v0, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mTorchStateChanged:Z
if-eqz v0, :cond_0
const/4 v0, 0x0
invoke-direct {p0, v0}, Lcom/android/internal/policy/impl/KeyguardViewMediator;->handleSetTorch(Z)V
:cond_0
return-void
.end method
[/COLOR]
.method private showLocked()V
.locals 3
.prologue
.line 839
const-string v1, "KeyguardViewMediator"
Code:
const-string v1, "KeyguardViewMediator"
const-string v2, "done waiting for mWaitingUntilKeyguardVisible"
invoke-static {v1, v2}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I
:try_end_3
.catchall {:try_start_3 .. :try_end_3} :catchall_0
goto :goto_1
.end method
[COLOR="red"].method public setTorch(Z)V
.locals 5
const/16 v4, 0x14
const/4 v3, 0x0
iget-boolean v1, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mScreenOn:Z
if-eqz v1, :cond_0
iget-object v1, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mHandler:Landroid/os/Handler;
invoke-virtual {v1, v4}, Landroid/os/Handler;->removeMessages(I)V
iget-object v1, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mHandler:Landroid/os/Handler;
if-eqz p1, :cond_1
const/4 v2, 0x1
:goto_0
invoke-virtual {v1, v4, v2, v3}, Landroid/os/Handler;->obtainMessage(III)Landroid/os/Message;
move-result-object v0
iget-object v1, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mHandler:Landroid/os/Handler;
invoke-virtual {v1, v0}, Landroid/os/Handler;->sendMessage(Landroid/os/Message;)Z
:cond_0
return-void
:cond_1
move v2, v3
goto :goto_0
.end method
[/COLOR]
.method public verifyUnlock(Landroid/view/WindowManagerPolicy$OnKeyguardExitResult;)V
.locals 2
.parameter "callback"
.prologue
.line 618
monitor-enter p0
Thats it for KeyguardViewMediator.smali. Save the file and close.
Continue to post 3.........
PART 3 android.policy.jar continues.......
Navigate to smali/com/android/internal/policy/impl/PhoneWindowManager.smali
Find the following code and add the parts in RED
Code:
iget-boolean v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolumeUpKeyConsumedByScreenRecordChord:Z
move/from16 v40, v0
if-eqz v40, :cond_15
.line 2954
:cond_14
:goto_4
const/16 v40, 0x3
move/from16 v0, v21
move/from16 v1, v40
[COLOR="Red"] if-ne v0, v1, :cond_2c
[/COLOR]
.line 2956
if-eqz p1, :cond_17
invoke-interface/range {p1 .. p1}, Landroid/view/WindowManagerPolicy$WindowState;->getAttrs()Landroid/view/WindowManager$LayoutParams;
move-result-object v4
.line 2957
.local v4, attrs:Landroid/view/WindowManager$LayoutParams;
:goto_5
move-object/from16 v0, p0
iget-boolean v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHomeDoubleClickBehavior:Z
move/from16 v40, v0
if-eqz v40, :cond_18
if-eqz v19, :cond_18
const/16 v25, 0x1
.line 2959
.local v25, mSupportDoubleClick:Z
Code:
st-string v40, "WindowManager"
const-string v41, "Ignoring HOME; event canceled."
invoke-static/range {v40 .. v41}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I
goto :goto_9
.line 3031
.end local v13 #homeWasLongPressed:Z
:cond_21
[COLOR="Red"] if-eqz v4, :cond_26
[/COLOR]
.line 3032
iget v0, v4, Landroid/view/WindowManager$LayoutParams;->type:I
move/from16 v38, v0
.line 3033
.local v38, type:I
const/16 v40, 0x7d4
move/from16 v0, v38
move/from16 v1, v40
Code:
if-eq v0, v1, :cond_22
const/16 v40, 0x7d9
move/from16 v0, v38
move/from16 v1, v40
if-ne v0, v1, :cond_24
.line 9999
:cond_22
[COLOR="red"]move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mKeyguardMediator:Lcom/android/internal/policy/impl/KeyguardViewMediator;
move-object/from16 v40, v0
invoke-virtual/range {v40 .. v40}, Lcom/android/internal/policy/impl/KeyguardViewMediator;->isShowingAndNotHidden()Z
move-result v40
if-eqz v40, :cond_23
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mKeyguardMediator:Lcom/android/internal/policy/impl/KeyguardViewMediator;
move-object/from16 v40, v0
move-object/from16 v0, v40
move v1, v9
invoke-virtual {v0, v1}, Lcom/android/internal/policy/impl/KeyguardViewMediator;->setTorch(Z)V
rem-int/lit8 v40, v30, 0xf
if-nez v40, :cond_23
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mKeyguardMediator:Lcom/android/internal/policy/impl/KeyguardViewMediator;
move-object/from16 v40, v0
invoke-virtual/range {v40 .. v40}, Lcom/android/internal/policy/impl/KeyguardViewMediator;->pokeWakelock()V
[/COLOR]
if-eqz v25, :cond_23
const/16 v40, 0x7d9
move/from16 v0, v38
move/from16 v1, v40
if-ne v0, v1, :cond_23
.line 3038
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHomeKeyDoubleClickConcept:Lcom/android/internal/policy/impl/PhoneWindowManager$HomeKeyDoubleClickConcept;
move-object/from16 v40, v0
invoke-virtual/range {v40 .. v40}, Lcom/android/internal/policy/impl/PhoneWindowManager$HomeKeyDoubleClickConcept;->setHomeDownEventSent()V
.line 3041
:cond_23
DELETE the line below in RED
Code:
invoke-virtual/range {v40 .. v40}, Lcom/android/internal/policy/impl/PhoneWindowManager$HomeKeyDoubleClickConcept;->setHomeDownEventSent()V
.line 3041
:cond_23
const-wide/16 v40, 0x0
goto/16 :goto_2
.line 3043
[COLOR="red"] :cond_24[/COLOR]
sget-object v40, Lcom/android/internal/policy/impl/PhoneWindowManager;->WINDOW_TYPES_WHERE_HOME_DOESNT_WORK:[I
move-object/from16 v0, v40
array-length v0, v0
move/from16 v39, v0
.line 3044
.local v39, typeCount:I
Here is a sort of tricky part. Starting right after the above code change you need to comb the rest of this entire method for all references to ":cond_X" and deccrement them by one. THERE ARE A LOT! Take your time and find them all. For example
Code:
:cond_33 becomes :cond_32
:cond_29 becomes :cond_28
:cond_40becomes :cond_3f
....etc. MAKE SURE YOU FIND THEM ALL! The last one you change should be from:cond_56 to :cond_55.
Thats it! Recompile everything and push!
Enjoy! Thanks Button !!
mine3.........
Alldone. I will try to get a flashable up soon.
Enjoy!
Flashable Zip added to the OP.
Notice, It will bork your home button from selecting recent apps. Not a big deal cause I dont use that anyway but i will fix it shortly.
So no go on VRBLI5? Or may it still work?
Will there be a version that has the hold to turn on feature?
nice work will try .
TokedUp said:
So no go on VRBLI5? Or may it still work?
Will there be a version that has the hold to turn on feature?
Click to expand...
Click to collapse
nothing for LI5 sorry. I like the new version not baving to hold the button so I have not really looked into going back to the other way, sorry.
Will this work on sgs3 omega v37.1
Sent from my GT-I9300 using xda app-developers app
thanks for your toturial.
but i have issue from last part.
Here is a sort of tricky part. Starting right after the above code change you need to comb the rest of this entire method for all references to ":cond_X" and deccrement them by one. THERE ARE A LOT! Take your time and find them all. For example
Code:
:cond_33 becomes :cond_32
:cond_29 becomes :cond_28
:cond_40becomes :cond_3f
....etc. MAKE SURE YOU FIND THEM ALL! The last one you change should be from:cond_56 to :cond_55.
Click to expand...
Click to collapse
i am starting to change the cond_xx decrement , but where to start?
for example on MR2, the last parameter is cond_26
invoke-virtual/range {v40 .. v40}, Lcom/android/internal/policy/impl/PhoneWindowManager$HomeKeyDoubleClickConcept;->setHomeDownEventSent()V
.line 3041
:cond_23
const-wide/16 v40, 0x0
goto/16 :goto_2
.line 3043
:cond_26
sget-object v40, Lcom/android/internal/policy/impl/PhoneWindowManager;->WINDOW_TYPES_WHERE_HOME_DOESNT_WORK:[I
move-object/from16 v0, v40
array-length v0, v0
move/from16 v39, v0
.line 3044
.local v39, typeCount:I
Click to expand...
Click to collapse
i should start from this numbers? (which cond_xx is for starting to decrement?)
cond_26 -> cond_25
cond_27 -> cond_26
.......
or start from cond_0 -> cond_?
thanks
Has anyone tried this with a SPRINT S3 ?
Just wanted to mention that this line is missing in LockScreenSettings.smali:
Code:
.field private mLockScreenTorch:Landroid/preference/CheckBoxPreference;
Can you POST here original android.policy.jar ?
It ease to see difference some times instead of instruction.
Thanks.
With some modifications, I managed to get this working on the SGS3 GT-i9300
I'll make a thread in their forums.
Kryten2k35 said:
With some modifications, I managed to get this working on the SGS3 GT-i9300
I'll make a thread in their forums.
Click to expand...
Click to collapse
Please link to it here!
Any idea if it will work on Sprint ?
Sent from my SPH-L710
Tried this on a t-mo gs3 & everything seemed to work fine but whenever I hold the home button down like to show recent apps and stuff nothing happens. Any idea why?
could someone help me with this??
Here is a sort of tricky part. Starting right after the above code change you need to comb the rest of this entire method for all references to ":cond_X" and deccrement them by one. THERE ARE A LOT! Take your time and find them all. For example???
didnt get it tbh
AskinSavascisi said:
could someone help me with this??
Here is a sort of tricky part. Starting right after the above code change you need to comb the rest of this entire method for all references to ":cond_X" and deccrement them by one. THERE ARE A LOT! Take your time and find them all. For example???
didnt get it tbh
Click to expand...
Click to collapse
you edit every cond_X by -1
so if say you are starting with cond_29 it becomes cond_28
then you will go down find a cond_28 that then becomes cond_27
go down a bit find cond_27 that then becomes cond_26
and so on until they are done.
andybones said:
you edit every cond_X by -1
so if say you are starting with cond_29 it becomes cond_28
then you will go down find a cond_28 that then becomes cond_27
go down a bit find cond_27 that then becomes cond_26
and so on until they are done.
Click to expand...
Click to collapse
ok thanks may i ask u another question :fingers-crossed:
Code:
packed-switch v2, :pswitch_data_0
.line 1267
:goto_0
:pswitch_0
return-void
but mine looks like:
Code:
packed-switch v2, :pswitch_data_72
.line 1172
:goto_7
[COLOR="Red"]:pswitch_0[/COLOR] -> do i need to keep this still 0 or make it 8? coz my pswitch_ lines starts from :pswitch_8
return-void
and this will look like this rigt?
Code:
:pswitch_data_72
.packed-switch 0x1
:pswitch_8 -> [COLOR="red"]9[/COLOR]
:pswitch_10 ->[COLOR="red"]11[/COLOR]
:pswitch_16 ->[COLOR="red"]17[/COLOR]
:pswitch_1c ->[COLOR="red"]1d[/COLOR]
:pswitch_22 ->[COLOR="red"]23[/COLOR]
:pswitch_28 ->[COLOR="red"]29[/COLOR]
:pswitch_2e ->[COLOR="red"]2f[/COLOR]
:pswitch_38 ->[COLOR="red"]39[/COLOR]
:pswitch_40 ->[COLOR="red"]41[/COLOR]
:pswitch_4c ->[COLOR="red"]4d[/COLOR]
:pswitch_52 ->[COLOR="red"]53[/COLOR]
:pswitch_58 ->[COLOR="red"]59[/COLOR]
:pswitch_64 ->[COLOR="Red"]65[/COLOR]
.end packed-switch
.end method
Hello guys
Here is a new guide on setting up the recents.
Credit:-
KachalkinGeorg (The GK)
Requirements (deodexed):-
1.Settings.apk
2.SystemUI.apk
3.NotePad++
4.Patience.. if you dont have try to get it
First Part ( Settings.apk )
1.Decompile Settings.apk
2.Download recentsettings.zip from attachment. extract and copy to your Decompiled Settings.
3.Open Settings\res\values\ids.xml and add below code
Code:
<item type="id" name="gk_system_section">false</item>
4.Open Settings\res\values\strings.xml and add below code
Code:
<string name="header_gk_system_special">Systemâ„¢</string>
<string name="recents_panel_title">Recents panel</string>
<string name="recents_panel_settings">Recents panel settings</string>
<string name="show_clear_all_recents_button_title">Clear all recents button</string>
<string name="show_clear_all_recents_button_summary">Show clear all button on recents panel</string>
<string name="recents_clear_all_location_title">Clear all recents location</string>
<string name="recents_clear_all_location_top_right">Top right</string>
<string name="recents_clear_all_location_top_left">Top left</string>
<string name="recents_clear_all_location_top_center">Top center</string>
<string name="recents_clear_all_location_bottom_right">Bottom right</string>
<string name="recents_clear_all_location_bottom_left">Bottom left</string>
<string name="recents_clear_all_location_bottom_center">Bottom center</string>
<string name="recents_clear_all_dismiss_all_title">Clear all tasks</string>
<string name="recents_clear_all_dismiss_all_summary">Choose whether to dismiss all tasks or ignore the foreground task</string>
<string name="recents_show_searchbar">Show Search Bar in Recents</string>
<string name="recents_show_searchbar_summary">Enable or disable the Google search bar in the recents menu</string>
5.Open Settings\res\values\arrays.xml and add below code
Code:
<string-array name="recents_clear_all_location_entries">
<item>@string/recents_clear_all_location_top_right</item>
<item>@string/recents_clear_all_location_top_left</item>
<item>@string/recents_clear_all_location_top_center</item>
<item>@string/recents_clear_all_location_bottom_right</item>
<item>@string/recents_clear_all_location_bottom_left</item>
<item>@string/recents_clear_all_location_bottom_center</item>
</string-array>
6.Open Settings\res\xml\dashboard_categories.xml and add below code
Code:
<dashboard-tile android:icon="@drawable/ic_settings_gk_system" android:id="@id/gk_system_section" android:title="@string/header_gk_system_special" android:fragment="com.android.settings.gk.GKmodSystem" />
7.Now Recompile and Decompile Settings (For ids)
8.Open Settings\smali\com\android\settings\gk\GKmodSystem.smali and find below code
Code:
0x7f050055
replace with below id
Code:
<public type="xml" name="gk_system_settings"
9.Open Settings\smali\com\android\settings\gk\Resents\RecentsPanelSettings.smali and find below codes
find
Code:
0x7f090356
replace with below id
Code:
<public type="string" name="recents_clear_all_location_top_right"
find
Code:
0x7f090357
replace with below id
Code:
<public type="string" name="recents_clear_all_location_top_left"
find
Code:
0x7f090358
replace with below id
Code:
<public type="string" name="recents_clear_all_location_top_center"
find
Code:
0x7f090359
replace with below code
Code:
<public type="string" name="recents_clear_all_location_bottom_right"
find
Code:
0x7f09035a
replace with below id
Code:
<public type="string" name="recents_clear_all_location_bottom_left"
find
Code:
0x7f09035b
replace with below id
Code:
<public type="string" name="recents_clear_all_location_bottom_center"
find
Code:
0x7f060042
replace with below id
Code:
<public type="xml" name="gk_recents_panel_settings"
10.Now Compile Settings and move to your device.
Continued in next post
Final Part ( SystemUI.apk )
1.Decompile SystemUI.apk
2.Download recetsystemui.zip from attachment. extract and copy to your decompiled SystemUI
3.Open SystemUI\res\values\colors.xml and add below code
Code:
<color name="gk_recents_color">#ff90A4AE</color>
<color name="gk_recents_icon_color">#ffffffff</color>
4.Open SystemUI\res\values\dimens.xml and add below code
Code:
<dimen name="gk_recents_action_button_height">54.0dip</dimen>
<dimen name="gk_recents_action_button_width">54.0dip</dimen>
<dimen name="gk_recents_action_button_translation_z">12.0dip</dimen>
<dimen name="gk_recents_action_button_margin_side">32.0dip</dimen>
<dimen name="gk_recents_action_button_margin_bottom">45.0dip</dimen>
5.Open SystemUI\res\values\ids.xml and add below code
Code:
<item type="id" name="gk_recents">false</item>
6.Now Recompile and Decompile SystemUI (For ids)
7.Open SystemUI\smali\com\android\systemui\recents\RecentsActivity.smali and do below edittings.
find below method
Code:
.method bindSearchBarAppWidget()V
replace whole method with this
Code:
.method bindSearchBarAppWidget()V
.locals 5
.prologue
const/4 v4, 0x0
.line 293
invoke-static {}, Lcom/android/systemui/recents/model/RecentsTaskLoader;->getInstance()Lcom/android/systemui/recents/model/RecentsTaskLoader;
move-result-object v3
invoke-virtual {v3}, Lcom/android/systemui/recents/model/RecentsTaskLoader;->getSystemServicesProxy()Lcom/android/systemui/recents/misc/SystemServicesProxy;
move-result-object v1
.line 296
.local v1, "ssp":Lcom/android/systemui/recents/misc/SystemServicesProxy;
iput-object v4, p0, Lcom/android/systemui/recents/RecentsActivity;->mSearchAppWidgetHostView:Landroid/appwidget/AppWidgetHostView;
.line 297
iput-object v4, p0, Lcom/android/systemui/recents/RecentsActivity;->mSearchAppWidgetInfo:Landroid/appwidget/AppWidgetProviderInfo;
.line 300
iget-object v3, p0, Lcom/android/systemui/recents/RecentsActivity;->mConfig:Lcom/android/systemui/recents/RecentsConfiguration;
iget v0, v3, Lcom/android/systemui/recents/RecentsConfiguration;->searchBarAppWidgetId:I
.line 301
.local v0, "appWidgetId":I
if-ltz v0, :cond_0
.line 302
invoke-virtual {v1, v0}, Lcom/android/systemui/recents/misc/SystemServicesProxy;->getAppWidgetInfo(I)Landroid/appwidget/AppWidgetProviderInfo;
move-result-object v3
iput-object v3, p0, Lcom/android/systemui/recents/RecentsActivity;->mSearchAppWidgetInfo:Landroid/appwidget/AppWidgetProviderInfo;
.line 303
iget-object v3, p0, Lcom/android/systemui/recents/RecentsActivity;->mSearchAppWidgetInfo:Landroid/appwidget/AppWidgetProviderInfo;
if-nez v3, :cond_0
.line 306
iget-object v3, p0, Lcom/android/systemui/recents/RecentsActivity;->mAppWidgetHost:Lcom/android/systemui/recents/RecentsAppWidgetHost;
invoke-virtual {v1, v3, v0}, Lcom/android/systemui/recents/misc/SystemServicesProxy;->unbindSearchAppWidget(Landroid/appwidget/AppWidgetHost;I)V
.line 307
const/4 v0, -0x1
.line 312
:cond_0
if-gez v0, :cond_1
.line 313
iget-object v3, p0, Lcom/android/systemui/recents/RecentsActivity;->mAppWidgetHost:Lcom/android/systemui/recents/RecentsAppWidgetHost;
invoke-virtual {v1, v3}, Lcom/android/systemui/recents/misc/SystemServicesProxy;->bindSearchAppWidget(Landroid/appwidget/AppWidgetHost;)Landroid/util/Pair;
move-result-object v2
.line 315
.local v2, "widgetInfo":Landroid/util/Pair;, "Landroid/util/Pair<Ljava/lang/Integer;Landroid/appwidget/AppWidgetProviderInfo;>;"
if-eqz v2, :cond_2
.line 317
iget-object v4, p0, Lcom/android/systemui/recents/RecentsActivity;->mConfig:Lcom/android/systemui/recents/RecentsConfiguration;
iget-object v3, v2, Landroid/util/Pair;->first:Ljava/lang/Object;
check-cast v3, Ljava/lang/Integer;
invoke-virtual {v3}, Ljava/lang/Integer;->intValue()I
move-result v3
invoke-virtual {v4, p0, v3}, Lcom/android/systemui/recents/RecentsConfiguration;->updateSearchBarAppWidgetId(Landroid/content/Context;I)V
.line 318
iget-object v3, v2, Landroid/util/Pair;->second:Ljava/lang/Object;
check-cast v3, Landroid/appwidget/AppWidgetProviderInfo;
iput-object v3, p0, Lcom/android/systemui/recents/RecentsActivity;->mSearchAppWidgetInfo:Landroid/appwidget/AppWidgetProviderInfo;
.line 324
.end local v2 # "widgetInfo":Landroid/util/Pair;, "Landroid/util/Pair<Ljava/lang/Integer;Landroid/appwidget/AppWidgetProviderInfo;>;"
:cond_1
:goto_0
return-void
.line 320
.restart local v2 # "widgetInfo":Landroid/util/Pair;, "Landroid/util/Pair<Ljava/lang/Integer;Landroid/appwidget/AppWidgetProviderInfo;>;"
:cond_2
iget-object v3, p0, Lcom/android/systemui/recents/RecentsActivity;->mConfig:Lcom/android/systemui/recents/RecentsConfiguration;
const/4 v4, -0x1
invoke-virtual {v3, p0, v4}, Lcom/android/systemui/recents/RecentsConfiguration;->updateSearchBarAppWidgetId(Landroid/content/Context;I)V
goto :goto_0
.end method
find below method
Code:
.method public onAllTaskViewsDismissed()V
replace whole method with this
Code:
.method public onAllTaskViewsDismissed()V
.locals 1
.prologue
.line 663
iget-object v0, p0, Lcom/android/systemui/recents/RecentsActivity;->mFinishLaunchHomeRunnable:Lcom/android/systemui/recents/RecentsActivity$FinishRecentsRunnable;
invoke-virtual {v0}, Lcom/android/systemui/recents/RecentsActivity$FinishRecentsRunnable;->run()V
.line 664
iget-object v0, p0, Lcom/android/systemui/recents/RecentsActivity;->mRecentsView:Lcom/android/systemui/recents/views/RecentsView;
invoke-virtual {v0}, Lcom/android/systemui/recents/views/RecentsView;->endFABanimation()V
.line 665
return-void
.end method
find below method
Code:
.method public onBackPressed()V
replace whole method with this
Code:
.method public onBackPressed()V
.locals 1
.prologue
.line 598
iget-object v0, p0, Lcom/android/systemui/recents/RecentsActivity;->mConfig:Lcom/android/systemui/recents/RecentsConfiguration;
iget-boolean v0, v0, Lcom/android/systemui/recents/RecentsConfiguration;->debugModeEnabled:Z
if-eqz v0, :cond_0
.line 604
:goto_0
return-void
.line 601
:cond_0
const/4 v0, 0x1
invoke-virtual {p0, v0}, Lcom/android/systemui/recents/RecentsActivity;->dismissRecentsToFocusedTaskOrHome(Z)Z
.line 603
iget-object v0, p0, Lcom/android/systemui/recents/RecentsActivity;->mRecentsView:Lcom/android/systemui/recents/views/RecentsView;
invoke-virtual {v0}, Lcom/android/systemui/recents/views/RecentsView;->endFABanimation()V
goto :goto_0
.end method
find below method
Code:
.method public onEnterAnimationTriggered()V
replace whole method with this
Code:
.method public onEnterAnimationTriggered()V
.locals 1
.prologue
.line 633
iget-object v0, p0, Lcom/android/systemui/recents/RecentsActivity;->mScrimViews:Lcom/android/systemui/recents/views/SystemBarScrimViews;
invoke-virtual {v0}, Lcom/android/systemui/recents/views/SystemBarScrimViews;->startEnterRecentsAnimation()V
.line 634
iget-object v0, p0, Lcom/android/systemui/recents/RecentsActivity;->mRecentsView:Lcom/android/systemui/recents/views/RecentsView;
invoke-virtual {v0}, Lcom/android/systemui/recents/views/RecentsView;->startFABanimation()V
.line 635
return-void
.end method
find below method
Code:
.method public onExitToHomeAnimationTriggered()V
replace whole method with this
Code:
.method public onExitToHomeAnimationTriggered()V
.locals 1
.prologue
.line 642
iget-object v0, p0, Lcom/android/systemui/recents/RecentsActivity;->mScrimViews:Lcom/android/systemui/recents/views/SystemBarScrimViews;
invoke-virtual {v0}, Lcom/android/systemui/recents/views/SystemBarScrimViews;->startExitRecentsAnimation()V
.line 643
iget-object v0, p0, Lcom/android/systemui/recents/RecentsActivity;->mRecentsView:Lcom/android/systemui/recents/views/RecentsView;
invoke-virtual {v0}, Lcom/android/systemui/recents/views/RecentsView;->endFABanimation()V
.line 644
return-void
.end method
find below method
Code:
.method public onTaskLaunchFailed()V
replace whole method with this
Code:
.method public onTaskLaunchFailed()V
.locals 1
.prologue
.line 657
const/4 v0, 0x1
invoke-virtual {p0, v0}, Lcom/android/systemui/recents/RecentsActivity;->dismissRecentsToHomeRaw(Z)V
.line 658
iget-object v0, p0, Lcom/android/systemui/recents/RecentsActivity;->mRecentsView:Lcom/android/systemui/recents/views/RecentsView;
invoke-virtual {v0}, Lcom/android/systemui/recents/views/RecentsView;->endFABanimation()V
.line 659
return-void
.end method
find below method
Code:
.method public onTaskViewClicked()V
replace whole method with this
Code:
.method public onTaskViewClicked()V
.locals 1
.prologue
const/4 v0, 0x0
.line 649
invoke-static {v0}, Lcom/android/systemui/recents/AlternateRecentsComponent;->notifyVisibilityChanged(Z)V
.line 650
iput-boolean v0, p0, Lcom/android/systemui/recents/RecentsActivity;->mVisible:Z
.line 651
iget-object v0, p0, Lcom/android/systemui/recents/RecentsActivity;->mRecentsView:Lcom/android/systemui/recents/views/RecentsView;
invoke-virtual {v0}, Lcom/android/systemui/recents/views/RecentsView;->endFABanimation()V
.line 652
return-void
.end method
Continued in next post
Continued.
find below method
Code:
.method updateRecentsTasks(Landroid/content/Intent;)V
replace whole method with this
Code:
.method updateRecentsTasks(Landroid/content/Intent;)V
.locals 19
.param p1, "launchIntent" # Landroid/content/Intent;
.prologue
.line 189
const-string v16, "recents.triggeredOverSearchHome"
const/16 v17, 0x0
move-object/from16 v0, p1
move-object/from16 v1, v16
move/from16 v2, v17
invoke-virtual {v0, v1, v2}, Landroid/content/Intent;->getBooleanExtra(Ljava/lang/String;Z)Z
move-result v3
.line 191
.local v3, "fromSearchHome":Z
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/systemui/recents/RecentsActivity;->mConfig:Lcom/android/systemui/recents/RecentsConfiguration;
move-object/from16 v17, v0
if-nez v3, :cond_0
const-string v16, "recents.triggeredOverHome"
const/16 v18, 0x0
move-object/from16 v0, p1
move-object/from16 v1, v16
move/from16 v2, v18
invoke-virtual {v0, v1, v2}, Landroid/content/Intent;->getBooleanExtra(Ljava/lang/String;Z)Z
move-result v16
if-eqz v16, :cond_3
:cond_0
const/16 v16, 0x1
:goto_0
move/from16 v0, v16
move-object/from16 v1, v17
iput-boolean v0, v1, Lcom/android/systemui/recents/RecentsConfiguration;->launchedFromHome:Z
.line 193
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/systemui/recents/RecentsActivity;->mConfig:Lcom/android/systemui/recents/RecentsConfiguration;
move-object/from16 v16, v0
const-string v17, "recents.animatingWithThumbnail"
const/16 v18, 0x0
move-object/from16 v0, p1
move-object/from16 v1, v17
move/from16 v2, v18
invoke-virtual {v0, v1, v2}, Landroid/content/Intent;->getBooleanExtra(Ljava/lang/String;Z)Z
move-result v17
move/from16 v0, v17
move-object/from16 v1, v16
iput-boolean v0, v1, Lcom/android/systemui/recents/RecentsConfiguration;->launchedFromAppWithThumbnail:Z
.line 195
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/systemui/recents/RecentsActivity;->mConfig:Lcom/android/systemui/recents/RecentsConfiguration;
move-object/from16 v16, v0
const-string v17, "recents.thumbnail"
const/16 v18, 0x0
move-object/from16 v0, p1
move-object/from16 v1, v17
move/from16 v2, v18
invoke-virtual {v0, v1, v2}, Landroid/content/Intent;->getBooleanExtra(Ljava/lang/String;Z)Z
move-result v17
move/from16 v0, v17
move-object/from16 v1, v16
iput-boolean v0, v1, Lcom/android/systemui/recents/RecentsConfiguration;->launchedFromAppWithScreenshot:Z
.line 197
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/systemui/recents/RecentsActivity;->mConfig:Lcom/android/systemui/recents/RecentsConfiguration;
move-object/from16 v16, v0
const-string v17, "recents.activeTaskId"
const/16 v18, -0x1
move-object/from16 v0, p1
move-object/from16 v1, v17
move/from16 v2, v18
invoke-virtual {v0, v1, v2}, Landroid/content/Intent;->getIntExtra(Ljava/lang/String;I)I
move-result v17
move/from16 v0, v17
move-object/from16 v1, v16
iput v0, v1, Lcom/android/systemui/recents/RecentsConfiguration;->launchedToTaskId:I
.line 199
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/systemui/recents/RecentsActivity;->mConfig:Lcom/android/systemui/recents/RecentsConfiguration;
move-object/from16 v16, v0
const-string v17, "recents.triggeredFromAltTab"
const/16 v18, 0x0
move-object/from16 v0, p1
move-object/from16 v1, v17
move/from16 v2, v18
invoke-virtual {v0, v1, v2}, Landroid/content/Intent;->getBooleanExtra(Ljava/lang/String;Z)Z
move-result v17
move/from16 v0, v17
move-object/from16 v1, v16
iput-boolean v0, v1, Lcom/android/systemui/recents/RecentsConfiguration;->launchedWithAltTab:Z
.line 203
invoke-static {}, Lcom/android/systemui/recents/model/RecentsTaskLoader;->getInstance()Lcom/android/systemui/recents/model/RecentsTaskLoader;
move-result-object v7
.line 204
.local v7, "loader":Lcom/android/systemui/recents/model/RecentsTaskLoader;
const/16 v16, 0x6
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/systemui/recents/RecentsActivity;->mConfig:Lcom/android/systemui/recents/RecentsConfiguration;
move-object/from16 v17, v0
move-object/from16 v0, v17
iget-boolean v0, v0, Lcom/android/systemui/recents/RecentsConfiguration;->launchedFromHome:Z
move/from16 v17, v0
move-object/from16 v0, p0
move/from16 v1, v16
move/from16 v2, v17
invoke-virtual {v7, v0, v1, v2}, Lcom/android/systemui/recents/model/RecentsTaskLoader;->reload(Landroid/content/Context;IZ)Lcom/android/systemui/recents/model/SpaceNode;
move-result-object v9
.line 207
.local v9, "root":Lcom/android/systemui/recents/model/SpaceNode;
invoke-virtual {v9}, Lcom/android/systemui/recents/model/SpaceNode;->getStacks()Ljava/util/ArrayList;
move-result-object v11
.line 208
.local v11, "stacks":Ljava/util/ArrayList;, "Ljava/util/ArrayList<Lcom/android/systemui/recents/model/TaskStack;>;"
invoke-virtual {v11}, Ljava/util/ArrayList;->isEmpty()Z
move-result v16
if-nez v16, :cond_1
.line 209
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/systemui/recents/RecentsActivity;->mRecentsView:Lcom/android/systemui/recents/views/RecentsView;
move-object/from16 v16, v0
invoke-virtual {v9}, Lcom/android/systemui/recents/model/SpaceNode;->getStacks()Ljava/util/ArrayList;
move-result-object v17
invoke-virtual/range {v16 .. v17}, Lcom/android/systemui/recents/views/RecentsView;->setTaskStacks(Ljava/util/ArrayList;)V
.line 211
:cond_1
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/systemui/recents/RecentsActivity;->mConfig:Lcom/android/systemui/recents/RecentsConfiguration;
move-object/from16 v17, v0
invoke-virtual {v9}, Lcom/android/systemui/recents/model/SpaceNode;->hasTasks()Z
move-result v16
if-nez v16, :cond_4
const/16 v16, 0x1
:goto_1
move/from16 v0, v16
move-object/from16 v1, v17
iput-boolean v0, v1, Lcom/android/systemui/recents/RecentsConfiguration;->launchedWithNoRecentTasks:Z
.line 214
new-instance v4, Landroid/content/Intent;
const-string v16, "android.intent.action.MAIN"
const/16 v17, 0x0
move-object/from16 v0, v16
move-object/from16 v1, v17
invoke-direct {v4, v0, v1}, Landroid/content/Intent;-><init>(Ljava/lang/String;Landroid/net/Uri;)V
.line 215
.local v4, "homeIntent":Landroid/content/Intent;
const-string v16, "android.intent.category.HOME"
move-object/from16 v0, v16
invoke-virtual {v4, v0}, Landroid/content/Intent;->addCategory(Ljava/lang/String;)Landroid/content/Intent;
.line 216
const/high16 v16, 0x10200000
move/from16 v0, v16
invoke-virtual {v4, v0}, Landroid/content/Intent;->addFlags(I)Landroid/content/Intent;
.line 218
new-instance v18, Lcom/android/systemui/recents/RecentsActivity$FinishRecentsRunnable;
if-eqz v3, :cond_5
const v16, 0x7f05002e
move/from16 v17, v16
:goto_2
if-eqz v3, :cond_6
const v16, 0x7f05002f
:goto_3
move-object/from16 v0, p0
move/from16 v1, v17
move/from16 v2, v16
invoke-static {v0, v1, v2}, Landroid/app/ActivityOptions;->makeCustomAnimation(Landroid/content/Context;II)Landroid/app/ActivityOptions;
move-result-object v16
move-object/from16 v0, v18
move-object/from16 v1, p0
move-object/from16 v2, v16
invoke-direct {v0, v1, v4, v2}, Lcom/android/systemui/recents/RecentsActivity$FinishRecentsRunnable;-><init>(Lcom/android/systemui/recents/RecentsActivity;Landroid/content/Intent;Landroid/app/ActivityOptions;)V
move-object/from16 v0, v18
move-object/from16 v1, p0
iput-object v0, v1, Lcom/android/systemui/recents/RecentsActivity;->mFinishLaunchHomeRunnable:Lcom/android/systemui/recents/RecentsActivity$FinishRecentsRunnable;
.line 226
invoke-virtual {v11}, Ljava/util/ArrayList;->size()I
move-result v14
.line 227
.local v14, "taskStackCount":I
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/systemui/recents/RecentsActivity;->mConfig:Lcom/android/systemui/recents/RecentsConfiguration;
move-object/from16 v16, v0
move-object/from16 v0, v16
iget v0, v0, Lcom/android/systemui/recents/RecentsConfiguration;->launchedToTaskId:I
move/from16 v16, v0
const/16 v17, -0x1
move/from16 v0, v16
move/from16 v1, v17
if-eq v0, v1, :cond_8
.line 228
const/4 v5, 0x0
.local v5, "i":I
:goto_4
if-ge v5, v14, :cond_8
.line 229
invoke-virtual {v11, v5}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;
move-result-object v10
check-cast v10, Lcom/android/systemui/recents/model/TaskStack;
.line 230
.local v10, "stack":Lcom/android/systemui/recents/model/TaskStack;
invoke-virtual {v10}, Lcom/android/systemui/recents/model/TaskStack;->getTasks()Ljava/util/ArrayList;
move-result-object v15
.line 231
.local v15, "tasks":Ljava/util/ArrayList;, "Ljava/util/ArrayList<Lcom/android/systemui/recents/model/Task;>;"
invoke-virtual {v15}, Ljava/util/ArrayList;->size()I
move-result v13
.line 232
.local v13, "taskCount":I
const/4 v6, 0x0
.local v6, "j":I
:goto_5
if-ge v6, v13, :cond_2
.line 233
invoke-virtual {v15, v6}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;
move-result-object v12
check-cast v12, Lcom/android/systemui/recents/model/Task;
.line 234
.local v12, "t":Lcom/android/systemui/recents/model/Task;
iget-object v0, v12, Lcom/android/systemui/recents/model/Task;->key:Lcom/android/systemui/recents/model/Task$TaskKey;
move-object/from16 v16, v0
move-object/from16 v0, v16
iget v0, v0, Lcom/android/systemui/recents/model/Task$TaskKey;->id:I
move/from16 v16, v0
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/systemui/recents/RecentsActivity;->mConfig:Lcom/android/systemui/recents/RecentsConfiguration;
move-object/from16 v17, v0
move-object/from16 v0, v17
iget v0, v0, Lcom/android/systemui/recents/RecentsConfiguration;->launchedToTaskId:I
move/from16 v17, v0
move/from16 v0, v16
move/from16 v1, v17
if-ne v0, v1, :cond_7
.line 235
const/16 v16, 0x1
move/from16 v0, v16
iput-boolean v0, v12, Lcom/android/systemui/recents/model/Task;->isLaunchTarget:Z
.line 228
.end local v12 # "t":Lcom/android/systemui/recents/model/Task;
:cond_2
add-int/lit8 v5, v5, 0x1
goto :goto_4
.line 191
.end local v4 # "homeIntent":Landroid/content/Intent;
.end local v5 # "i":I
.end local v6 # "j":I
.end local v7 # "loader":Lcom/android/systemui/recents/model/RecentsTaskLoader;
.end local v9 # "root":Lcom/android/systemui/recents/model/SpaceNode;
.end local v10 # "stack":Lcom/android/systemui/recents/model/TaskStack;
.end local v11 # "stacks":Ljava/util/ArrayList;, "Ljava/util/ArrayList<Lcom/android/systemui/recents/model/TaskStack;>;"
.end local v13 # "taskCount":I
.end local v14 # "taskStackCount":I
.end local v15 # "tasks":Ljava/util/ArrayList;, "Ljava/util/ArrayList<Lcom/android/systemui/recents/model/Task;>;"
:cond_3
const/16 v16, 0x0
goto/16 :goto_0
.line 211
.restart local v7 # "loader":Lcom/android/systemui/recents/model/RecentsTaskLoader;
.restart local v9 # "root":Lcom/android/systemui/recents/model/SpaceNode;
.restart local v11 # "stacks":Ljava/util/ArrayList;, "Ljava/util/ArrayList<Lcom/android/systemui/recents/model/TaskStack;>;"
:cond_4
const/16 v16, 0x0
goto/16 :goto_1
.line 218
.restart local v4 # "homeIntent":Landroid/content/Intent;
:cond_5
const v16, 0x7f05002c
move/from16 v17, v16
goto/16 :goto_2
:cond_6
const v16, 0x7f05002d
goto/16 :goto_3
.line 232
.restart local v5 # "i":I
.restart local v6 # "j":I
.restart local v10 # "stack":Lcom/android/systemui/recents/model/TaskStack;
.restart local v12 # "t":Lcom/android/systemui/recents/model/Task;
.restart local v13 # "taskCount":I
.restart local v14 # "taskStackCount":I
.restart local v15 # "tasks":Ljava/util/ArrayList;, "Ljava/util/ArrayList<Lcom/android/systemui/recents/model/Task;>;"
:cond_7
add-int/lit8 v6, v6, 0x1
goto :goto_5
.line 243
.end local v5 # "i":I
.end local v6 # "j":I
.end local v10 # "stack":Lcom/android/systemui/recents/model/TaskStack;
.end local v12 # "t":Lcom/android/systemui/recents/model/Task;
.end local v13 # "taskCount":I
.end local v15 # "tasks":Ljava/util/ArrayList;, "Ljava/util/ArrayList<Lcom/android/systemui/recents/model/Task;>;"
:cond_8
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/systemui/recents/RecentsActivity;->mConfig:Lcom/android/systemui/recents/RecentsConfiguration;
move-object/from16 v16, v0
move-object/from16 v0, v16
iget-boolean v0, v0, Lcom/android/systemui/recents/RecentsConfiguration;->launchedWithNoRecentTasks:Z
move/from16 v16, v0
if-eqz v16, :cond_d
.line 244
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/systemui/recents/RecentsActivity;->mEmptyView:Landroid/view/View;
move-object/from16 v16, v0
if-nez v16, :cond_9
.line 245
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/systemui/recents/RecentsActivity;->mEmptyViewStub:Landroid/view/ViewStub;
move-object/from16 v16, v0
invoke-virtual/range {v16 .. v16}, Landroid/view/ViewStub;->inflate()Landroid/view/View;
move-result-object v16
move-object/from16 v0, v16
move-object/from16 v1, p0
iput-object v0, v1, Lcom/android/systemui/recents/RecentsActivity;->mEmptyView:Landroid/view/View;
.line 247
:cond_9
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/systemui/recents/RecentsActivity;->mEmptyView:Landroid/view/View;
move-object/from16 v16, v0
const/16 v17, 0x0
invoke-virtual/range {v16 .. v17}, Landroid/view/View;->setVisibility(I)V
.line 248
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/systemui/recents/RecentsActivity;->mRecentsView:Lcom/android/systemui/recents/views/RecentsView;
move-object/from16 v16, v0
const/16 v17, 0x8
invoke-virtual/range {v16 .. v17}, Lcom/android/systemui/recents/views/RecentsView;->setSearchBarVisibility(I)V
.line 249
const v16, 0x7f0e0170
move-object/from16 v0, p0
move/from16 v1, v16
invoke-virtual {v0, v1}, Lcom/android/systemui/recents/RecentsActivity;->findViewById(I)Landroid/view/View;
move-result-object v16
const/16 v17, 0x8
invoke-virtual/range {v16 .. v17}, Landroid/view/View;->setVisibility(I)V
.line 273
:cond_a
:goto_6
invoke-virtual/range {p0 .. p0}, Lcom/android/systemui/recents/RecentsActivity;->getResources()Landroid/content/res/Resources;
move-result-object v8
.line 275
.local v8, "reso":Landroid/content/res/Resources;
invoke-virtual/range {p0 .. p0}, Lcom/android/systemui/recents/RecentsActivity;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v16
const-string v17, "recents_show_hide_search_bar"
const/16 v18, 0x0
invoke-static/range {v16 .. v18}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v16
const/16 v17, 0x1
move/from16 v0, v16
move/from16 v1, v17
if-eq v0, v1, :cond_b
.line 277
const/16 v16, 0x0
sput v16, Lcom/android/systemui/recents/RecentsConfiguration;->searchBarSpaceHeightPx:I
.line 281
:cond_b
invoke-virtual/range {p0 .. p0}, Lcom/android/systemui/recents/RecentsActivity;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v16
const-string v17, "recents_show_hide_search_bar"
const/16 v18, 0x1
invoke-static/range {v16 .. v18}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v16
if-eqz v16, :cond_c
.line 283
const v16, 0x7f08006d
move/from16 v0, v16
invoke-virtual {v8, v0}, Landroid/content/res/Resources;->getDimensionPixelSize(I)I
move-result v16
sput v16, Lcom/android/systemui/recents/RecentsConfiguration;->searchBarSpaceHeightPx:I
.line 287
:cond_c
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/systemui/recents/RecentsActivity;->mScrimViews:Lcom/android/systemui/recents/views/SystemBarScrimViews;
move-object/from16 v16, v0
invoke-virtual/range {v16 .. v16}, Lcom/android/systemui/recents/views/SystemBarScrimViews;->prepareEnterRecentsAnimation()V
.line 288
return-void
.line 251
.end local v8 # "reso":Landroid/content/res/Resources;
:cond_d
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/systemui/recents/RecentsActivity;->mEmptyView:Landroid/view/View;
move-object/from16 v16, v0
if-eqz v16, :cond_e
.line 252
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/systemui/recents/RecentsActivity;->mEmptyView:Landroid/view/View;
move-object/from16 v16, v0
const/16 v17, 0x8
invoke-virtual/range {v16 .. v17}, Landroid/view/View;->setVisibility(I)V
.line 254
:cond_e
const v16, 0x7f0e0170
move-object/from16 v0, p0
move/from16 v1, v16
invoke-virtual {v0, v1}, Lcom/android/systemui/recents/RecentsActivity;->findViewById(I)Landroid/view/View;
move-result-object v16
const/16 v17, 0x0
invoke-virtual/range {v16 .. v17}, Landroid/view/View;->setVisibility(I)V
.line 255
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/systemui/recents/RecentsActivity;->mRecentsView:Lcom/android/systemui/recents/views/RecentsView;
move-object/from16 v16, v0
invoke-virtual/range {v16 .. v16}, Lcom/android/systemui/recents/views/RecentsView;->hasSearchBar()Z
move-result v16
if-eqz v16, :cond_10
.line 257
invoke-virtual/range {p0 .. p0}, Lcom/android/systemui/recents/RecentsActivity;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v16
const-string v17, "recents_show_hide_search_bar"
const/16 v18, 0x0
invoke-static/range {v16 .. v18}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v16
const/16 v17, 0x1
move/from16 v0, v16
move/from16 v1, v17
if-ne v0, v1, :cond_f
.line 259
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/systemui/recents/RecentsActivity;->mRecentsView:Lcom/android/systemui/recents/views/RecentsView;
move-object/from16 v16, v0
const/16 v17, 0x0
invoke-virtual/range {v16 .. v17}, Lcom/android/systemui/recents/views/RecentsView;->setSearchBarVisibility(I)V
goto/16 :goto_6
.line 261
:cond_f
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/systemui/recents/RecentsActivity;->mRecentsView:Lcom/android/systemui/recents/views/RecentsView;
move-object/from16 v16, v0
const/16 v17, 0x8
invoke-virtual/range {v16 .. v17}, Lcom/android/systemui/recents/views/RecentsView;->setSearchBarVisibility(I)V
goto/16 :goto_6
.line 264
:cond_10
invoke-virtual/range {p0 .. p0}, Lcom/android/systemui/recents/RecentsActivity;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v16
const-string v17, "recents_show_hide_search_bar"
const/16 v18, 0x0
invoke-static/range {v16 .. v18}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v16
const/16 v17, 0x1
move/from16 v0, v16
move/from16 v1, v17
if-ne v0, v1, :cond_a
.line 266
invoke-virtual/range {p0 .. p0}, Lcom/android/systemui/recents/RecentsActivity;->addSearchBarAppWidgetView()V
goto/16 :goto_6
.end method
Find and replace id's
0x7f05002e - <public type="anim" name="recents_to_search_launcher_enter"
0x7f05002f - <public type="anim" name="recents_to_search_launcher_exit"
0x7f05002c - <public type="anim" name="recents_to_launcher_enter"
0x7f05002d - <public type="anim" name="recents_to_launcher_exit"
0x7f0e0170 - <public type="id" name="gk_recents"
0x7f08006d - <public type="dimen" name="recents_search_bar_space_height"
0x7f0e0170 - <public type="id" name="gk_recents"
Click to expand...
Click to collapse
8.Open SystemUI\smali\com\android\systemui\recents\views\RecentsView.smali
find
Code:
.field mDebugOverlay:Lcom/android/systemui/recents/views/DebugOverlayView;
below add a new field
Code:
.field mFloatingButton:Landroid/view/View;
find below method
Code:
.method public dismissFocusedTask()V
below add a new method
Code:
.method public endFABanimation()V
.locals 4
.prologue
.line 360
invoke-virtual {p0}, Lcom/android/systemui/recents/views/RecentsView;->getParent()Landroid/view/ViewParent;
move-result-object v0
check-cast v0, Landroid/view/View;
const v1, 0x7f0e0170
invoke-virtual {v0, v1}, Landroid/view/View;->findViewById(I)Landroid/view/View;
move-result-object v0
iput-object v0, p0, Lcom/android/systemui/recents/views/RecentsView;->mFloatingButton:Landroid/view/View;
.line 361
iget-object v0, p0, Lcom/android/systemui/recents/views/RecentsView;->mFloatingButton:Landroid/view/View;
invoke-virtual {v0}, Landroid/view/View;->animate()Landroid/view/ViewPropertyAnimator;
move-result-object v0
const/4 v1, 0x0
invoke-virtual {v0, v1}, Landroid/view/ViewPropertyAnimator;->alpha(F)Landroid/view/ViewPropertyAnimator;
move-result-object v0
const-wide/16 v2, 0x0
invoke-virtual {v0, v2, v3}, Landroid/view/ViewPropertyAnimator;->setStartDelay(J)Landroid/view/ViewPropertyAnimator;
move-result-object v0
iget-object v1, p0, Lcom/android/systemui/recents/views/RecentsView;->mConfig:Lcom/android/systemui/recents/RecentsConfiguration;
iget v1, v1, Lcom/android/systemui/recents/RecentsConfiguration;->taskBarExitAnimDuration:I
int-to-long v2, v1
invoke-virtual {v0, v2, v3}, Landroid/view/ViewPropertyAnimator;->setDuration(J)Landroid/view/ViewPropertyAnimator;
move-result-object v0
iget-object v1, p0, Lcom/android/systemui/recents/views/RecentsView;->mConfig:Lcom/android/systemui/recents/RecentsConfiguration;
iget-object v1, v1, Lcom/android/systemui/recents/RecentsConfiguration;->fastOutLinearInInterpolator:Landroid/view/animation/Interpolator;
invoke-virtual {v0, v1}, Landroid/view/ViewPropertyAnimator;->setInterpolator(Landroid/animation/TimeInterpolator;)Landroid/view/ViewPropertyAnimator;
move-result-object v0
invoke-virtual {v0}, Landroid/view/ViewPropertyAnimator;->withLayer()Landroid/view/ViewPropertyAnimator;
move-result-object v0
invoke-virtual {v0}, Landroid/view/ViewPropertyAnimator;->start()V
.line 367
return-void
.end method
find and replace id
0x7f0e0170 - <public type="id" name="gk_recents"
Click to expand...
Click to collapse
find
Code:
.method protected onAttachedToWindow()V
replace whole method with this
Code:
.method protected onAttachedToWindow()V
.locals 2
.prologue
.line 371
invoke-super {p0}, Landroid/widget/FrameLayout;->onAttachedToWindow()V
.line 372
invoke-virtual {p0}, Lcom/android/systemui/recents/views/RecentsView;->getParent()Landroid/view/ViewParent;
move-result-object v0
check-cast v0, Landroid/view/View;
const v1, 0x7f0e0170
invoke-virtual {v0, v1}, Landroid/view/View;->findViewById(I)Landroid/view/View;
move-result-object v0
iput-object v0, p0, Lcom/android/systemui/recents/views/RecentsView;->mFloatingButton:Landroid/view/View;
.line 373
invoke-virtual {p0}, Lcom/android/systemui/recents/views/RecentsView;->getParent()Landroid/view/ViewParent;
move-result-object v0
check-cast v0, Landroid/view/View;
const v1, 0x7f0e0115
invoke-virtual {v0, v1}, Landroid/view/View;->findViewById(I)Landroid/view/View;
move-result-object v0
iput-object v0, p0, Lcom/android/systemui/recents/views/RecentsView;->mClearRecents:Landroid/view/View;
.line 374
iget-object v0, p0, Lcom/android/systemui/recents/views/RecentsView;->mClearRecents:Landroid/view/View;
new-instance v1, Lcom/android/systemui/recents/views/RecentsView$1;
invoke-direct {v1, p0}, Lcom/android/systemui/recents/views/RecentsView$1;-><init>(Lcom/android/systemui/recents/views/RecentsView;)V
invoke-virtual {v0, v1}, Landroid/view/View;->setOnClickListener(Landroid/view/View$OnClickListener;)V
.line 379
return-void
.end method
find and replace id's
0x7f0e0170 - <public type="id" name="gk_recents"
0x7f0e0115 - <public type="id" name="clear_recents"
Click to expand...
Click to collapse
continued on next page
Continued.
find
Code:
.method protected onMeasure(II)V
replace whole method with this
Code:
.method protected onMeasure(II)V
.locals 17
.param p1, "widthMeasureSpec" # I
.param p2, "heightMeasureSpec" # I
.prologue
.line 274
invoke-static/range {p1 .. p1}, Landroid/view/View$MeasureSpec;->getSize(I)I
move-result v3
.line 275
.local v3, "width":I
invoke-static/range {p2 .. p2}, Landroid/view/View$MeasureSpec;->getSize(I)I
move-result v4
.line 278
.local v4, "height":I
move-object/from16 v0, p0
iget-object v2, v0, Lcom/android/systemui/recents/views/RecentsView;->mSearchBar:Landroid/view/View;
if-eqz v2, :cond_0
.line 279
new-instance v13, Landroid/graphics/Rect;
invoke-direct {v13}, Landroid/graphics/Rect;-><init>()V
.line 280
.local v13, "searchBarSpaceBounds":Landroid/graphics/Rect;
move-object/from16 v0, p0
iget-object v2, v0, Lcom/android/systemui/recents/views/RecentsView;->mConfig:Lcom/android/systemui/recents/RecentsConfiguration;
move-object/from16 v0, p0
iget-object v5, v0, Lcom/android/systemui/recents/views/RecentsView;->mConfig:Lcom/android/systemui/recents/RecentsConfiguration;
iget-object v5, v5, Lcom/android/systemui/recents/RecentsConfiguration;->systemInsets:Landroid/graphics/Rect;
iget v5, v5, Landroid/graphics/Rect;->top:I
invoke-virtual {v2, v3, v4, v5, v13}, Lcom/android/systemui/recents/RecentsConfiguration;->getSearchBarBounds(IIILandroid/graphics/Rect;)V
.line 281
move-object/from16 v0, p0
iget-object v2, v0, Lcom/android/systemui/recents/views/RecentsView;->mSearchBar:Landroid/view/View;
invoke-virtual {v13}, Landroid/graphics/Rect;->width()I
move-result v5
const/high16 v6, 0x40000000
invoke-static {v5, v6}, Landroid/view/View$MeasureSpec;->makeMeasureSpec(II)I
move-result v5
invoke-virtual {v13}, Landroid/graphics/Rect;->height()I
move-result v6
const/high16 v16, 0x40000000
move/from16 v0, v16
invoke-static {v6, v0}, Landroid/view/View$MeasureSpec;->makeMeasureSpec(II)I
move-result v6
invoke-virtual {v2, v5, v6}, Landroid/view/View;->measure(II)V
.line 286
.end local v13 # "searchBarSpaceBounds":Landroid/graphics/Rect;
:cond_0
move-object/from16 v0, p0
iget-object v2, v0, Lcom/android/systemui/recents/views/RecentsView;->mContext:Landroid/content/Context;
invoke-virtual {v2}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v2
const-string v5, "show_clear_all_recents"
const/4 v6, 0x1
invoke-static {v2, v5, v6}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v2
const/4 v5, 0x1
if-ne v2, v5, :cond_2
const/4 v14, 0x1
.line 289
.local v14, "showClearAllRecents":Z
:goto_0
new-instance v7, Landroid/graphics/Rect;
invoke-direct {v7}, Landroid/graphics/Rect;-><init>()V
.line 290
.local v7, "taskStackBounds":Landroid/graphics/Rect;
move-object/from16 v0, p0
iget-object v2, v0, Lcom/android/systemui/recents/views/RecentsView;->mConfig:Lcom/android/systemui/recents/RecentsConfiguration;
move-object/from16 v0, p0
iget-object v5, v0, Lcom/android/systemui/recents/views/RecentsView;->mConfig:Lcom/android/systemui/recents/RecentsConfiguration;
iget-object v5, v5, Lcom/android/systemui/recents/RecentsConfiguration;->systemInsets:Landroid/graphics/Rect;
iget v5, v5, Landroid/graphics/Rect;->top:I
move-object/from16 v0, p0
iget-object v6, v0, Lcom/android/systemui/recents/views/RecentsView;->mConfig:Lcom/android/systemui/recents/RecentsConfiguration;
iget-object v6, v6, Lcom/android/systemui/recents/RecentsConfiguration;->systemInsets:Landroid/graphics/Rect;
iget v6, v6, Landroid/graphics/Rect;->right:I
invoke-virtual/range {v2 .. v7}, Lcom/android/systemui/recents/RecentsConfiguration;->getTaskStackBounds(IIIILandroid/graphics/Rect;)V
.line 293
move-object/from16 v0, p0
iget-object v2, v0, Lcom/android/systemui/recents/views/RecentsView;->mFloatingButton:Landroid/view/View;
if-eqz v2, :cond_3
if-eqz v14, :cond_3
.line 294
move-object/from16 v0, p0
iget-object v2, v0, Lcom/android/systemui/recents/views/RecentsView;->mContext:Landroid/content/Context;
invoke-virtual {v2}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v2
const-string v5, "recents_clear_all_location"
const/4 v6, 0x3
invoke-static {v2, v5, v6}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v10
.line 296
.local v10, "clearRecentsLocation":I
move-object/from16 v0, p0
iget-object v2, v0, Lcom/android/systemui/recents/views/RecentsView;->mFloatingButton:Landroid/view/View;
invoke-virtual {v2}, Landroid/view/View;->getLayoutParams()Landroid/view/ViewGroup$LayoutParams;
move-result-object v12
check-cast v12, Landroid/widget/FrameLayout$LayoutParams;
.line 298
.local v12, "params":Landroid/widget/FrameLayout$LayoutParams;
iget v2, v7, Landroid/graphics/Rect;->top:I
iput v2, v12, Landroid/widget/FrameLayout$LayoutParams;->topMargin:I
.line 299
packed-switch v10, :pswitch_data_0
.line 305
const/16 v2, 0x35
iput v2, v12, Landroid/widget/FrameLayout$LayoutParams;->gravity:I
.line 320
:goto_1
move-object/from16 v0, p0
iget-object v2, v0, Lcom/android/systemui/recents/views/RecentsView;->mFloatingButton:Landroid/view/View;
invoke-virtual {v2, v12}, Landroid/view/View;->setLayoutParams(Landroid/view/ViewGroup$LayoutParams;)V
.line 327
.end local v10 # "clearRecentsLocation":I
.end local v12 # "params":Landroid/widget/FrameLayout$LayoutParams;
:goto_2
invoke-virtual/range {p0 .. p0}, Lcom/android/systemui/recents/views/RecentsView;->getChildCount()I
move-result v9
.line 328
.local v9, "childCount":I
const/4 v11, 0x0
.local v11, "i":I
:goto_3
if-ge v11, v9, :cond_4
.line 329
move-object/from16 v0, p0
invoke-virtual {v0, v11}, Lcom/android/systemui/recents/views/RecentsView;->getChildAt(I)Landroid/view/View;
move-result-object v8
.line 330
.local v8, "child":Landroid/view/View;
move-object/from16 v0, p0
iget-object v2, v0, Lcom/android/systemui/recents/views/RecentsView;->mSearchBar:Landroid/view/View;
if-eq v8, v2, :cond_1
invoke-virtual {v8}, Landroid/view/View;->getVisibility()I
move-result v2
const/16 v5, 0x8
if-eq v2, v5, :cond_1
move-object v15, v8
.line 331
check-cast v15, Lcom/android/systemui/recents/views/TaskStackView;
.line 333
.local v15, "tsv":Lcom/android/systemui/recents/views/TaskStackView;
invoke-virtual {v15, v7}, Lcom/android/systemui/recents/views/TaskStackView;->setStackInsetRect(Landroid/graphics/Rect;)V
.line 334
move/from16 v0, p1
move/from16 v1, p2
invoke-virtual {v15, v0, v1}, Lcom/android/systemui/recents/views/TaskStackView;->measure(II)V
.line 328
.end local v15 # "tsv":Lcom/android/systemui/recents/views/TaskStackView;
:cond_1
add-int/lit8 v11, v11, 0x1
goto :goto_3
.line 286
.end local v7 # "taskStackBounds":Landroid/graphics/Rect;
.end local v8 # "child":Landroid/view/View;
.end local v9 # "childCount":I
.end local v11 # "i":I
.end local v14 # "showClearAllRecents":Z
:cond_2
const/4 v14, 0x0
goto :goto_0
.line 301
.restart local v7 # "taskStackBounds":Landroid/graphics/Rect;
.restart local v10 # "clearRecentsLocation":I
.restart local v12 # "params":Landroid/widget/FrameLayout$LayoutParams;
.restart local v14 # "showClearAllRecents":Z
:pswitch_0
const/16 v2, 0x33
iput v2, v12, Landroid/widget/FrameLayout$LayoutParams;->gravity:I
goto :goto_1
.line 308
:pswitch_1
const/16 v2, 0x31
iput v2, v12, Landroid/widget/FrameLayout$LayoutParams;->gravity:I
goto :goto_1
.line 311
:pswitch_2
const/16 v2, 0x53
iput v2, v12, Landroid/widget/FrameLayout$LayoutParams;->gravity:I
goto :goto_1
.line 314
:pswitch_3
const/16 v2, 0x55
iput v2, v12, Landroid/widget/FrameLayout$LayoutParams;->gravity:I
goto :goto_1
.line 317
:pswitch_4
const/16 v2, 0x51
iput v2, v12, Landroid/widget/FrameLayout$LayoutParams;->gravity:I
goto :goto_1
.line 322
.end local v10 # "clearRecentsLocation":I
.end local v12 # "params":Landroid/widget/FrameLayout$LayoutParams;
:cond_3
move-object/from16 v0, p0
iget-object v2, v0, Lcom/android/systemui/recents/views/RecentsView;->mFloatingButton:Landroid/view/View;
const/16 v5, 0x8
invoke-virtual {v2, v5}, Landroid/view/View;->setVisibility(I)V
goto :goto_2
.line 338
.restart local v9 # "childCount":I
.restart local v11 # "i":I
:cond_4
move-object/from16 v0, p0
invoke-virtual {v0, v3, v4}, Lcom/android/systemui/recents/views/RecentsView;->setMeasuredDimension(II)V
.line 339
return-void
.line 299
nop
:pswitch_data_0
.packed-switch 0x1
:pswitch_0
:pswitch_1
:pswitch_3
:pswitch_2
:pswitch_4
.end packed-switch
.end method
find below method
Code:
.method public unfilterFilteredStacks()Z
add this on above of previous methos
Code:
.method public startFABanimation()V
.locals 4
.prologue
.line 349
invoke-virtual {p0}, Lcom/android/systemui/recents/views/RecentsView;->getParent()Landroid/view/ViewParent;
move-result-object v0
check-cast v0, Landroid/view/View;
const v1, 0x7f0e0170
invoke-virtual {v0, v1}, Landroid/view/View;->findViewById(I)Landroid/view/View;
move-result-object v0
iput-object v0, p0, Lcom/android/systemui/recents/views/RecentsView;->mFloatingButton:Landroid/view/View;
.line 350
iget-object v0, p0, Lcom/android/systemui/recents/views/RecentsView;->mFloatingButton:Landroid/view/View;
invoke-virtual {v0}, Landroid/view/View;->animate()Landroid/view/ViewPropertyAnimator;
move-result-object v0
const/high16 v1, 0x3f800000
invoke-virtual {v0, v1}, Landroid/view/ViewPropertyAnimator;->alpha(F)Landroid/view/ViewPropertyAnimator;
move-result-object v0
iget-object v1, p0, Lcom/android/systemui/recents/views/RecentsView;->mConfig:Lcom/android/systemui/recents/RecentsConfiguration;
iget v1, v1, Lcom/android/systemui/recents/RecentsConfiguration;->taskBarEnterAnimDelay:I
int-to-long v2, v1
invoke-virtual {v0, v2, v3}, Landroid/view/ViewPropertyAnimator;->setStartDelay(J)Landroid/view/ViewPropertyAnimator;
move-result-object v0
iget-object v1, p0, Lcom/android/systemui/recents/views/RecentsView;->mConfig:Lcom/android/systemui/recents/RecentsConfiguration;
iget v1, v1, Lcom/android/systemui/recents/RecentsConfiguration;->taskBarEnterAnimDuration:I
int-to-long v2, v1
invoke-virtual {v0, v2, v3}, Landroid/view/ViewPropertyAnimator;->setDuration(J)Landroid/view/ViewPropertyAnimator;
move-result-object v0
iget-object v1, p0, Lcom/android/systemui/recents/views/RecentsView;->mConfig:Lcom/android/systemui/recents/RecentsConfiguration;
iget-object v1, v1, Lcom/android/systemui/recents/RecentsConfiguration;->fastOutLinearInInterpolator:Landroid/view/animation/Interpolator;
invoke-virtual {v0, v1}, Landroid/view/ViewPropertyAnimator;->setInterpolator(Landroid/animation/TimeInterpolator;)Landroid/view/ViewPropertyAnimator;
move-result-object v0
invoke-virtual {v0}, Landroid/view/ViewPropertyAnimator;->withLayer()Landroid/view/ViewPropertyAnimator;
move-result-object v0
invoke-virtual {v0}, Landroid/view/ViewPropertyAnimator;->start()V
.line 356
return-void
.end method
find and replace id's
0x7f0e0170 - <public type="id" name="gk_recents"
Click to expand...
Click to collapse
9.Open SystemUI\smali\com\android\systemui\recents\views\TaskStackView.smali
find
Code:
.method private updateStackTransforms(Ljava/util/ArrayList;Ljava/util/ArrayList;F[IZ)Z
add this on above of previous method
Code:
.method static synthetic access$000(Lcom/android/systemui/recents/views/TaskStackView;)Z
.locals 1
.param p0, "x0" # Lcom/android/systemui/recents/views/TaskStackView;
.prologue
.line 57
invoke-direct {p0}, Lcom/android/systemui/recents/views/TaskStackView;->dismissAll()Z
move-result v0
return v0
.end method
.method static synthetic access$102(Lcom/android/systemui/recents/views/TaskStackView;Landroid/widget/PopupMenu;)Landroid/widget/PopupMenu;
.locals 0
.param p0, "x0" # Lcom/android/systemui/recents/views/TaskStackView;
.param p1, "x1" # Landroid/widget/PopupMenu;
.prologue
.line 57
iput-object p1, p0, Lcom/android/systemui/recents/views/TaskStackView;->mPopup:Landroid/widget/PopupMenu;
return-object p1
.end method
.method private dismissAll()Z
.locals 3
.prologue
const/4 v0, 0x1
.line 495
iget-object v1, p0, Lcom/android/systemui/recents/views/TaskStackView;->mContext:Landroid/content/Context;
invoke-virtual {v1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v1
const-string v2, "recents_clear_all_dismiss_all"
invoke-static {v1, v2, v0}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v1
if-ne v1, v0, :cond_0
:goto_0
return v0
:cond_0
const/4 v0, 0x0
goto :goto_0
.end method
10.Open SystemUI\smali\com\android\systemui\recents\RecentsConfiguration.smali
find
Code:
.field static sPrevConfigurationHashCode:I
below add this code
Code:
.field public static searchBarSpaceHeightPx:I
find and remove below code
Code:
.field public searchBarSpaceHeightPx:I
find below method
Code:
.method public getSearchBarBounds(IIILandroid/graphics/Rect;)V
in the same method find below line
Code:
iget v0, p0, Lcom/android/systemui/recents/RecentsConfiguration;->searchBarSpaceHeightPx:I
replace the line with below code
Code:
sget v0, Lcom/android/systemui/recents/RecentsConfiguration;->searchBarSpaceHeightPx:I
find
Code:
.method update (Landroid / content / Context;) V
in the same method find and remove the below code
Code:
.line 201
const v7, 0x7f080064
invoke-virtual {v2, v7}, Landroid/content/res/Resources;->getDimensionPixelSize(I)I
move-result v7
iput v7, p0, Lcom/android/systemui/recents/RecentsConfiguration;->searchBarSpaceHeightPx:I
0x7f080064 - <public type="dimen" name="recents_search_bar_space_height"
Click to expand...
Click to collapse
11.Decompile SystemUI and move to your device
Abdullaharis said:
Hello guys
Here is a new guide on setting up the recents.
Credit:-
KachalkinGeorg (The GK)
Requirements (deodexed):-
1.Settings.apk
2.SystemUI.apk
3.NotePad++
4.Patience.. if you dont have try to get it
Click to expand...
Click to collapse
Can anyone get this in a module for the Xposed Installer ???
guillermorojaz said:
Can anyone get this in a module for the Xposed Installer ???
Click to expand...
Click to collapse
Editting Manually is Best i think.
Abdullaharis said:
Editting Manually is Best i think.
Click to expand...
Click to collapse
Thank you for prompt reply.
Unfortunately I do not have that knowledge :crying:
Can you help me
If I send the Settings.apk and the SystemUI.apk from my ROM you could help me?
Thank you in advance.
EDIT AND AGREEMENT.
Actually what I want is the button to clean recent apps all along the bottom of the screen, as shown in the image I attached
Unfortunately I do not have that knowledge :crying:
Can you help me
If I send the Settings.apk and the SystemUI.apk from my ROM you could help me?
Click to expand...
Click to collapse
ok, just send the files i will try
Today again a new mod ( i got this mod from 4pda forum )
this guide will help you to make your notification animated
Credit:-
KachalkinGeorg (The GK)
Requirement (deodexed):-
1.Settings.apk
2.Telecom.apk
3.TeleService.apk
4.Mms.apk
5.NotePad++
6.Patience.. if you dont have try to get it
First part ( Settings.apk )
1.Decompile Settings.apk
2.Download breathingsettings.zip from attachment. Extract and copy files to decompiled Settings
3.Open Settings\res\xml\display.xml and add the below code
Code:
<PreferenceScreen android:title="@string/gk_breathing_notifications" android:key="breathing_notifications" android:fragment="com.android.settings.gk.BreathingNotifications.BreathingNotifications" />
4.Open Settings\res\values\strings.xml and add below code
Code:
<string name="gk_breathing_notifications">Breathing notifications</string>
<string name="gk_sms_breath_title">Breathing SMS</string>
<string name="gk_sms_breath_summary">Will give your sms notifications a breathing effect in the statusbar</string>
<string name="gk_missed_call_breath_title">Breathing Missed Call</string>
<string name="gk_missed_call_breath_summary">Will give your missed call notifications a breathing effect in the statusbar</string>
<string name="gk_voicemail_breath_title">Breathing Voicemail</string>
<string name="gk_voicemail_breath_summary">Will give your voicemail notifications a breathing effect in the statusbar</string>
5.Recompile and Decompile Settings (For id's)
6.Open Settings\smali\com\android\settings\gk\BreathingNotifications\BreathingNotifications.smali
find
Code:
0x7f060018
replace with below id
Code:
<public type="xml" name="gk_breathing_notifications"
7.Compile Settings and move to your device
Continued next post
Continued.
Second part ( Telecom.apk )
1.Decompile Telecom.apk
2.Download breathingtelecom.zip from attachment. Extract and copy files to your decompiled Telecom
3.Now Recompile and Decompile Telecom (For id's)
4.Open Telecom\smali\com\android\server\telecom\MissedCallNotifier.smali
find and remove below annotations
Code:
# annotations
.annotation system Ldalvik/annotation/MemberClasses;
value = {
Lcom/android/server/telecom/MissedCallNotifier$MissedCallInfo;
}
.end annotation
find and remove below field
Code:
.field private static final TIME_SPAN:Landroid/text/style/RelativeSizeSpan;
find below field
Code:
.field private mMissedCalls:Ljava/util/ArrayList;
.annotation system Ldalvik/annotation/Signature;
value = {
"Ljava/util/ArrayList",
"<",
"Lcom/android/server/telecom/MissedCallNotifier$MissedCallInfo;",
">;"
}
replace with this field
Code:
.field private mMissedCallCount:I
find below method
Code:
.method static constructor <clinit>()V
in the same method find and remove below lines
Code:
.line 233
new-instance v0, Landroid/text/style/RelativeSizeSpan;
const v1, 0x3f333333 # 0.7f
invoke-direct {v0, v1}, Landroid/text/style/RelativeSizeSpan;-><init>(F)V
sput-object v0, Lcom/android/server/telecom/MissedCallNotifier;->TIME_SPAN:Landroid/text/style/RelativeSizeSpan;
find
Code:
.method constructor <init>(Landroid/content/Context;)V
replace whole method with this
Code:
.method constructor <init>(Landroid/content/Context;)V
.locals 2
.prologue
.line 82
invoke-direct {p0}, Lcom/android/server/telecom/CallsManagerListenerBase;-><init>()V
.line 80
const/4 v0, 0x0
iput v0, p0, Lcom/android/server/telecom/MissedCallNotifier;->mMissedCallCount:I
.line 83
iput-object p1, p0, Lcom/android/server/telecom/MissedCallNotifier;->mContext:Landroid/content/Context;
.line 84
iget-object v0, p0, Lcom/android/server/telecom/MissedCallNotifier;->mContext:Landroid/content/Context;
const-string v1, "notification"
invoke-virtual {v0, v1}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
move-result-object v0
check-cast v0, Landroid/app/NotificationManager;
iput-object v0, p0, Lcom/android/server/telecom/MissedCallNotifier;->mNotificationManager:Landroid/app/NotificationManager;
.line 87
invoke-direct {p0}, Lcom/android/server/telecom/MissedCallNotifier;->updateOnStartup()V
.line 88
return-void
.end method
find
Code:
.method private cancelMissedCallNotification()V
replace whole method with this
Code:
.method private cancelMissedCallNotification()V
.locals 2
.prologue
.line 209
const/4 v0, 0x0
iput v0, p0, Lcom/android/server/telecom/MissedCallNotifier;->mMissedCallCount:I
.line 210
iget-object v0, p0, Lcom/android/server/telecom/MissedCallNotifier;->mNotificationManager:Landroid/app/NotificationManager;
const/4 v1, 0x1
invoke-virtual {v0, v1}, Landroid/app/NotificationManager;->cancel(I)V
.line 211
return-void
.end method
find and remove whole method
.method private formatSingleCallLine(Ljava/lang/String;J)Ljava/lang/CharSequence;
Click to expand...
Click to collapse
find
Code:
.method showMissedCallNotification(Lcom/android/server/telecom/Call;)V
replace whole method with this
Code:
.method showMissedCallNotification(Lcom/android/server/telecom/Call;)V
.locals 10
.prologue
const/4 v2, 0x0
const/high16 v6, 0x7f060000
const/4 v9, 0x0
const/4 v8, 0x1
.line 126
iget v0, p0, Lcom/android/server/telecom/MissedCallNotifier;->mMissedCallCount:I
add-int/lit8 v0, v0, 0x1
iput v0, p0, Lcom/android/server/telecom/MissedCallNotifier;->mMissedCallCount:I
.line 134
iget v0, p0, Lcom/android/server/telecom/MissedCallNotifier;->mMissedCallCount:I
if-ne v0, v8, :cond_2
.line 135
const v1, 0x7f050015
.line 136
invoke-direct {p0, p1}, Lcom/android/server/telecom/MissedCallNotifier;->getNameForCall(Lcom/android/server/telecom/Call;)Ljava/lang/String;
move-result-object v0
.line 144
:goto_0
new-instance v3, Landroid/app/Notification$Builder;
iget-object v4, p0, Lcom/android/server/telecom/MissedCallNotifier;->mContext:Landroid/content/Context;
invoke-direct {v3, v4}, Landroid/app/Notification$Builder;-><init>(Landroid/content/Context;)V
.line 145
iget-object v4, p0, Lcom/android/server/telecom/MissedCallNotifier;->mContext:Landroid/content/Context;
invoke-virtual {v4}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v4
const-string v5, "gk_missed_call_breath"
invoke-static {v4, v5, v9}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v4
if-ne v4, v8, :cond_3
.line 147
const v4, 0x7f02001f
invoke-virtual {v3, v4}, Landroid/app/Notification$Builder;->setSmallIcon(I)Landroid/app/Notification$Builder;
move-result-object v4
iget-object v5, p0, Lcom/android/server/telecom/MissedCallNotifier;->mContext:Landroid/content/Context;
invoke-virtual {v5}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
move-result-object v5
invoke-virtual {v5, v6}, Landroid/content/res/Resources;->getColor(I)I
move-result v5
invoke-virtual {v4, v5}, Landroid/app/Notification$Builder;->setColor(I)Landroid/app/Notification$Builder;
move-result-object v4
invoke-virtual {p1}, Lcom/android/server/telecom/Call;->getCreationTimeMillis()J
move-result-wide v6
invoke-virtual {v4, v6, v7}, Landroid/app/Notification$Builder;->setWhen(J)Landroid/app/Notification$Builder;
move-result-object v4
iget-object v5, p0, Lcom/android/server/telecom/MissedCallNotifier;->mContext:Landroid/content/Context;
invoke-virtual {v5, v1}, Landroid/content/Context;->getText(I)Ljava/lang/CharSequence;
move-result-object v1
invoke-virtual {v4, v1}, Landroid/app/Notification$Builder;->setContentTitle(Ljava/lang/CharSequence;)Landroid/app/Notification$Builder;
move-result-object v1
invoke-virtual {v1, v0}, Landroid/app/Notification$Builder;->setContentText(Ljava/lang/CharSequence;)Landroid/app/Notification$Builder;
move-result-object v0
invoke-direct {p0}, Lcom/android/server/telecom/MissedCallNotifier;->createCallLogPendingIntent()Landroid/app/PendingIntent;
move-result-object v1
invoke-virtual {v0, v1}, Landroid/app/Notification$Builder;->setContentIntent(Landroid/app/PendingIntent;)Landroid/app/Notification$Builder;
move-result-object v0
invoke-virtual {v0, v8}, Landroid/app/Notification$Builder;->setAutoCancel(Z)Landroid/app/Notification$Builder;
move-result-object v0
invoke-direct {p0}, Lcom/android/server/telecom/MissedCallNotifier;->createClearMissedCallsPendingIntent()Landroid/app/PendingIntent;
move-result-object v1
invoke-virtual {v0, v1}, Landroid/app/Notification$Builder;->setDeleteIntent(Landroid/app/PendingIntent;)Landroid/app/Notification$Builder;
.line 166
:goto_1
invoke-virtual {p1}, Lcom/android/server/telecom/Call;->getHandle()Landroid/net/Uri;
move-result-object v1
.line 167
if-nez v1, :cond_4
move-object v0, v2
.line 170
:goto_2
iget v4, p0, Lcom/android/server/telecom/MissedCallNotifier;->mMissedCallCount:I
if-ne v4, v8, :cond_6
.line 171
const-string v4, "Add actions with number %s."
new-array v5, v8, [Ljava/lang/Object;
invoke-static {v0}, Lcom/android/server/telecom/Log;->piiHandle(Ljava/lang/Object;)Ljava/lang/String;
move-result-object v6
aput-object v6, v5, v9
invoke-static {p0, v4, v5}, Lcom/android/server/telecom/Log;->d(Ljava/lang/Object;Ljava/lang/String;[Ljava/lang/Object;)V
.line 173
invoke-static {v0}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z
move-result v4
if-nez v4, :cond_0
iget-object v4, p0, Lcom/android/server/telecom/MissedCallNotifier;->mContext:Landroid/content/Context;
const v5, 0x7f050034
invoke-virtual {v4, v5}, Landroid/content/Context;->getString(I)Ljava/lang/String;
move-result-object v4
invoke-static {v0, v4}, Landroid/text/TextUtils;->equals(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Z
move-result v0
if-nez v0, :cond_0
.line 175
const v0, 0x7f020020
iget-object v4, p0, Lcom/android/server/telecom/MissedCallNotifier;->mContext:Landroid/content/Context;
const v5, 0x7f050019
invoke-virtual {v4, v5}, Landroid/content/Context;->getString(I)Ljava/lang/String;
move-result-object v4
invoke-direct {p0, v1}, Lcom/android/server/telecom/MissedCallNotifier;->createCallBackPendingIntent(Landroid/net/Uri;)Landroid/app/PendingIntent;
move-result-object v5
invoke-virtual {v3, v0, v4, v5}, Landroid/app/Notification$Builder;->addAction(ILjava/lang/CharSequence;Landroid/app/PendingIntent;)Landroid/app/Notification$Builder;
.line 179
const v0, 0x7f020006
iget-object v4, p0, Lcom/android/server/telecom/MissedCallNotifier;->mContext:Landroid/content/Context;
const v5, 0x7f05001a
invoke-virtual {v4, v5}, Landroid/content/Context;->getString(I)Ljava/lang/String;
move-result-object v4
invoke-direct {p0, v1}, Lcom/android/server/telecom/MissedCallNotifier;->createSendSmsFromNotificationPendingIntent(Landroid/net/Uri;)Landroid/app/PendingIntent;
move-result-object v1
invoke-virtual {v3, v0, v4, v1}, Landroid/app/Notification$Builder;->addAction(ILjava/lang/CharSequence;Landroid/app/PendingIntent;)Landroid/app/Notification$Builder;
.line 184
:cond_0
invoke-virtual {p1}, Lcom/android/server/telecom/Call;->getPhotoIcon()Landroid/graphics/Bitmap;
move-result-object v0
.line 185
if-eqz v0, :cond_5
.line 186
invoke-virtual {v3, v0}, Landroid/app/Notification$Builder;->setLargeIcon(Landroid/graphics/Bitmap;)Landroid/app/Notification$Builder;
.line 198
:cond_1
:goto_3
invoke-virtual {v3}, Landroid/app/Notification$Builder;->build()Landroid/app/Notification;
move-result-object v0
.line 199
iget-object v1, p0, Lcom/android/server/telecom/MissedCallNotifier;->mContext:Landroid/content/Context;
invoke-static {v1, v0}, Lcom/android/server/telecom/MissedCallNotifier;->configureLedOnNotification(Landroid/content/Context;Landroid/app/Notification;)V
.line 201
const-string v1, "Adding missed call notification for %s."
new-array v3, v8, [Ljava/lang/Object;
aput-object p1, v3, v9
invoke-static {p0, v1, v3}, Lcom/android/server/telecom/Log;->i(Ljava/lang/Object;Ljava/lang/String;[Ljava/lang/Object;)V
.line 202
iget-object v1, p0, Lcom/android/server/telecom/MissedCallNotifier;->mNotificationManager:Landroid/app/NotificationManager;
sget-object v3, Landroid/os/UserHandle;->CURRENT:Landroid/os/UserHandle;
invoke-virtual {v1, v2, v8, v0, v3}, Landroid/app/NotificationManager;->notifyAsUser(Ljava/lang/String;ILandroid/app/Notification;Landroid/os/UserHandle;)V
.line 204
return-void
.line 138
:cond_2
const v1, 0x7f050016
.line 139
iget-object v0, p0, Lcom/android/server/telecom/MissedCallNotifier;->mContext:Landroid/content/Context;
const v3, 0x7f050017
new-array v4, v8, [Ljava/lang/Object;
iget v5, p0, Lcom/android/server/telecom/MissedCallNotifier;->mMissedCallCount:I
invoke-static {v5}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object v5
aput-object v5, v4, v9
invoke-virtual {v0, v3, v4}, Landroid/content/Context;->getString(I[Ljava/lang/Object;)Ljava/lang/String;
move-result-object v0
goto/16 :goto_0
.line 156
:cond_3
const v4, 0x108007f
invoke-virtual {v3, v4}, Landroid/app/Notification$Builder;->setSmallIcon(I)Landroid/app/Notification$Builder;
move-result-object v4
iget-object v5, p0, Lcom/android/server/telecom/MissedCallNotifier;->mContext:Landroid/content/Context;
invoke-virtual {v5}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
move-result-object v5
invoke-virtual {v5, v6}, Landroid/content/res/Resources;->getColor(I)I
move-result v5
invoke-virtual {v4, v5}, Landroid/app/Notification$Builder;->setColor(I)Landroid/app/Notification$Builder;
move-result-object v4
invoke-virtual {p1}, Lcom/android/server/telecom/Call;->getCreationTimeMillis()J
move-result-wide v6
invoke-virtual {v4, v6, v7}, Landroid/app/Notification$Builder;->setWhen(J)Landroid/app/Notification$Builder;
move-result-object v4
iget-object v5, p0, Lcom/android/server/telecom/MissedCallNotifier;->mContext:Landroid/content/Context;
invoke-virtual {v5, v1}, Landroid/content/Context;->getText(I)Ljava/lang/CharSequence;
move-result-object v1
invoke-virtual {v4, v1}, Landroid/app/Notification$Builder;->setContentTitle(Ljava/lang/CharSequence;)Landroid/app/Notification$Builder;
move-result-object v1
invoke-virtual {v1, v0}, Landroid/app/Notification$Builder;->setContentText(Ljava/lang/CharSequence;)Landroid/app/Notification$Builder;
move-result-object v0
invoke-direct {p0}, Lcom/android/server/telecom/MissedCallNotifier;->createCallLogPendingIntent()Landroid/app/PendingIntent;
move-result-object v1
invoke-virtual {v0, v1}, Landroid/app/Notification$Builder;->setContentIntent(Landroid/app/PendingIntent;)Landroid/app/Notification$Builder;
move-result-object v0
invoke-virtual {v0, v8}, Landroid/app/Notification$Builder;->setAutoCancel(Z)Landroid/app/Notification$Builder;
move-result-object v0
invoke-direct {p0}, Lcom/android/server/telecom/MissedCallNotifier;->createClearMissedCallsPendingIntent()Landroid/app/PendingIntent;
move-result-object v1
invoke-virtual {v0, v1}, Landroid/app/Notification$Builder;->setDeleteIntent(Landroid/app/PendingIntent;)Landroid/app/Notification$Builder;
goto/16 :goto_1
.line 167
:cond_4
invoke-virtual {v1}, Landroid/net/Uri;->getSchemeSpecificPart()Ljava/lang/String;
move-result-object v0
goto/16 :goto_2
.line 188
:cond_5
invoke-virtual {p1}, Lcom/android/server/telecom/Call;->getPhoto()Landroid/graphics/drawable/Drawable;
move-result-object v0
.line 189
if-eqz v0, :cond_1
instance-of v1, v0, Landroid/graphics/drawable/BitmapDrawable;
if-eqz v1, :cond_1
.line 190
check-cast v0, Landroid/graphics/drawable/BitmapDrawable;
invoke-virtual {v0}, Landroid/graphics/drawable/BitmapDrawable;->getBitmap()Landroid/graphics/Bitmap;
move-result-object v0
invoke-virtual {v3, v0}, Landroid/app/Notification$Builder;->setLargeIcon(Landroid/graphics/Bitmap;)Landroid/app/Notification$Builder;
goto/16 :goto_3
.line 194
:cond_6
const-string v1, "Suppress actions. handle: %s, missedCalls: %d."
const/4 v4, 0x2
new-array v4, v4, [Ljava/lang/Object;
invoke-static {v0}, Lcom/android/server/telecom/Log;->piiHandle(Ljava/lang/Object;)Ljava/lang/String;
move-result-object v0
aput-object v0, v4, v9
iget v0, p0, Lcom/android/server/telecom/MissedCallNotifier;->mMissedCallCount:I
invoke-static {v0}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object v0
aput-object v0, v4, v8
invoke-static {p0, v1, v4}, Lcom/android/server/telecom/Log;->d(Ljava/lang/Object;Ljava/lang/String;[Ljava/lang/Object;)V
goto/16 :goto_3
.end method
find and replace id's
0x7f060000 - <public type="color" name="theme_color"
0x7f050015 - <public type="string" name="notification_missedCallTitle"
0x7f02001f - <public type="drawable" name="stat_notify_missed_call_breath"
0x7f050034 - <public type="string" name="handle_restricted"
0x7f020020 - <public type="drawable" name="stat_sys_phone_call"
0x7f050019 - <public type="string" name="notification_missedCall_call_back"
0x7f020006 - <public type="drawable" name="ic_text_holo_dark"
0x7f05001a - <public type="string" name="notification_missedCall_message"
0x7f050016 - <public type="string" name="notification_missedCallsTitle"
0x7f050017 - <public type="string" name="notification_missedCallsMsg"
0x108007f - <public type="drawable" name="stat_notify_missed_call" -from framework-res.apk
Click to expand...
Click to collapse
5.Compile Telecom and move to your device
Continued on next post
Continued.
Third part ( TeleService.apk )
1.Decompile TeleService.apk
2.Downlaod breathingteleservice.zip from attachment. Extract and copy files to your decompiled TeleService
3.Recompile and Decompile TeleService (For ids)
4.Open TeleService\smali\com\android\phone\NotificationMgr.smali
find below method
Code:
.method updateMwi(ZLcom/android/internal/telephony/Phone;)V
replace whole method with this
Code:
.method updateMwi(ZLcom/android/internal/telephony/Phone;)V
.locals 29
.param p1, "visible" # Z
.param p2, "phone" # Lcom/android/internal/telephony/Phone;
.prologue
.line 290
invoke-interface/range {p2 .. p2}, Lcom/android/internal/telephony/Phone;->getPhoneId()I
move-result v13
.line 291
.local v13, "phoneId":I
sget-boolean v25, Lcom/android/phone/NotificationMgr;->DBG:Z
if-eqz v25, :cond_0
new-instance v25, Ljava/lang/StringBuilder;
invoke-direct/range {v25 .. v25}, Ljava/lang/StringBuilder;-><init>()V
const-string v26, "updateMwi(): "
invoke-virtual/range {v25 .. v26}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v25
move-object/from16 v0, v25
move/from16 v1, p1
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Z)Ljava/lang/StringBuilder;
move-result-object v25
const-string v26, " phoneId = "
invoke-virtual/range {v25 .. v26}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v25
move-object/from16 v0, v25
invoke-virtual {v0, v13}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
move-result-object v25
invoke-virtual/range {v25 .. v25}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v25
move-object/from16 v0, p0
move-object/from16 v1, v25
invoke-direct {v0, v1}, Lcom/android/phone/NotificationMgr;->log(Ljava/lang/String;)V
.line 292
:cond_0
const/16 v25, 0x3
move/from16 v0, v25
new-array v7, v0, [I
fill-array-data v7, :array_0
.line 296
.local v7, "mwiIcon":[I
const/16 v25, 0x3
move-object/from16 v0, p0
move/from16 v1, v25
invoke-direct {v0, v1, v13}, Lcom/android/phone/NotificationMgr;->getNotificationId(II)I
move-result v9
.line 298
.local v9, "notificationId":I
if-eqz p1, :cond_e
.line 299
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/phone/NotificationMgr;->mContext:Landroid/content/Context;
move-object/from16 v25, v0
invoke-virtual/range {v25 .. v25}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v25
const-string v26, "gk_voicemail_breath"
const/16 v27, 0x0
invoke-static/range {v25 .. v27}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v25
const/16 v26, 0x1
move/from16 v0, v25
move/from16 v1, v26
if-ne v0, v1, :cond_6
.line 301
const v15, 0x7f02003f
.line 305
.local v15, "resId":I
:goto_0
invoke-static {}, Lcom/android/phone/PhoneUtils;->isMultiSimEnabled()Z
move-result v25
if-eqz v25, :cond_1
.line 306
aget v15, v7, v13
.line 319
:cond_1
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/phone/NotificationMgr;->mContext:Landroid/content/Context;
move-object/from16 v25, v0
const v26, 0x7f0802e4
invoke-virtual/range {v25 .. v26}, Landroid/content/Context;->getString(I)Ljava/lang/String;
move-result-object v11
.line 320
.local v11, "notificationTitle":Ljava/lang/String;
invoke-interface/range {p2 .. p2}, Lcom/android/internal/telephony/Phone;->getVoiceMailNumber()Ljava/lang/String;
move-result-object v24
.line 321
.local v24, "vmNumber":Ljava/lang/String;
sget-boolean v25, Lcom/android/phone/NotificationMgr;->DBG:Z
if-eqz v25, :cond_2
new-instance v25, Ljava/lang/StringBuilder;
invoke-direct/range {v25 .. v25}, Ljava/lang/StringBuilder;-><init>()V
const-string v26, "- got vm number: \'"
invoke-virtual/range {v25 .. v26}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v25
move-object/from16 v0, v25
move-object/from16 v1, v24
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v25
const-string v26, "\'"
invoke-virtual/range {v25 .. v26}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v25
invoke-virtual/range {v25 .. v25}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v25
move-object/from16 v0, p0
move-object/from16 v1, v25
invoke-direct {v0, v1}, Lcom/android/phone/NotificationMgr;->log(Ljava/lang/String;)V
.line 338
:cond_2
if-nez v24, :cond_8
invoke-interface/range {p2 .. p2}, Lcom/android/internal/telephony/Phone;->getIccRecordsLoaded()Z
move-result v25
if-nez v25, :cond_8
.line 339
sget-boolean v25, Lcom/android/phone/NotificationMgr;->DBG:Z
if-eqz v25, :cond_3
const-string v25, "- Null vm number: SIM records not loaded (yet)..."
move-object/from16 v0, p0
move-object/from16 v1, v25
invoke-direct {v0, v1}, Lcom/android/phone/NotificationMgr;->log(Ljava/lang/String;)V
.line 352
:cond_3
move-object/from16 v0, p0
iget v0, v0, Lcom/android/phone/NotificationMgr;->mVmNumberRetriesRemaining:I
move/from16 v25, v0
add-int/lit8 v26, v25, -0x1
move/from16 v0, v26
move-object/from16 v1, p0
iput v0, v1, Lcom/android/phone/NotificationMgr;->mVmNumberRetriesRemaining:I
if-lez v25, :cond_7
.line 353
sget-boolean v25, Lcom/android/phone/NotificationMgr;->DBG:Z
if-eqz v25, :cond_4
const-string v25, " - Retrying in 10000 msec..."
move-object/from16 v0, p0
move-object/from16 v1, v25
invoke-direct {v0, v1}, Lcom/android/phone/NotificationMgr;->log(Ljava/lang/String;)V
.line 354
:cond_4
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/phone/NotificationMgr;->mApp:Lcom/android/phone/PhoneGlobals;
move-object/from16 v25, v0
move-object/from16 v0, v25
iget-object v0, v0, Lcom/android/phone/PhoneGlobals;->notifier:Lcom/android/phone/CallNotifier;
move-object/from16 v25, v0
const-wide/16 v26, 0x2710
move-object/from16 v0, v25
move-wide/from16 v1, v26
move-object/from16 v3, p2
invoke-virtual {v0, v1, v2, v3}, Lcom/android/phone/CallNotifier;->sendMwiChangedDelayed(JLcom/android/internal/telephony/Phone;)V
.line 428
.end local v11 # "notificationTitle":Ljava/lang/String;
.end local v15 # "resId":I
.end local v24 # "vmNumber":Ljava/lang/String;
:cond_5
:goto_1
return-void
.line 303
:cond_6
const v15, 0x108007e
.restart local v15 # "resId":I
goto/16 :goto_0
.line 357
.restart local v11 # "notificationTitle":Ljava/lang/String;
.restart local v24 # "vmNumber":Ljava/lang/String;
:cond_7
const-string v25, "NotificationMgr"
const-string v26, "NotificationMgr.updateMwi: getVoiceMailNumber() failed after 5 retries; giving up."
invoke-static/range {v25 .. v26}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I
.line 364
:cond_8
invoke-static/range {p2 .. p2}, Lcom/android/internal/telephony/TelephonyCapabilities;->supportsVoiceMessageCount(Lcom/android/internal/telephony/Phone;)Z
move-result v25
if-eqz v25, :cond_9
.line 365
invoke-interface/range {p2 .. p2}, Lcom/android/internal/telephony/Phone;->getVoiceMessageCount()I
move-result v23
.line 366
.local v23, "vmCount":I
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/phone/NotificationMgr;->mContext:Landroid/content/Context;
move-object/from16 v25, v0
const v26, 0x7f0802e5
invoke-virtual/range {v25 .. v26}, Landroid/content/Context;->getString(I)Ljava/lang/String;
move-result-object v17
.line 367
.local v17, "titleFormat":Ljava/lang/String;
const/16 v25, 0x1
move/from16 v0, v25
new-array v0, v0, [Ljava/lang/Object;
move-object/from16 v25, v0
const/16 v26, 0x0
invoke-static/range {v23 .. v23}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object v27
aput-object v27, v25, v26
move-object/from16 v0, v17
move-object/from16 v1, v25
invoke-static {v0, v1}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
move-result-object v11
.line 371
.end local v17 # "titleFormat":Ljava/lang/String;
.end local v23 # "vmCount":I
:cond_9
invoke-static/range {v24 .. v24}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z
move-result v25
if-eqz v25, :cond_c
.line 372
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/phone/NotificationMgr;->mContext:Landroid/content/Context;
move-object/from16 v25, v0
const v26, 0x7f0802e7
invoke-virtual/range {v25 .. v26}, Landroid/content/Context;->getString(I)Ljava/lang/String;
move-result-object v10
.line 380
.local v10, "notificationText":Ljava/lang/String;
:goto_2
new-instance v6, Landroid/content/Intent;
const-string v25, "android.intent.action.CALL"
const-string v26, "voicemail"
const-string v27, ""
const/16 v28, 0x0
invoke-static/range {v26 .. v28}, Landroid/net/Uri;->fromParts(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Landroid/net/Uri;
move-result-object v26
move-object/from16 v0, v25
move-object/from16 v1, v26
invoke-direct {v6, v0, v1}, Landroid/content/Intent;-><init>(Ljava/lang/String;Landroid/net/Uri;)V
.line 382
.local v6, "intent":Landroid/content/Intent;
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/phone/NotificationMgr;->mContext:Landroid/content/Context;
move-object/from16 v25, v0
const/16 v26, 0x0
const/16 v27, 0x0
move-object/from16 v0, v25
move/from16 v1, v26
move/from16 v2, v27
invoke-static {v0, v1, v6, v2}, Landroid/app/PendingIntent;->getActivity(Landroid/content/Context;ILandroid/content/Intent;I)Landroid/app/PendingIntent;
move-result-object v12
.line 384
.local v12, "pendingIntent":Landroid/app/PendingIntent;
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/phone/NotificationMgr;->mContext:Landroid/content/Context;
move-object/from16 v25, v0
invoke-static/range {v25 .. v25}, Landroid/preference/PreferenceManager;->getDefaultSharedPreferences(Landroid/content/Context;)Landroid/content/SharedPreferences;
move-result-object v14
.line 386
.local v14, "prefs":Landroid/content/SharedPreferences;
const-string v25, "button_voicemail_notification_ringtone_key"
const/16 v26, 0x0
move-object/from16 v0, v25
move-object/from16 v1, v26
invoke-interface {v14, v0, v1}, Landroid/content/SharedPreferences;->getString(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
move-result-object v18
.line 388
.local v18, "uriString":Ljava/lang/String;
invoke-static/range {v18 .. v18}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z
move-result v25
if-nez v25, :cond_d
.line 389
invoke-static/range {v18 .. v18}, Landroid/net/Uri;->parse(Ljava/lang/String;)Landroid/net/Uri;
move-result-object v16
.line 394
.local v16, "ringtoneUri":Landroid/net/Uri;
:goto_3
new-instance v4, Landroid/app/Notification$Builder;
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/phone/NotificationMgr;->mContext:Landroid/content/Context;
move-object/from16 v25, v0
move-object/from16 v0, v25
invoke-direct {v4, v0}, Landroid/app/Notification$Builder;-><init>(Landroid/content/Context;)V
.line 395
.local v4, "builder":Landroid/app/Notification$Builder;
invoke-virtual {v4, v15}, Landroid/app/Notification$Builder;->setSmallIcon(I)Landroid/app/Notification$Builder;
move-result-object v25
invoke-static {}, Ljava/lang/System;->currentTimeMillis()J
move-result-wide v26
invoke-virtual/range {v25 .. v27}, Landroid/app/Notification$Builder;->setWhen(J)Landroid/app/Notification$Builder;
move-result-object v25
move-object/from16 v0, v25
invoke-virtual {v0, v11}, Landroid/app/Notification$Builder;->setContentTitle(Ljava/lang/CharSequence;)Landroid/app/Notification$Builder;
move-result-object v25
move-object/from16 v0, v25
invoke-virtual {v0, v10}, Landroid/app/Notification$Builder;->setContentText(Ljava/lang/CharSequence;)Landroid/app/Notification$Builder;
move-result-object v25
move-object/from16 v0, v25
invoke-virtual {v0, v12}, Landroid/app/Notification$Builder;->setContentIntent(Landroid/app/PendingIntent;)Landroid/app/Notification$Builder;
move-result-object v25
move-object/from16 v0, v25
move-object/from16 v1, v16
invoke-virtual {v0, v1}, Landroid/app/Notification$Builder;->setSound(Landroid/net/Uri;)Landroid/app/Notification$Builder;
move-result-object v25
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/phone/NotificationMgr;->mContext:Landroid/content/Context;
move-object/from16 v26, v0
invoke-virtual/range {v26 .. v26}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
move-result-object v26
const/high16 v27, 0x7f0b0000
invoke-virtual/range {v26 .. v27}, Landroid/content/res/Resources;->getColor(I)I
move-result v26
invoke-virtual/range {v25 .. v26}, Landroid/app/Notification$Builder;->setColor(I)Landroid/app/Notification$Builder;
move-result-object v25
const/16 v26, 0x0
invoke-virtual/range {v25 .. v26}, Landroid/app/Notification$Builder;->setOngoing(Z)Landroid/app/Notification$Builder;
.line 404
invoke-static {v14, v13}, Lcom/android/phone/CallFeaturesSetting;->migrateVoicemailVibrationSettingsIfNeeded(Landroid/content/SharedPreferences;I)Z
.line 405
const-string v25, "button_voicemail_notification_vibrate_key"
const/16 v26, 0x0
move-object/from16 v0, v25
move/from16 v1, v26
invoke-interface {v14, v0, v1}, Landroid/content/SharedPreferences;->getBoolean(Ljava/lang/String;Z)Z
move-result v22
.line 407
.local v22, "vibrate":Z
if-eqz v22, :cond_a
.line 408
const/16 v25, 0x2
move/from16 v0, v25
invoke-virtual {v4, v0}, Landroid/app/Notification$Builder;->setDefaults(I)Landroid/app/Notification$Builder;
.line 411
:cond_a
invoke-virtual {v4}, Landroid/app/Notification$Builder;->build()Landroid/app/Notification;
move-result-object v8
.line 412
.local v8, "notification":Landroid/app/Notification;
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/phone/NotificationMgr;->mUserManager:Landroid/os/UserManager;
move-object/from16 v25, v0
const/16 v26, 0x1
invoke-virtual/range {v25 .. v26}, Landroid/os/UserManager;->getUsers(Z)Ljava/util/List;
move-result-object v21
.line 413
.local v21, "users":Ljava/util/List;, "Ljava/util/List<Landroid/content/pm/UserInfo;>;"
const/4 v5, 0x0
.local v5, "i":I
:goto_4
invoke-interface/range {v21 .. v21}, Ljava/util/List;->size()I
move-result v25
move/from16 v0, v25
if-ge v5, v0, :cond_5
.line 414
move-object/from16 v0, v21
invoke-interface {v0, v5}, Ljava/util/List;->get(I)Ljava/lang/Object;
move-result-object v19
check-cast v19, Landroid/content/pm/UserInfo;
.line 415
.local v19, "user":Landroid/content/pm/UserInfo;
invoke-virtual/range {v19 .. v19}, Landroid/content/pm/UserInfo;->getUserHandle()Landroid/os/UserHandle;
move-result-object v20
.line 416
.local v20, "userHandle":Landroid/os/UserHandle;
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/phone/NotificationMgr;->mUserManager:Landroid/os/UserManager;
move-object/from16 v25, v0
const-string v26, "no_outgoing_calls"
move-object/from16 v0, v25
move-object/from16 v1, v26
move-object/from16 v2, v20
invoke-virtual {v0, v1, v2}, Landroid/os/UserManager;->hasUserRestriction(Ljava/lang/String;Landroid/os/UserHandle;)Z
move-result v25
if-nez v25, :cond_b
invoke-virtual/range {v19 .. v19}, Landroid/content/pm/UserInfo;->isManagedProfile()Z
move-result v25
if-nez v25, :cond_b
.line 419
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/phone/NotificationMgr;->mContext:Landroid/content/Context;
move-object/from16 v25, v0
move-object/from16 v0, v25
invoke-static {v0, v8}, Lcom/android/phone/NotificationMgr;->configureLedNotification(Landroid/content/Context;Landroid/app/Notification;)V
.line 420
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/phone/NotificationMgr;->mNotificationManager:Landroid/app/NotificationManager;
move-object/from16 v25, v0
const/16 v26, 0x0
move-object/from16 v0, v25
move-object/from16 v1, v26
move-object/from16 v2, v20
invoke-virtual {v0, v1, v9, v8, v2}, Landroid/app/NotificationManager;->notifyAsUser(Ljava/lang/String;ILandroid/app/Notification;Landroid/os/UserHandle;)V
.line 413
:cond_b
add-int/lit8 v5, v5, 0x1
goto :goto_4
.line 375
.end local v4 # "builder":Landroid/app/Notification$Builder;
.end local v5 # "i":I
.end local v6 # "intent":Landroid/content/Intent;
.end local v8 # "notification":Landroid/app/Notification;
.end local v10 # "notificationText":Ljava/lang/String;
.end local v12 # "pendingIntent":Landroid/app/PendingIntent;
.end local v14 # "prefs":Landroid/content/SharedPreferences;
.end local v16 # "ringtoneUri":Landroid/net/Uri;
.end local v18 # "uriString":Ljava/lang/String;
.end local v19 # "user":Landroid/content/pm/UserInfo;
.end local v20 # "userHandle":Landroid/os/UserHandle;
.end local v21 # "users":Ljava/util/List;, "Ljava/util/List<Landroid/content/pm/UserInfo;>;"
.end local v22 # "vibrate":Z
:cond_c
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/phone/NotificationMgr;->mContext:Landroid/content/Context;
move-object/from16 v25, v0
const v26, 0x7f0802e6
invoke-virtual/range {v25 .. v26}, Landroid/content/Context;->getString(I)Ljava/lang/String;
move-result-object v25
const/16 v26, 0x1
move/from16 v0, v26
new-array v0, v0, [Ljava/lang/Object;
move-object/from16 v26, v0
const/16 v27, 0x0
invoke-static/range {v24 .. v24}, Landroid/telephony/PhoneNumberUtils;->formatNumber(Ljava/lang/String;)Ljava/lang/String;
move-result-object v28
aput-object v28, v26, v27
invoke-static/range {v25 .. v26}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
move-result-object v10
.restart local v10 # "notificationText":Ljava/lang/String;
goto/16 :goto_2
.line 391
.restart local v6 # "intent":Landroid/content/Intent;
.restart local v12 # "pendingIntent":Landroid/app/PendingIntent;
.restart local v14 # "prefs":Landroid/content/SharedPreferences;
.restart local v18 # "uriString":Ljava/lang/String;
:cond_d
sget-object v16, Landroid/provider/Settings$System;->DEFAULT_NOTIFICATION_URI:Landroid/net/Uri;
.restart local v16 # "ringtoneUri":Landroid/net/Uri;
goto/16 :goto_3
.line 425
.end local v6 # "intent":Landroid/content/Intent;
.end local v10 # "notificationText":Ljava/lang/String;
.end local v11 # "notificationTitle":Ljava/lang/String;
.end local v12 # "pendingIntent":Landroid/app/PendingIntent;
.end local v14 # "prefs":Landroid/content/SharedPreferences;
.end local v15 # "resId":I
.end local v16 # "ringtoneUri":Landroid/net/Uri;
.end local v18 # "uriString":Ljava/lang/String;
.end local v24 # "vmNumber":Ljava/lang/String;
:cond_e
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/phone/NotificationMgr;->mNotificationManager:Landroid/app/NotificationManager;
move-object/from16 v25, v0
const/16 v26, 0x0
sget-object v27, Landroid/os/UserHandle;->ALL:Landroid/os/UserHandle;
move-object/from16 v0, v25
move-object/from16 v1, v26
move-object/from16 v2, v27
invoke-virtual {v0, v1, v9, v2}, Landroid/app/NotificationManager;->cancelAsUser(Ljava/lang/String;ILandroid/os/UserHandle;)V
goto/16 :goto_1
.line 292
:array_0
.array-data 4
0x7f020040
0x7f020041
0x7f020042
.end array-data
.end method
find and replace id's
0x7f02003f - <public type="drawable" name="stat_notify_voicemail_breath"
0x7f0802e4 - <public type="string" name="notification_voicemail_title"
0x108007e - <public type="drawable" name="stat_notify_voicemail" - framework-res
0x7f0802e5 - <public type="string" name="notification_voicemail_title_count"
0x7f0802e7 - <public type="string" name="notification_voicemail_no_vm_number"
0x7f0b0000 - <public type="color" name="dialer_theme_color"
0x7f0802e6 - <public type="string" name="notification_voicemail_text_format"
0x7f020040 - <public type="drawable" name="stat_notify_voicemail_sub1"
0x7f020041 - <public type="drawable" name="stat_notify_voicemail_sub2"
0x7f020042 - <public type="drawable" name="stat_notify_voicemail_sub3"
Click to expand...
Click to collapse
5.Compile TeleService and move to your device
Continued on next post
Continued.
Final part ( Mms.apk )
1.Decompile Mms.apk
2.Download breathingmms.zip from attachment. Extract and copy files to your decompiled Mms
3.Recompile and Decompile Mms (For id's)
4.Open Mms\smali\com\android\mms\transaction\MessagingNotification.smali
find below method
Code:
.method private static final addSmsNotificationInfos(Landroid/content/Context;Ljava/util/Set;Ljava/util/SortedSet;)V
replace whole method with this
Code:
.method private static final addSmsNotificationInfos(Landroid/content/Context;Ljava/util/Set;Ljava/util/SortedSet;)V
.locals 21
.param p0, "context" # Landroid/content/Context;
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Landroid/content/Context;",
"Ljava/util/Set",
"<",
"Ljava/lang/Long;",
">;",
"Ljava/util/SortedSet",
"<",
"Lcom/android/mms/transaction/MessagingNotification$NotificationInfo;",
">;)V"
}
.end annotation
.prologue
.line 929
.local p1, "threads":Ljava/util/Set;, "Ljava/util/Set<Ljava/lang/Long;>;"
.local p2, "notificationSet":Ljava/util/SortedSet;, "Ljava/util/SortedSet<Lcom/android/mms/transaction/MessagingNotification$NotificationInfo;>;"
invoke-virtual/range {p0 .. p0}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v3
.line 930
.local v3, "resolver":Landroid/content/ContentResolver;
sget-object v4, Landroid/provider/Telephony$Sms;->CONTENT_URI:Landroid/net/Uri;
sget-object v5, Lcom/android/mms/transaction/MessagingNotification;->SMS_STATUS_PROJECTION:[Ljava/lang/String;
const-string v6, "(type = 1 AND seen = 0)"
const/4 v7, 0x0
const-string v8, "date desc"
move-object/from16 v2, p0
invoke-static/range {v2 .. v8}, Landroid/database/sqlite/SqliteWrapper;->query(Landroid/content/Context;Landroid/content/ContentResolver;Landroid/net/Uri;[Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)Landroid/database/Cursor;
move-result-object v17
.line 934
.local v17, "cursor":Landroid/database/Cursor;
if-nez v17, :cond_0
.line 982
:goto_0
return-void
.line 939
:cond_0
:goto_1
:try_start_0
invoke-interface/range {v17 .. v17}, Landroid/database/Cursor;->moveToNext()Z
move-result v2
if-eqz v2, :cond_4
.line 940
const/4 v2, 0x2
move-object/from16 v0, v17
invoke-interface {v0, v2}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;
move-result-object v6
.line 941
.local v6, "address":Ljava/lang/String;
invoke-static {v6}, Lcom/android/mms/ui/MessageUtils;->isWapPushNumber(Ljava/lang/String;)Z
move-result v2
if-eqz v2, :cond_1
.line 942
const-string v2, ":"
invoke-virtual {v6, v2}, Ljava/lang/String;->split(Ljava/lang/String;)[Ljava/lang/String;
move-result-object v19
.line 943
.local v19, "mAddresses":[Ljava/lang/String;
invoke-virtual/range {p0 .. p0}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
move-result-object v2
const v4, 0x7f070010
invoke-virtual {v2, v4}, Landroid/content/res/Resources;->getInteger(I)I
move-result v2
aget-object v6, v19, v2
.line 947
.end local v19 # "mAddresses":[Ljava/lang/String;
:cond_1
const/4 v2, 0x0
invoke-static {v6, v2}, Lcom/android/mms/data/Contact;->get(Ljava/lang/String;Z)Lcom/android/mms/data/Contact;
move-result-object v15
.line 948
.local v15, "contact":Lcom/android/mms/data/Contact;
invoke-virtual {v15}, Lcom/android/mms/data/Contact;->getSendToVoicemail()Z
move-result v2
if-nez v2, :cond_0
.line 953
const/4 v2, 0x3
move-object/from16 v0, v17
invoke-interface {v0, v2}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;
move-result-object v7
.line 954
.local v7, "message":Ljava/lang/String;
const/4 v2, 0x0
move-object/from16 v0, v17
invoke-interface {v0, v2}, Landroid/database/Cursor;->getLong(I)J
move-result-wide v9
.line 955
.local v9, "threadId":J
const/4 v2, 0x1
move-object/from16 v0, v17
invoke-interface {v0, v2}, Landroid/database/Cursor;->getLong(I)J
move-result-wide v12
.line 956
.local v12, "timeMillis":J
const/4 v2, 0x4
move-object/from16 v0, v17
invoke-interface {v0, v2}, Landroid/database/Cursor;->getInt(I)I
move-result v11
.line 957
.local v11, "subId":I
const/4 v2, 0x5
move-object/from16 v0, v17
invoke-interface {v0, v2}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;
move-result-object v20
.line 959
.local v20, "msgId":Ljava/lang/String;
const-string v2, "Mms"
const/4 v4, 0x2
invoke-static {v2, v4}, Landroid/util/Log;->isLoggable(Ljava/lang/String;I)Z
move-result v2
if-eqz v2, :cond_2
.line 961
const-string v2, "Mms"
new-instance v4, Ljava/lang/StringBuilder;
invoke-direct {v4}, Ljava/lang/StringBuilder;-><init>()V
const-string v5, "addSmsNotificationInfos: count="
invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v4
invoke-interface/range {v17 .. v17}, Landroid/database/Cursor;->getCount()I
move-result v5
invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
move-result-object v4
const-string v5, ", addr="
invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v4
invoke-virtual {v4, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v4
const-string v5, ", thread_id="
invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v4
invoke-virtual {v4, v9, v10}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;
move-result-object v4
invoke-virtual {v4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v4
invoke-static {v2, v4}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I
.line 966
:cond_2
const/4 v5, 0x1
const/4 v8, 0x0
const/4 v14, 0x0
const/16 v16, 0x0
move-object/from16 v4, p0
invoke-static/range {v4 .. v16}, Lcom/android/mms/transaction/MessagingNotification;->getNewMessageNotificationInfo(Landroid/content/Context;ZLjava/lang/String;Ljava/lang/String;Ljava/lang/String;JIJLandroid/graphics/Bitmap;Lcom/android/mms/data/Contact;I)Lcom/android/mms/transaction/MessagingNotification$NotificationInfo;
move-result-object v18
.line 970
.local v18, "info":Lcom/android/mms/transaction/MessagingNotification$NotificationInfo;
invoke-static {}, Lcom/android/mms/ui/MessageUtils;->isMailboxMode()Z
move-result v2
if-eqz v2, :cond_3
.line 971
move-object/from16 v0, v18
iget-object v2, v0, Lcom/android/mms/transaction/MessagingNotification$NotificationInfo;->mClickIntent:Landroid/content/Intent;
sget-object v4, Landroid/provider/Telephony$Sms;->CONTENT_URI:Landroid/net/Uri;
move-object/from16 v0, v20
invoke-static {v4, v0}, Landroid/net/Uri;->withAppendedPath(Landroid/net/Uri;Ljava/lang/String;)Landroid/net/Uri;
move-result-object v4
invoke-virtual {v2, v4}, Landroid/content/Intent;->setData(Landroid/net/Uri;)Landroid/content/Intent;
.line 974
:cond_3
move-object/from16 v0, p2
move-object/from16 v1, v18
invoke-interface {v0, v1}, Ljava/util/SortedSet;->add(Ljava/lang/Object;)Z
.line 976
invoke-static {v9, v10}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
move-result-object v2
move-object/from16 v0, p1
invoke-interface {v0, v2}, Ljava/util/Set;->add(Ljava/lang/Object;)Z
.line 977
const/4 v2, 0x0
move-object/from16 v0, v17
invoke-interface {v0, v2}, Landroid/database/Cursor;->getLong(I)J
move-result-wide v4
invoke-static {v4, v5}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
move-result-object v2
move-object/from16 v0, p1
invoke-interface {v0, v2}, Ljava/util/Set;->add(Ljava/lang/Object;)Z
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
goto/16 :goto_1
.line 980
.end local v6 # "address":Ljava/lang/String;
.end local v7 # "message":Ljava/lang/String;
.end local v9 # "threadId":J
.end local v11 # "subId":I
.end local v12 # "timeMillis":J
.end local v15 # "contact":Lcom/android/mms/data/Contact;
.end local v18 # "info":Lcom/android/mms/transaction/MessagingNotification$NotificationInfo;
.end local v20 # "msgId":Ljava/lang/String;
:catchall_0
move-exception v2
invoke-interface/range {v17 .. v17}, Landroid/database/Cursor;->close()V
throw v2
:cond_4
invoke-interface/range {v17 .. v17}, Landroid/database/Cursor;->close()V
goto/16 :goto_0
.end method
find and replace id's
0x7f070010 - <public type="integer" name="wap_push_address_index"
Click to expand...
Click to collapse
find below method
Code:
.method private static updateNotification(Landroid/content/Context;JILjava/util/SortedSet;)V
replace whole method with this texts
(it is too long. so i cant paste here. you can get the whole method from here )
Click to expand...
Click to collapse
find and replace id's
0x7f090372 - <public type="string" name="message_count_notification"
0x7f0200e7 - <public type="drawable" name="stat_notify_sms_breath"
0x7f0a007e - <public type="color" name="mms_theme_color"
0x1050006 - <public type="dimen" name="notification_large_icon_height" - framework-res
0x1050005 - <public type="dimen" name="notification_large_icon_width" - framework-res
0x7f0200d1 - <public type="drawable" name="stat_notify_sms"
0x7f0901e7 - <public type="string" name="menu_reply"
0x7f020087 - <public type="drawable" name="ic_reply" - 2 раза
0x7f090162 - <public type="string" name="qm_mark_read"
0x7f020058 - <public type="drawable" name="ic_mark_read"
0x7f090260 - <public type="string" name="menu_call"
0x7f02005d - <public type="drawable" name="ic_menu_call" - 2 раза
0x7f09022d - <public type="string" name="qm_wear_voice_reply"
0x7f020087 - <public type="drawable" name="ic_reply"
0x7f09022e - <public type="string" name="qm_wear_reply_by_voice"
0x7f090372 - <public type="string" name="message_count_notification"
Click to expand...
Click to collapse
5.Compile Mms and move to your device
if it is showing any error while compiling. you can use Compiled Mms.apk from attachment
Enjoy...