1. Rom Samsung Galaxy S8/S8+ Hot Hot 2017 CLICK

    Rom Samsung Galaxy Note 4 Hot Hot 2017 CLICK

    Rom Samsung Galaxy S7 Hot Hot 2017 CLICK

    Hướng dẫn MOD ROM miễn phí CLICK

Dev Mod Split window - Cách 2

Thảo luận trong 'Android Developer' bắt đầu bởi vandieutot, 6/11/14.

  1. vandieutot

    vandieutot Người đưa tin
    Ban Quản Trị

    Date:
    5/8/14
    Posts:
    7,088
    Likes:
    10,257
    Sorry it took so long for me to write this up.

    Following these steps will allow you to add the full split window implementation from the GPro2 and G3 KK roms that for whatever reason LG decided to leave (mostly) out of the stock G2 4.4.x roms. This guide is geared more towards rom devs or people that are familiar with using smali/baksmali and doing minor dalvik/smali edits.


    Prerequisites:
    1. Get Mời bạn đăng nhập để thấy Link
    2. Get a copy of the framework directory for the rom you're implementing this on
    3. Download the source files/zip linked below


    Quick notes on smali/baksmali usage:
    • If you're running baksmali on an odex your basic command to use for this guide is baksmali -a 19 -b -d <path/to/framework/dir> -o <path/to/baksmali/outdir> - x filename.odex
    • If you're working with an extracted classes.dex (i.e. from from roms that support art) it's just baksmali -a 19 -b -o <path/to/baksmali/outdir> classes.dex
    • The basic smali command to use for these purposes is smali -a 19 -o classes.dex <path/to/baksmali/outdir>


    Step 1:
    Baksmali telephony-common (from your framework dir) and find the following line in generated/ConfigBuildBase.smali:
    Mã:
    sput-boolean v0, Lgenerated/ConfigBuildBase;->CAPP_SPLITWINDOW:Z
    and change the boolean to true like so:
    Mã:
    sput-boolean v1, Lgenerated/ConfigBuildBase;->CAPP_SPLITWINDOW:Z
    Step 2:
    Smali that file back to a new classes.dex and zip it back into telephony-common.jar

    Step 3:
    Baksmali com.lge.frameworks and find the same line in generated/ConfigBuildBase.smali:
    Mã:
    sput-boolean v0, Lgenerated/ConfigBuildBase;->CAPP_SPLITWINDOW:Z
    and change the boolean to true like so:
    Mã:
    sput-boolean v1, Lgenerated/ConfigBuildBase;->CAPP_SPLITWINDOW:Z
    Step 4:
    Open up com/lge/loader/splitwindow/SplitWindowCreatorHelper.smali and add the following to your static fields declarations:
    Mã:
    .field private static TAG:Ljava/lang/String;
    so that it will now appear as:
    Mã:
    # static fields
    .field private static SPLITWINDOW_INSTANCE:Lcom/lge/loader/splitwindow/ISplitWindow;
    
    .field private static TAG:Ljava/lang/String;
    
    
    Step 5:
    In the same smali file a few lines down, you'll need to add the following to your direct methods:
    Mã:
        const-string v0, "SplitWindowCreatorHelper"
    
        sput-object v0, Lcom/lge/loader/splitwindow/SplitWindowCreatorHelper;->TAG:Ljava/lang/String;
    
    
    so that it will now apprear as:
    Mã:
        sput-object v0, Lcom/lge/loader/splitwindow/SplitWindowCreatorHelper;->SPLITWINDOW_INSTANCE:Lcom/lge/loader/splitwindow/ISplitWindow;
    
        const-string v0, "SplitWindowCreatorHelper"
    
        sput-object v0, Lcom/lge/loader/splitwindow/SplitWindowCreatorHelper;->TAG:Ljava/lang/String;
    
        return-void
    .end method
    
    Step 6:
    Again, in the same smali scroll all the way down as you'll need to add the following public method at the end of the file:
    * keep in mind you'll need to keep a blank line between the .end method above and this new method below

    Mã:
    .method public static recoverService()Lcom/lge/loader/splitwindow/ISplitWindow$ISplitWindowPolicy;
        .registers 4
    
        const/4 v3, 0x0
    
        sget-object v1, Lcom/lge/loader/splitwindow/SplitWindowCreatorHelper;->TAG:Ljava/lang/String;
    
        const-string v2, "recoverService"
    
        invoke-static {v1, v2}, Landroid/util/Slog;->w(Ljava/lang/String;Ljava/lang/String;)I
    
        sget-object v1, Lcom/lge/loader/splitwindow/SplitWindowCreatorHelper;->SPLITWINDOW_INSTANCE:Lcom/lge/loader/splitwindow/ISplitWindow;
    
        if-eqz v1, :cond_20
    
        sget-object v1, Lcom/lge/loader/RuntimeLibraryLoader;->SPLIT_WINDOW:Ljava/lang/String;
    
        invoke-static {v1}, Lcom/lge/loader/RuntimeLibraryLoader;->getCreator(Ljava/lang/String;)Lcom/lge/loader/InstanceCreator;
    
        move-result-object v0
    
        if-eqz v0, :cond_1e
    
        invoke-virtual {v0, v3}, Lcom/lge/loader/InstanceCreator;->setDefaultInstance(Ljava/lang/Object;)V
    
        sget-object v1, Lcom/lge/loader/splitwindow/SplitWindowCreatorHelper;->TAG:Ljava/lang/String;
    
        const-string v2, "Set default InstanceCreator as null to make NEW instance"
    
        invoke-static {v1, v2}, Landroid/util/Slog;->v(Ljava/lang/String;Ljava/lang/String;)I
    
        :cond_1e
        sput-object v3, Lcom/lge/loader/splitwindow/SplitWindowCreatorHelper;->SPLITWINDOW_INSTANCE:Lcom/lge/loader/splitwindow/ISplitWindow;
    
        :cond_20
        invoke-static {}, Lcom/lge/loader/splitwindow/SplitWindowCreatorHelper;->getPolicyService()Lcom/lge/loader/splitwindow/ISplitWindow$ISplitWindowPolicy;
    
        move-result-object v1
    
        return-object v1
    .end method
    
    Step 7:
    Open up com/lge/loader/splitwindow/ISplitWindow$ISplitWindowPolicy.smali and add the following public method after the getMinimumScreenSize public method (again, minding your blank lines)
    Mã:
    .method public abstract getRecentStackBoxes()Ljava/util/List;
        .annotation system Ldalvik/annotation/Signature;
            value = {
                "()",
                "Ljava/util/List",
                "<",
                "Landroid/app/ActivityManager$StackBoxInfo;",
                ">;"
            }
        .end annotation
    .end method
    
    Step 8:
    Smali all of that to a new classes.dex and zip it back into com.lge.frameworks.jar

    Step 9:
    Put your newly modified com.lge.frameworks.jar and telephony-common.jar into place (I also re-odex them and copy the original signatures over)

    Step 10:
    Put all of the files contained in the download provided below into their respective directories with the proper permissions (644 all around)

    Step 11:
    Add the following two lines to your build.prop
    Mã:
    ro.lge.capp_splitwindow=true
    persist.splitwindow.support_all=true
    
    * if you don't want all apps showing up in the selection window, change support_all to false

    That's it...you should be good to go. There's always the possibility that your framework will be slightly different, but that's the general idea and you should be able to make small changes to adjust to your particular variant



    Feel free to include this in your roms (that's why I posted it). Just give credit in your OP.

    Downloads:
    Mời bạn đăng nhập để thấy Link
    Mời bạn đăng nhập để thấy Link

    The only real difference between them is the color of the outline box

    Nguồn: Mời bạn đăng nhập để thấy Link
     
    Đang tải...
  2. HenRy pham

    HenRy pham Developer

    Date:
    30/9/14
    Posts:
    578
    Likes:
    2,418
    Hiểu chết liền .. E mù tịt
     
    Thành Nhân and vandieutot like this.
  3. vandieutot

    vandieutot Người đưa tin
    Ban Quản Trị

    Date:
    5/8/14
    Posts:
    7,088
    Likes:
    10,257
    bài này để cho người nước ngoài họ nhìn vào và làm thôi bạn à. Chúng ta người việt nam làm cách 1 cho nhanh và dễ
     
    Thành Nhân and HenRy pham like this.
  4. it's me

    it's me LV 1

    Date:
    12/10/14
    Posts:
    74
    Likes:
    443
    Chịu
     
    Thành Nhân thích bài này.
  5. chakcoralvine

    Date:
    26/10/14
    Posts:
    62
    Likes:
    67
    Cách 1 chỉ máy đời cao thôi, hình như LU của e kham k nổi, để thử cách 2 xem :D
     
    Thành Nhân, Tonny Cuong and thangio like this.
  6. thangio

    thangio LV 2

    Date:
    4/9/14
    Posts:
    163
    Likes:
    123
    Mọi người làm cách 2 xem sao cách 1 có vẻ hơi nặng cho máy đời thấp thì phải
     
    Thành Nhân thích bài này.
  7. Thành Nhân

    Date:
    16/8/14
    Posts:
    1,668
    Likes:
    1,748
    E thua
     
    sieunhan and HenRy pham like this.
  8. HenRy pham

    HenRy pham Developer

    Date:
    30/9/14
    Posts:
    578
    Likes:
    2,418
    Lm cach 1 dc rồi lm cach 2 chicho thua em ạ
     
    sieunhan thích bài này.
  9. sieunhan

    sieunhan LV 4

    Date:
    4/9/14
    Posts:
    1,629
    Likes:
    1,560
    thua thì làm cách 1 bạn nhé
     
    Thành Nhân thích bài này.
  10. sieunhan

    sieunhan LV 4

    Date:
    4/9/14
    Posts:
    1,629
    Likes:
    1,560
    cái cách 2 chắc là cho mấy ông tây đọc đây mà
     
    Thành Nhân thích bài này.
  11. HenRy pham

    HenRy pham Developer

    Date:
    30/9/14
    Posts:
    578
    Likes:
    2,418
    Chứ ng việt đọc loài cả mắt mơi hieu
     
    Thành Nhân and sieunhan like this.
  12. sieunhan

    sieunhan LV 4

    Date:
    4/9/14
    Posts:
    1,629
    Likes:
    1,560
    he 4rum sccn hướng tới cả người tiêu dùng nước ngoài rồi :)
     
    Thành Nhân and HenRy pham like this.
  13. Thành Nhân

    Date:
    16/8/14
    Posts:
    1,668
    Likes:
    1,748
    Vậy mới dữ chứ a
     
    sieunhan and HenRy pham like this.
  14. sieunhan

    sieunhan LV 4

    Date:
    4/9/14
    Posts:
    1,629
    Likes:
    1,560
    mình đọc mà cũng không hiểu khoai ngô gì luôn :)
     
  15. HenRy pham

    HenRy pham Developer

    Date:
    30/9/14
    Posts:
    578
    Likes:
    2,418
    Thế đọc kiểu củ chuối đi sẽhiểu ngay
     

Like & Share