Tampilkan postingan dengan label Modding. Tampilkan semua postingan
Tampilkan postingan dengan label Modding. Tampilkan semua postingan

Rabu, 07 November 2012

[Guide][How to] Added 6 Lockscreen to your Custom Rom

Hallo kali ini saya akan memberikan tutor cara menambahkan 6 Lockscreen ke Android Custom Rom terutama untuk jenis ponsel Samsung Galaxy Fit GT-S5670 dan cara ini susah saya buktikan sendiri ke dalam custom rom saya yaitu Vania Rom pada versi 1.3 dan versi 1.4... oke mari kita mulai tutornya...
Sebelumnya silahkan download file-file berikut karena file ini sangat dibutuhkan dalam menambahkn 6 lockscreen ke Custom Rom kamu.
1. Android.policy.zip
2. LidroidParts.apk
3. Lidroid-res.apk

Dan File yang perlu di modifikasi adalah
1. android.policy.jar
2. SystemUI.apk (apabila Anda telah menambahkan 14 statusbar toggle sebelumnya)
Dan Langkah-langkahnya adalah

1. Copy file android.policy.jar dari folder System/framework (Harus Deodexed)
2. Decompile file tersebut
3. Extract file Android.policy.zip yang telah kamu download
4. Copy file smali yang terdapat pada folder hasil extract tadi ke folder hasil decompile pada langkah no 2

- Sekarang buka file KeyguardUpdateMonitor.smali yang terdapat pada folder smali\com\android\internal\ policy\impl dari hasil decompile
- Setelah "#annonations" cari baris ini
Lcom/android/internal/policy/impl/KeyguardUpdateMonitor$AirplaneModeChangeCallback;
- Setelah itu tambahkan baris ini
Code:
Lcom/android/internal/policy/impl/KeyguardUpdateMonitor$MediaStateCallback;,
- Sekarang cari baris ini
.field private mLockscreenWallpaperDrawable:Landroid/graphics/drawable/Drawable;"
- Dibawah baris tersebut tambahkan baris berikut
Code:
.field private mMediaCallbacks:Ljava/util/ArrayList;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/ArrayList",
            "<",
            "Lcom/android/internal/policy/impl/KeyguardUpdateMonitor$MediaStateCallback;",
            ">;"
        }
    .end annotation
.end field  
- Cari baris berikut ".field private mWallpaperModeValue:I"
- Dan paste baris berikut dibawah baris tersebut
Code:
.field private timezone:Ljava/lang/String;
- Cari baris berikut ini
.method private handleSimStateChange(Lcom/android/internal/policy/impl/KeyguardUpdateMonitor$SimArgs;)V
- Diatas baris tersebut paste baris berikut ini

Code:
.method private handleMediaUpdate(IILandroid/net/Uri;)V
    .locals 5
    .parameter "isPlaying"
    .parameter "isStop"
    .parameter "mediaUri"

    .prologue
    const/4 v4, 0x0

    const/4 v3, 0x1

    .line 467
    if-ne p1, v3, :cond_0

    move v0, v3

    .line 468
    .local v0, bIsPlaying:Z
    :goto_0
    if-ne p2, v3, :cond_1

    move v1, v3

    .line 470
    .local v1, bIsStop:Z
    :goto_1
    const/4 v2, 0x0

    .local v2, i:I
    :goto_2
    iget-object v3, p0, Lcom/android/internal/policy/impl/KeyguardUpdateMonitor;->mMediaCallbacks:Ljava/util/ArrayList;

    invoke-virtual {v3}, Ljava/util/ArrayList;->size()I

    move-result v3

    if-ge v2, v3, :cond_2

    .line 471
    iget-object v3, p0, Lcom/android/internal/policy/impl/KeyguardUpdateMonitor;->mMediaCallbacks:Ljava/util/ArrayList;

    invoke-virtual {v3, v2}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v3

    check-cast v3, Lcom/android/internal/policy/impl/KeyguardUpdateMonitor$MediaStateCallback;

    invoke-interface {v3, v0, v1, p3}, Lcom/android/internal/policy/impl/KeyguardUpdateMonitor$MediaStateCallback;->onMediaUpdated(ZZLandroid/net/Uri;)V

    .line 470
    add-int/lit8 v2, v2, 0x1

    goto :goto_2

    .end local v0           #bIsPlaying:Z
    .end local v1           #bIsStop:Z
    .end local v2           #i:I
    :cond_0
    move v0, v4

    .line 467
    goto :goto_0

    .restart local v0       #bIsPlaying:Z
    :cond_1
    move v1, v4

    .line 468
    goto :goto_1

    .line 473
    .restart local v1       #bIsStop:Z
    .restart local v2       #i:I
    :cond_2
    return-void
