Guide Add Menu di BBM

Home » » Guide Add Menu di BBM
1. Buka menu menu_chat_fragment.xml (res/menu/*)
2. Tambahkan kode ini di bagian bawah di atas </menu>
    <item android:icon="@drawable/delta_lock" android:id="@+id/delta_lock" android:title="@string/drawer_lock" app:showAsAction="never" />
3. Buka smali com/bbm/ui/d/bv.smali (ini untuk BBM v2.11.0.16 jika ada update mungkin letaknya berbeda lagi)
4. Lihat di bagian kode berikut
        :sswitch_data_0
            .sparse-switch
                0x7f0f07e9 -> :sswitch_1
                0x7f0f081a -> :sswitch_0
                0x7f0f081b -> :sswitch_3
                0x7f0f081c -> :sswitch_4
                0x7f0f081d -> :sswitch_2
            .end sparse-switch
        .end method
5. Di situ angka paling gede 4 jadi kita tambahkan kode 0x7f0f081d -> :sswitch_5 (ingat 0x7f0f081d nantinya diganti dengan kode public dari android:id="@+id/delta_lock"
        :sswitch_data_0
            .sparse-switch
                0x7f0f07e9 -> :sswitch_1
                0x7f0f081a -> :sswitch_0
                0x7f0f081b -> :sswitch_3
                0x7f0f081c -> :sswitch_4
                0x7f0f081d -> :sswitch_2
                0x7f0f081d -> :sswitch_5
            .end sparse-switch
        .end method
6. Copy code dari :sswitch_3 pastekan di bawahnya jadi akan menjadi
.line 908
    :sswitch_3
    new-instance v3, Landroid/content/Intent;
    iget-object v0, p0, Landroid/support/v4/app/Fragment;->D:Landroid/support/v4/app/l;
    const-class v4, Lcom/bbm/ui/activities/SelectContactActivity;
    invoke-direct {v3, v0, v4}, Landroid/content/Intent;-><init>(Landroid/content/Context;Ljava/lang/Class;)V
.line 908
    :sswitch_3
    new-instance v3, Landroid/content/Intent;
    iget-object v0, p0, Landroid/support/v4/app/Fragment;->D:Landroid/support/v4/app/l;
    const-class v4, Lcom/bbm/ui/activities/SelectContactActivity;
    invoke-direct {v3, v0, v4}, Landroid/content/Intent;-><init>(Landroid/content/Context;Ljava/lang/Class;)V
7. Ganti kode :sswitch_3 dengan :sswitch_5 (yang sudah kita bikin di atas)

8. Ganti kode Lcom/bbm/ui/activities/SelectContactActivity; dengan Lcom/mod/pvmode/LockActivity;
9. Kode hasilnya
.line 908
    :sswitch_3
    new-instance v3, Landroid/content/Intent;
    iget-object v0, p0, Landroid/support/v4/app/Fragment;->D:Landroid/support/v4/app/l;
    const-class v4, Lcom/bbm/ui/activities/SelectContactActivity;
    invoke-direct {v3, v0, v4}, Landroid/content/Intent;-><init>(Landroid/content/Context;Ljava/lang/Class;)V
.line 908
    :sswitch_5
    new-instance v3, Landroid/content/Intent;
    iget-object v0, p0, Landroid/support/v4/app/Fragment;->D:Landroid/support/v4/app/l;
    const-class v4, Lcom/mod/pvmode/LockActivity;
    invoke-direct {v3, v0, v4}, Landroid/content/Intent;-><init>(Landroid/content/Context;Ljava/lang/Class;)V
10. 0x7f0f081d -> :sswitch_5 (dipastikan lagi 0x7f0f081d ganti dengan kode public id delta_lock
11. Done.

Credit  : Yoyocx Praditya S Putra
Source : http://www.deltacomputindo.com
Share this article :