• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

[MOD] [GUIDE] SplitWindow for G2 stock KK roms

Search This thread

xdabbeb

Inactive Recognized Developer
Sep 10, 2010
1,248
7,255
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 smali/baksmali v2.0.3
  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:
Code:
sput-boolean v0, Lgenerated/ConfigBuildBase;->CAPP_SPLITWINDOW:Z

and change the boolean to true like so:
Code:
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:
Code:
sput-boolean v0, Lgenerated/ConfigBuildBase;->CAPP_SPLITWINDOW:Z

and change the boolean to true like so:
Code:
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:
Code:
.field private static TAG:Ljava/lang/String;

so that it will now appear as:
Code:
# 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:
Code:
    const-string v0, "SplitWindowCreatorHelper"

    sput-object v0, Lcom/lge/loader/splitwindow/SplitWindowCreatorHelper;->TAG:Ljava/lang/String;

so that it will now apprear as:
Code:
    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

Code:
.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)
Code:
.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
Code:
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:
SplitWindow Files - G Pro 2
SplitWindow Files - G3

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

reemar

Senior Member
Jan 5, 2014
706
233
forum.xda-developers.com
if i will modify my installed pardus rom in my phone with that guide,
is it will work after xposed installer or it will cause trouble to use them both..
xposed and your guide..
should i disable xposed, modify by your guide and ten install xposed again or no need for that?

+If you could, post here a 1 or 2 screenshots..
 

bender_007

Senior Member
Dec 6, 2010
5,077
3,498
Osijek
@xdabbeb and @bender_007 brothers, please help us with either a flashable version or an apk please :cool:

Press thanks button if I was of any help / assistance to you :)

will look into it. - but getting "your" framework directory is hard :)
Can't create installer for all versions. It's possible to provide for most common or these I do own. CloudyG3 for example.
 
Last edited:

xdabbeb

Inactive Recognized Developer
Sep 10, 2010
1,248
7,255
There would not be a feasible way to make this mod work via an apk installer without serious risk as it requires direct replacement of core framework files. This is a pretty low-level mod so if you want it, you'll have to be rooted with a custom recovery. I do not want people to put their phones into an unusable state by attempting to do this without a recovery. It's just too risky.

As for making flashable zips: this requires modification of framework that is variant/firmware specific and would need to be odexed in most situations (as there are few if any deodexed stock LG roms). This means one would need to create a large number of zips to cover every possible variant/firmware combination. A few devs had asked me to write up a guide detailing how I accomplished this so that they could incorporate it into their own roms. I had already responded to one of rastigo's PMs regarding making flashable zips. I may consider making a couple for the more popular bases (F320K21p & D80220D), but this really should be handled by your individual variant/rom devs. If they run into problems they can get in touch with me and I will help them as soon as I am able to.

I realize that this is a fairly involved guide/mod with multiple chances to make small mistakes, but when followed exactly it does work. There has even been an individual with a LG GPad who followed the guide and got it working.
 

sotmax

Senior Member
Feb 26, 2010
2,897
5,334
Kefalinia island
There would not be a feasible way to make this mod work via an apk installer without serious risk as it requires direct replacement of core framework files. This is a pretty low-level mod so if you want it, you'll have to be rooted with a custom recovery. I do not want people to put their phones into an unusable state by attempting to do this without a recovery. It's just too risky.

As for making flashable zips: this requires modification of framework that is variant/firmware specific and would need to be odexed in most situations (as there are few if any deodexed stock LG roms). This means one would need to create a large number of zips to cover every possible variant/firmware combination. A few devs had asked me to write up a guide detailing how I accomplished this so that they could incorporate it into their own roms. I had already responded to one of rastigo's PMs regarding making flashable zips. I may consider making a couple for the more popular bases (F320K21p & D80220D), but this really should be handled by your individual variant/rom devs. If they run into problems they can get in touch with me and I will help them as soon as I am able to.

I realize that this is a fairly involved guide/mod with multiple chances to make small mistakes, but when followed exactly it does work. There has even been an individual with a LG GPad who followed the guide and got it working.


Totally agree.
I will help in any way on that....
Thank you for your efforts.. ;)
 

Matt927

Senior Member
May 19, 2009
57
16
Chambave (AO)
There would not be a feasible way to make this mod work via an apk installer without serious risk as it requires direct replacement of core framework files. This is a pretty low-level mod so if you want it, you'll have to be rooted with a custom recovery. I do not want people to put their phones into an unusable state by attempting to do this without a recovery. It's just too risky.

As for making flashable zips: this requires modification of framework that is variant/firmware specific and would need to be odexed in most situations (as there are few if any deodexed stock LG roms). This means one would need to create a large number of zips to cover every possible variant/firmware combination. A few devs had asked me to write up a guide detailing how I accomplished this so that they could incorporate it into their own roms. I had already responded to one of rastigo's PMs regarding making flashable zips. I may consider making a couple for the more popular bases (F320K21p & D80220D), but this really should be handled by your individual variant/rom devs. If they run into problems they can get in touch with me and I will help them as soon as I am able to.

I realize that this is a fairly involved guide/mod with multiple chances to make small mistakes, but when followed exactly it does work. There has even been an individual with a LG GPad who followed the guide and got it working.

When I try to launch splitview I see dualwindows fc ?

Inviato dal mio LG-D802 utilizzando Tapatalk
 

