Xin chào các bạn đã lâu rồi mình không lập topic thử thuật vì nhiều lý do mà ký do đầu tiên là không có thời gian. Hôm nay mình cũng đã thi xong rồi nên cũng ơt không nên cũng bỏ ra chút thời gian để lập topic thử thuật.
Hôm nay mình sẽ hướng dẫn các bạn nhận biết code màn hình khóa( mã pin. Và nhận biết thôi chứ không hướng dẫn mod vì nó khá lằng nhằng. Và mình chỉ hướng dẫn nhận biết các code chính thôi.
÷ Đầu tiên là file chứa code khóa màn hình. Trên ROM CM 12.1 thì code nằm trong res/layout/keyguard_pin_view. Còn đối với ROM STOCK TOUCHWIZ thì nó nằm trong res/layout-sw320dp-v13/keyguard_pin_view. Đó là nơi ở điển hình của nó và tùy rom thì nơi ở nó khác nhau bạn xác định bằng id của nó. Đây là đoạn id:
<com.android.keyguard.KeyguardPINView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:androidprv="http://schemas.android.com/apk/res-auto" android:orientation="vertical" android:id="@id/keyguard_pin_view" android:layout_width="fill_parent" android:layout_height="fill_parent" android:contentDescription="@string/keyguard_accessibility_pin_unlock" androidprv:layout_maxHeight="@dimen/keyguard_security_max_height">. Cái mà bạn cần chú ý là đoạn:
android:id="@id/keyguard_pin_view" . Như vậy là nhận biết được file code rồi.
÷ Giờ tiến hành nhận biết code. Do có nhiều hãng sản xuất khác nhau nên code cũng khác nhau và cũng phụ thuộc vào phiên bản android nữa nên các bạn so sánh và nhận biết thôi.
- Đầu tiên là code phím số. Đây là đoạn code demo:
<com.android.keyguard.NumPadKey android:id="@id/key1" android:layout_width="0.0px" android:layout_height="fill_parent" android:layout_weight="1.0" androidprv:digit="1" androidprv:textView="@id/pinEntry" />. Đây là Phím Số 1. Tương tự ta có 2.3.4...:
<com.android.keyguard.NumPadKey android:id="@id/key2" android:layout_width="0.0px" android:layout_height="fill_parent" android:layout_weight="1.0" androidprv:digit="2" androidprv:textView="@id/pinEntry" />...
<com.android.keyguard.NumPadKey android:id="@id/key9" android:layout_width="0.0px" android:layout_height="fill_parent" android:layout_weight="1.0" androidprv:digit="9" androidprv:textView="@id/pinEntry" />...
<com.android.keyguard.NumPadKey android:id="@id/key0" android:layout_width="0.0px" android:layout_height="fill_parent" android:layout_weight="1.0" androidprv:digit="0" androidprv:textView="@id/pinEntry" />. Và đó đã nhận biết code số (có thể khác và mình thấy giữa cm và tw trên 5.1 giống nhau).
- Bây giờ là code xóa và ok( một số rom không có code Ok)
*Đầu tiên là code Xóa:
<ImageButton android:gravity="center_vertical" android:id="@id/delete_button" android:background="@drawable/lock_ripple_drawable" android:clickable="true" android:layout_width="0.0px" android:layout_height="fill_parent" android:src="@drawable/pin_lock_btn_back" android:scaleType="center" android:layout_weight="1.0" android:contentDescription="@string/keyboardview_keycode_delete" />
*Tiếp đến là code ok:
<ImageButton android:gravity="center" android:id="@id/key_enter" android:background="@drawable/lock_ripple_drawable" android:layout_width="0.0px" android:layout_height="fill_parent" android:src="@drawable/ic_done_wht" android:layout_weight="1.0" android:contentDescription="@string/keyboardview_keycode_enter" />
-Tiêp đến là khung pass( chổ hiển thì pass khi nhập):
<com.android.keyguard.PasswordTextView android:gravity="center" android:id="@id/pinEntry" android:layout_width="fill_parent" android:layout_height="fill_parent" android:maxLength="16" android:layout_centerHorizontal="true" androidprv:scaledTextSize="32" />.
Như vậy mình đã nhận biết code khóa mã pin. Còn việc khóa màn hình thì bạn có thể sử dụng các bài mod đã thiết kế sẵn giao diện. còn bạn muốn thiết kế giao diện riêng thì rất là tốn time nào là thiết kế các layout và điều chình các code và nó không dễ như status bar( theo cá nhân mình(
Toàn bộ bày viết trên là do kinh nghiệm học tập của mình không hề copy bài viết của ai cả.
Theo mình biết thì trong FORUM có khá nhiều pờ rào ẩn danh. Mong các bác đừng chém em.
Picola-Ya4r-YA