.end method
- Cari baris berikut ini
.method public getFailedAttempts()I
- Di atas baris tesebut paste baris berikut ini
Code:
.method public getChangedTimeZone()Ljava/lang/String;
    .locals 1

    .prologue
    .line 1131
    iget-object v0, p0, Lcom/android/internal/policy/impl/KeyguardUpdateMonitor;->timezone:Ljava/lang/String;

    return-object v0
.end method


- Cari baris berikut ini
".method public isDevicePluggedIn()Z"

- Diatas baris tersebut paste baris berikut ini
Code:
.method public isDeviceCharged()Z
    .locals 2

    .prologue
    .line 866
    iget v0, p0, Lcom/android/internal/policy/impl/KeyguardUpdateMonitor;->mBatteryLevel:I

    const/16 v1, 0x64

    if-lt v0, v1, :cond_0

    const/4 v0, 0x1

    :goto_0
    return v0

    :cond_0
    const/4 v0, 0x0

    goto :goto_0
.end method
- Save
- Buka file LockPatternKeyguardView.smali dan cari baris berikut ini
".method createLockScreen()Landroid/view/View;" 
- Paste baris berikut setelah baris ini
.prologue
.line 868
const/4 v2, 0x0

    const/4 v0, 0x0

    iget-object v3, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mContext:Landroid/content/Context;

    invoke-virtual {v3}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v3

    const-string v4, "lockscreen_style_pref"

    invoke-static {v3, v4, v2}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I

    move-result v0

    const/4 v2, 0x1

    if-eq v2, v0, :cond_3

    const/4 v2, 0x2

    if-eq v2, v0, :cond_3

    const/4 v2, 0x3

    if-eq v2, v0, :cond_3

    const/4 v2, 0x4

    if-eq v2, v0, :cond_3

    const/4 v2, 0x5

    if-eq v2, v0, :cond_3

    if-eqz v0, :cond_0

    .line 869
    const/4 v2, 0x0

    const/4 v0, 0x0

    iget-object v3, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mContext:Landroid/content/Context;

    invoke-virtual {v3}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v3

    const-string v4, "lockscreen_style_pref"

    invoke-static {v3, v4, v2}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I

    move-result v0

    const/4 v2, 0x6

    if-eq v2, v0, :cond_2

    const/4 v2, 0x7

    if-eq v2, v0, :cond_1

    :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;->(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

    goto :goto_0

    :cond_1
    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;->(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

    goto :goto_0

    :cond_2
- Cari baris berikut ini
invoke-direct/range {v0 .. v5}, Lcom/android/internal/policy/impl/CircleLockScreen;->(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

- Paste baris berikut ini :goto_0
- Setelah baris "return-object v0" paste baris berikut ini
:cond_3
    new-instance v0, Lcom/android/internal/policy/impl/CyanogenLockScreen;

    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/CyanogenLockScreen;->(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

    goto :goto_0
- Save dan recompile file android.policy.jar setelah selesai copy file tersebut ke ponsel dan jangan lupa untuk mengcopy file LidroidParts.apk dan lidroid-res.apk

- File android.policy.jar dan lidroid-res.apk di copy ke folder system/framework
- File LidroidParts.apk di copy ke folder system/app

Backup terlebih dahulu Custom Rom yang sedang kamu gunakan sebelum melakukan modifikasi file android.policy.jar disarankan backup via CWM Recovery.


Semoga tutor ini bermanfaat