Top Liked Posts

  • There are no posts matching your filters.
  • 40
    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 smali/baksmali v2.0.3
    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:
    Code:
    sput-boolean v0, Lgenerated/ConfigBuildBase;->CAPP_SPLITWINDOW:Z

    and change the boolean to true like so:
    Code:
    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:
    Code:
    sput-boolean v0, Lgenerated/ConfigBuildBase;->CAPP_SPLITWINDOW:Z

    and change the boolean to true like so:
    Code:
    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:
    Code:
    .field private static TAG:Ljava/lang/String;

    so that it will now appear as:
    Code:
    # 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:
    Code:
        const-string v0, "SplitWindowCreatorHelper"
    
        sput-object v0, Lcom/lge/loader/splitwindow/SplitWindowCreatorHelper;->TAG:Ljava/lang/String;

    so that it will now apprear as:
    Code:
        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

    Code:
    .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)
    Code:
    .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
    Code:
    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:
    SplitWindow Files - G Pro 2
    SplitWindow Files - G3

    The only real difference between them is the color of the outline box
    9
    UPDATE Working splitview G3 STLYE AND GPRO2 STYLE

    Hurrah, i managed to get the mod working on stock kk 20b indian rom. Works perfectly fine.

    THERE ARE 2 STYLES COMPILED BY ME:

    1. G PRO2 STYLE (1ST 3 PICTURES)
    2. G3 STYLE (4TH PICTURE)

    THE ONLY DIFFERENCE BETWEEN THE 2 IS THE OUTER BORDER COLOR.



    Thanks to @xdabbeb for the guide and @sotmax for the help

    IF YOU LOOSE DATA OR EXPERIENCE CRASHES, BOOTLOOP, I AM NOT RESPONSIBLE. FLASH AT YOUR OWN RISK...PL MAKE BACKUP BEFORE FLASHING.

    I HAVE FLASHED IT ON MY PHONE AND IT WORKS FLAWLESSLY



    I dont know if this will work for everyone. I have created for my stock kk rom 20b indian. Please try and revert if it works....

    DOWNLOAD GPRO2 STYLE

    DOWNLOAD G3 STYLE
    8
    Toolkit for automated creation of SplitWindow mod

    Toolkit for automated creation of SplitWindow mod
    (provided 'AS IS' without any guarantee)

    Requirements:
    • OS Linux
    • LG G2, connected to PC, with USB debugging enabled, authorized (the 'adb devices' command must print out `device` instead of `unauthorized`).
    • Backup of '/system' for emergency. In fact, the first script does not write anything to the phone at all, the second one restores all modified files, but 'just in case'.

    Description:
    This toolset can make SplitWindow mod for any LG G2 devices. You just need to connect the phone to PC, make sure if USB debugging is enabled and device is authorized, and run 2 included scripts one by another.

    The first script 'step_1' does the following:
    1. Determines BOOTCLASSPATH and store it to output/bcp.env file for furfer use.
    2. Downloads all necessary files from the phone if it was not done before.
    3. Baksmali telephony-common.jar and com.lge.frameworks.jar.
    4. Patches them.
    5. Compiles them back.
    6. Packs them as output/splitwindow_mod_##_deodexed.zip files for GPro2 and G3 themes. These files can be installed via recovery mode to DEODEXED ROM's ONLY!!!
    When the script finished you will have deodexed patched files. They can work only on deodexed ROMs only. If your ROM is odexed (the most of stock ROMs are odexed) you have to run 'step_2' script.
    It will do:
    1. Check if BOOTCLASSPATH was previously stored to output/bcp.env file on step_1 task.
    2. Reboot the phone into recovery mode if it's not in recovery already.
    3. Mount /system in rw mode.
    4. Upload ODEX tool.
    5. Upload deodexed telephony-common.jar and com.lge.frameworks.jar files.
    6. ODEX them and copy old signatures from previous odex files.
    7. Download new odex files back to PC.
    8. Restore modified files on the phone, so they will not be affected by the process.
    9. Pack them as to output/splitwindow_mod_##_odexed.zip files for GPro2 and G3 themes. These files are suitable to install via recovery to ODEXED ROMs ONLY!!!
    After that you should look for *_odexed.zip files in the output directory, upload one of them to the phone and install it via standard procedure using recovery mode. DO NOT FORGET MAKE BACKUPs of '/system' partition before installing!!!

    Reboot your phone and check the section "Multitasking" in phone settings to enable new functionality. After that long press "Back" button and enjoy. :)

    Special credits to:
    xdabbeb for his guide how to make this mod - http://forum.xda-developers.com/showthread.php?t=2792938
    roma21515 for sample port to LS980 - http://4pda.ru/forum/index.php?showtopic=530354&view=findpost&p=32578750
    alkhafaf for the guide how to odex - http://forum.xda-developers.com/showthread.php?t=1879128

    Download:
    5
    In addition to 'Toolkit for automated creation of SplitWindow MOD' (I posted earlier in this thread) I've developed the APK which does the same thing. so PC is not needed anymore for creation of this MOD. All necessary actions can be executed right on the device.

    Please visit the thread "[MOD] [APK] SplitWindow MOD Maker for G2 stock [KK] roms".

    I think it's great that you're trying to help, but for future reference you should ask for permission for something like this first (which you didn't) and though I'm not sure why a new thread was needed in the first place it certainly isn't good etiquette to post in someone else's just to redirect people to yours.
    4
    There would not be a feasible way to make this mod work via an apk installer without serious risk as it requires direct replacement of core framework files. This is a pretty low-level mod so if you want it, you'll have to be rooted with a custom recovery. I do not want people to put their phones into an unusable state by attempting to do this without a recovery. It's just too risky.

    As for making flashable zips: this requires modification of framework that is variant/firmware specific and would need to be odexed in most situations (as there are few if any deodexed stock LG roms). This means one would need to create a large number of zips to cover every possible variant/firmware combination. A few devs had asked me to write up a guide detailing how I accomplished this so that they could incorporate it into their own roms. I had already responded to one of rastigo's PMs regarding making flashable zips. I may consider making a couple for the more popular bases (F320K21p & D80220D), but this really should be handled by your individual variant/rom devs. If they run into problems they can get in touch with me and I will help them as soon as I am able to.

    I realize that this is a fairly involved guide/mod with multiple chances to make small mistakes, but when followed exactly it does work. There has even been an individual with a LG GPad who followed the guide and got it working.