Monday, February 20, 2017

Hide/Show Unlock di Lock Mode BBM Mod



Lakuka persiapan berikut :
- Saya yakin, kalian yang membaca artikel ini sudah faham dan menguasai metode DCRC di PC maupun Android.
- Waktu luang sehingga kalian bisa berkonsentrasi dan lebih teliti dalam membaca.
- Wajib berkonsentrasi pada pelajaran sekolah/kuliah sebelum berkonsentrasi pada hal seperti ini. ( For Student Only )
- Dua lembar uang kertas RP.50.000,- untuk donasi kepada penulis. wkwkwkwkwk.

Berikut adalah langkah-langkah untuk mengubah interface LOCK Mode di BBM MOD.
Perlu diperhatikan, syarat utama untuk memasang ini ialah BBM yang sudah support Lock Mode. jadi jika belum pasang, kalian harus pasang terlebih dahulu.

=== STEP 1 ===
Pada step ini, kita akan membuat method onclick baru pada bagian smali Lock Activity kita. Jadi ikuti langkah-langkah betikut ini.

- Tempatkan Script ini :

.method public unlockHide(Landroid/view/View;)V
    .locals 4

    const/4 v3, 0x0

    const-string v0, "widget_layout"

    const-string v1, "id"

    sget-object v2, Lcom/bbm/Alaska;->ctx:Landroid/content/Context;

    invoke-static {v0, v1, v2}, Lnami/preference/PreferenceUtils;->b(Ljava/lang/String;Ljava/lang/String;Landroid/content/Context;)I

    move-result v0

    invoke-virtual {p0, v0}, Lcom/mod/pvmode/LockActivity;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/LinearLayout;

    const/4 v1, 0x0

    invoke-virtual {v0, v1}, Landroid/widget/LinearLayout;->setVisibility(I)V

    const-string v0, "unlock_layout"

    const-string v1, "id"

    sget-object v2, Lcom/bbm/Alaska;->ctx:Landroid/content/Context;

    invoke-static {v0, v1, v2}, Lnami/preference/PreferenceUtils;->b(Ljava/lang/String;Ljava/lang/String;Landroid/content/Context;)I

    move-result v0

    invoke-virtual {p0, v0}, Lcom/mod/pvmode/LockActivity;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/LinearLayout;

    const/16 v1, 0x8

    invoke-virtual {v0, v1}, Landroid/widget/LinearLayout;->setVisibility(I)V

    invoke-virtual {v0}, Landroid/widget/LinearLayout;->animate()Landroid/view/ViewPropertyAnimator;

    move-result-object v1

    invoke-virtual {v1, v3}, Landroid/view/ViewPropertyAnimator;->translationYBy(F)Landroid/view/ViewPropertyAnimator;

    move-result-object v1

    const/high16 v2, 0x42f00000    # 120.0f

    invoke-virtual {v1, v2}, Landroid/view/ViewPropertyAnimator;->translationY(F)Landroid/view/ViewPropertyAnimator;

    move-result-object v1

    invoke-virtual {v1, v3}, Landroid/view/ViewPropertyAnimator;->alpha(F)Landroid/view/ViewPropertyAnimator;

    move-result-object v1

    new-instance v2, Lcom/mod/pvmode/LockActivity$2;

    invoke-direct {v2, p0, v0}, Lcom/mod/pvmode/LockActivity$2;-><init>(Lcom/mod/pvmode/LockActivity;Landroid/widget/LinearLayout;)V

    invoke-virtual {v1, v2}, Landroid/view/ViewPropertyAnimator;->setListener(Landroid/animation/Animator$AnimatorListener;)Landroid/view/ViewPropertyAnimator;

    return-void
.end method

.method public unlockView(Landroid/view/View;)V
    .locals 3

    const-string v0, "widget_layout"

    const-string v1, "id"

    sget-object v2, Lcom/bbm/Alaska;->ctx:Landroid/content/Context;

    invoke-static {v0, v1, v2}, Lnami/preference/PreferenceUtils;->b(Ljava/lang/String;Ljava/lang/String;Landroid/content/Context;)I

    move-result v0

    invoke-virtual {p0, v0}, Lcom/mod/pvmode/LockActivity;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/LinearLayout;

    const/16 v1, 0x8

    invoke-virtual {v0, v1}, Landroid/widget/LinearLayout;->setVisibility(I)V

    const-string v0, "unlock_layout"

    const-string v1, "id"

    sget-object v2, Lcom/bbm/Alaska;->ctx:Landroid/content/Context;

    invoke-static {v0, v1, v2}, Lnami/preference/PreferenceUtils;->b(Ljava/lang/String;Ljava/lang/String;Landroid/content/Context;)I

    move-result v0

    invoke-virtual {p0, v0}, Lcom/mod/pvmode/LockActivity;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/LinearLayout;

    const/4 v1, 0x0

    invoke-virtual {v0, v1}, Landroid/widget/LinearLayout;->setVisibility(I)V

    invoke-virtual {v0}, Landroid/widget/LinearLayout;->animate()Landroid/view/ViewPropertyAnimator;

    move-result-object v1

    const/high16 v2, 0x42f00000    # 120.0f

    invoke-virtual {v1, v2}, Landroid/view/ViewPropertyAnimator;->translationYBy(F)Landroid/view/ViewPropertyAnimator;

    move-result-object v1

    const/4 v2, 0x0

    invoke-virtual {v1, v2}, Landroid/view/ViewPropertyAnimator;->translationY(F)Landroid/view/ViewPropertyAnimator;

    move-result-object v1

    const/high16 v2, 0x3f800000    # 1.0f

    invoke-virtual {v1, v2}, Landroid/view/ViewPropertyAnimator;->alpha(F)Landroid/view/ViewPropertyAnimator;

    move-result-object v1

    new-instance v2, Lcom/mod/pvmode/LockActivity$1;

    invoke-direct {v2, p0, v0}, Lcom/mod/pvmode/LockActivity$1;-><init>(Lcom/mod/pvmode/LockActivity;Landroid/widget/LinearLayout;)V

    invoke-virtual {v1, v2}, Landroid/view/ViewPropertyAnimator;->setListener(Landroid/animation/Animator$AnimatorListener;)Landroid/view/ViewPropertyAnimator;

    return-void
.end method

- Tepat di bawah :

.method public onTriggered(Ljava/lang/String;)V
    .locals 0
    .param p1, "id"    # Ljava/lang/String;

    .prologue
    .line 81
    return-void
.end method

NOTE : Tambhanan untuk bahan pemdukung smali saya sertakan link download.

=== STEP 2 ===
Step selanjutnya adalah membuat interface layout baru. Silahkan design layout kalian dengan catatan "Wajib" ada element berikut :
  •     • Linear Layout untuk layout input password dengan id "@id/unlock_layout"
  •     • Linear Layout untuk layout yang berisi widget, bisa ImageView, Clock, Tanggal, atau element lainnya dengan id "@id/widget_layout"
  •     • 3 OnClick yaitu goToUnlock, unlockView, dan unlockHide.


Jika masih bingung, kalian bisa contoh atau pakai script berikut :

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout android:gravity="center" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" android:onClick="unlockHide"
  xmlns:android="http://schemas.android.com/apk/res/android">
    <LinearLayout android:id="@+id/widget_layout" android:layout_width="fill_parent" android:layout_height="wrap_content">
        <RelativeLayout android:layout_width="fill_parent" android:layout_height="fill_parent">
            <LinearLayout android:gravity="center" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginTop="30.0dip" android:layout_alignParentTop="true">
                <DigitalClock android:textSize="60.0sp" android:textColor="#ffffffff" android:layout_width="wrap_content" android:layout_height="wrap_content" />
                <nami.abdifahmy.NamiDateView android:textSize="20.0sp" android:textColor="#ffffffff" android:layout_width="wrap_content" android:layout_height="wrap_content" />
            </LinearLayout>
            <LinearLayout android:gravity="center" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginBottom="20.0dip" android:layout_alignParentBottom="true" android:layout_centerInParent="true">
                <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginBottom="5.0dip" android:src="@drawable/unlock_button" android:onClick="unlockView" />
                <nami.abdifahmy.ShimmerTextView android:textSize="17.0sp" android:textColor="#ffffffff" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Ketuk icon untuk membuka kunci." />
            </LinearLayout>
        </RelativeLayout>
    </LinearLayout>
    <LinearLayout android:gravity="center" android:orientation="vertical" android:id="@+id/unlock_layout" android:visibility="gone" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_margin="20.0dip">
        <android.support.v7.widget.CardView android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_marginTop="@dimen/profile_card_view_margin" android:layout_marginBottom="@dimen/profile_card_view_margin"
          xmlns:android="http://schemas.android.com/apk/res/android">
            <LinearLayout android:orientation="vertical" android:background="#ffffffff" android:layout_width="fill_parent" android:layout_height="wrap_content">
                <LinearLayout android:background="#ff009688" android:layout_width="fill_parent" android:layout_height="wrap_content">
                    <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="Masukkan Password" style="@style/ProfileCardViewTitleStyle" />
                </LinearLayout>
                <EditText android:textColor="#ff009688" android:textColorHint="#ffa7a7a7" android:gravity="center" android:id="@+id/edit_input_passwd" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_margin="5.0dip" android:hint="Masukkan Password" android:ems="10" android:inputType="textPassword" />
                <Button android:textSize="16.0sp" android:textColor="#ffffffff" android:background="@drawable/round_btn" android:layout_width="fill_parent" android:layout_height="40.0dip" android:layout_margin="5.0dip" android:text="UNLOCK" android:onClick="gotoUnlock" />
            </LinearLayout>
        </android.support.v7.widget.CardView>
    </LinearLayout>
</LinearLayout>

NOTE : Untuk File drawable dan smali widget, saya sertakan link download.

=== STEP 3 ===
Step terakhir, kalian tempatkan script berikut :

- Ke res/values/styles.xml

    <style name="LockTheme" parent="@style/BBMAppTheme">
        <item name="android:windowBackground">@drawable/lock_bg</item>
        <item name="android:windowIsTranslucent">true</item>
        <item name="android:fitsSystemWindows">true</item>
        <item name="windowActionBar">false</item>
        <item name="windowNoTitle">true</item>
    </style>
    
- Ke res/values-v21/styles.xml

    <style name="LockTheme" parent="@style/BBMAppTheme">
        <item name="android:windowBackground">@drawable/lock_bg</item>
        <item name="android:windowIsTranslucent">true</item>
        <item name="android:fitsSystemWindows">true</item>
        <item name="android:statusbarColor">@color/transparent</item>
        <item name="windowActionBar">false</item>
        <item name="windowNoTitle">true</item>
    </style>
    
- Untuk background, silahkan sesuaikan sendiri :)
- Jangan lupa tambahkan android:theme di AndroidManifest.xml
    
=== Download Bahan ===



    
At last but not least, silahkan recompile bbm_src kalia, lakukan sign and install.

WARNING :
- Jika terjadi FC, silahkan cek letak kesalahannya dimana.
- Dilarang keras mengedit, mencopas, mengclaim sebagian atau seluruh guide ini tampa seizin penulis.
- Original File By Yoyocx S Praditya Putra & Nami Abdi Fahmy

DELTA YOWA v3.2.0

Package   com.whatsapp Type   With Emoji Changer/Variants Size   56.37MB Link   Mediafire Mirror   GDrive Package   com...