Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

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

OP xdabbeb

24th June 2014, 07:42 AM   |  #1  
xdabbeb's Avatar
OP Recognized Developer
Thanks Meter: 4,826
 
845 posts
Join Date:Joined: Sep 2010
Donate to Me
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 by xdabbeb; 24th June 2014 at 09:25 AM.
The Following 37 Users Say Thank You to xdabbeb For This Useful Post: [ View ]
24th June 2014, 10:10 AM   |  #2  
Senior Member
Flag Tangerang
Thanks Meter: 31
 
140 posts
Join Date:Joined: Feb 2012
More
wow. definitely not for noobs.
thanks for sharing though. I'll try messing with it soon.
24th June 2014, 10:30 AM   |  #3  
madmax59's Avatar
Senior Member
Thanks Meter: 76
 
270 posts
Join Date:Joined: Feb 2010
More
good job. thanks
24th June 2014, 10:58 AM   |  #4  
reemar's Avatar
Senior Member
Thanks Meter: 67
 
184 posts
Join Date:Joined: Jan 2014
Donate to Me
More
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..
24th June 2014, 12:56 PM   |  #5  
erto90's Avatar
Senior Member
Flag Firenze ( Florence )
Thanks Meter: 677
 
3,093 posts
Join Date:Joined: Jun 2008
Donate to Me
More
Hope someone will make an apk installer ( like your camera) to make it working easily on stock roms!
The Following 2 Users Say Thank You to erto90 For This Useful Post: [ View ]
24th June 2014, 06:22 PM   |  #6  
bender_007's Avatar
Senior Member
Thanks Meter: 1,648
 
2,343 posts
Join Date:Joined: Dec 2010
Donate to Me
More
Good job m8
The Following User Says Thank You to bender_007 For This Useful Post: [ View ]
24th June 2014, 07:46 PM   |  #7  
pendroz's Avatar
Senior Member
Flag Istanbul
Thanks Meter: 4,215
 
1,404 posts
Join Date:Joined: Jun 2012
Donate to Me
Thanks mate 😉

Sent from my LG-D802 using Tapatalk
24th June 2014, 08:35 PM   |  #8  
XxZombiePikachu's Avatar
Recognized Contributor
Flag Florida
Thanks Meter: 1,512
 
2,540 posts
Join Date:Joined: Jul 2013
More
Awesome sauce man, going to learn some smali now
26th June 2014, 05:21 PM   |  #9  
rastigo's Avatar
Senior Member
Flag Pune
Thanks Meter: 1,212
 
890 posts
Join Date:Joined: Apr 2013
More
@xdabbeb and @bender_007 brothers, please help us with either a flashable version or an apk please 8-)

Press thanks button if I was of any help / assistance to you
The Following 4 Users Say Thank You to rastigo For This Useful Post: [ View ]
26th June 2014, 05:25 PM   |  #10  
erto90's Avatar
Senior Member
Flag Firenze ( Florence )
Thanks Meter: 677
 
3,093 posts
Join Date:Joined: Jun 2008
Donate to Me
More
Apk and i make a statue in your honor
I got still stock recovery on 20b.. only rooted

Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes