[GUIDE] LG UI 2.0 weather widget porting guide to all roms

Search This thread

devilex94

Senior Member
Sep 24, 2011
383
433
Hi all
This is the guide to port LG weather widget found in optimus black to all roms like cm7

Requirements-
*A nice working rooted mobile phone
*A working PC with java installed
*apktool-[Simple guide by PulseDroid]


Note :This Guide is only for android 2.3 because many people having errors on android 4.0+. Sorry I have no workthrough :( . Try this widget ;). It's the widget from LG UI 3.0.

Procedure-
*Extract framework.jar from /system/framework/ through any root file manager.
*Decompile it through apktool, a newly created framework.jar.out will be there.

Code:
apktool d framework.jar
*Download LG smali.zip from attachment and extract it
*Copy "lge" from com folder of LG smali and paste it in framework.jar.out/smali/com ( in apktool folder )
It must be like this "framework.jar.out/smali/com/lge"
*Compile framework.jar.out

Code:
apktool b framework.jar.out
*Push the newly compiled framework.jar from apktool/framework.jar.out/dist into your phone's /system/framework directory
*Reboot your phone.Don't worry it will take time to reboot.
*Lastly Download the widget from here and install as regular app

gsmarena_002.jpg
 
Last edited:

Tsukidi

Member
Jul 12, 2012
18
0
Lisbon
Hi devilex94. Thank you for post on the other thread about the solution to my problem, but after read your guide I got really confused :D.
I don't know how to use apktool (already looked on XDA and Google but nothing is easy to understand). Went to cmd but it says that the path isn't right (grrr)...
I believe this really helps who understands programming but I don't know how to change frameworks :-/ already root my device, already extracted framework.jar from system... but after that I got stuck :(
 

西村大一

Senior Member
Dec 7, 2012
857
342
Sagamihara\Tōkyō
Hi devilex94. Thank you for post on the other thread about the solution to my problem, but after read your guide I got really confused :D.
I don't know how to use apktool (already looked on XDA and Google but nothing is easy to understand). Went to cmd but it says that the path isn't right (grrr)...
I believe this really helps who understands programming but I don't know how to change frameworks :-/ already root my device, already extracted framework.jar from system... but after that I got stuck :(

in the first command he forgot an "r" : framewok instead of framework.

your problem is that you need to cd to the directory of apktools. If the apktools is in C drive , the command is cd C:\apktools or any folder that is it in. if you have it in a series of folders it should be cd C:\your path to apktools and then do this tut.
 
  • Like
Reactions: devilex94

devilex94

Senior Member
Sep 24, 2011
383
433
in the first command he forgot an "r" : framewok instead of framework.

your problem is that you need to cd to the directory of apktools. If the apktools is in C drive , the command is cd C:\apktools or any folder that is it in. if you have it in a series of folders it should be cd C:\your path to apktools and then do this tut.
Thanks for telling me my mistake. :D
I have corrected my mistake
 

parambil

Member
Nov 21, 2012
12
1
Getting following error.



C:\Android\apktool>apktool b framework.jar.out
I: Checking whether sources has changed...
I: Smaling...
Exception in thread "main" org.jf.dexlib.Util.ExceptionWithContext: method index
is too large.
at org.jf.dexlib.Util.ExceptionWithContext.withContext(ExceptionWithCont
ext.java:54)
at org.jf.dexlib.Item.addExceptionContext(Item.java:176)
at org.jf.dexlib.Item.writeTo(Item.java:119)
at org.jf.dexlib.Section.writeTo(Section.java:119)
at org.jf.dexlib.DexFile.writeTo(DexFile.java:716)
at brut.androlib.src.DexFileBuilder.getAsByteArray(DexFileBuilder.java:7
5)
at brut.androlib.src.DexFileBuilder.writeTo(DexFileBuilder.java:58)
at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:50)
at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:35)
at brut.androlib.Androlib.buildSourcesSmali(Androlib.java:222)
at brut.androlib.Androlib.buildSources(Androlib.java:179)
at brut.androlib.Androlib.build(Androlib.java:170)
at brut.androlib.Androlib.build(Androlib.java:154)
at brut.apktool.Main.cmdBuild(Main.java:182)
at brut.apktool.Main.main(Main.java:67)
Caused by: java.lang.RuntimeException: method index is too large.
at org.jf.dexlib.Code.Format.Instruction35c.writeInstruction(Instruction
35c.java:102)
at org.jf.dexlib.Code.Instruction.write(Instruction.java:57)
at org.jf.dexlib.CodeItem.writeItem(CodeItem.java:258)
at org.jf.dexlib.Item.writeTo(Item.java:116)
... 12 more
code_item @0x1b3274 (Landroid/Manifest$permission;-><init>()V)


C:\Android\apktool>
 

raffmonster

Senior Member
Sep 27, 2012
59
20
New Delhi
framework.jar.out

When I decompile framework.jar, I only get apktool.yml in the out folder. There are no directories like smali. Do I need to create those and then copy the LGsmali?
 

Ciolouse

Senior Member
Apr 11, 2012
50
10
Bourges
Great ! this is really nice !

Do you have the same solution to port the Samsung Weather/Clock widget from GS3 to any roms ?

Thanks :D
 

y2quila

Senior Member
Sep 24, 2012
107
29
I tried the tutorial, installed the apk after but widget doesn't seem to fully load???

Sent from my GT-I9300 using xda premium
 

Attachments

  • uploadfromtaptalk1361179690147.jpg
    uploadfromtaptalk1361179690147.jpg
    44.6 KB · Views: 1,013

Black_Lion

Member
Dec 4, 2011
34
0
"Dist" is not created in my case :(
*Push the newly compiled framework.jar from apktool/framework.jar.out/dist
************************************************************************************************************************
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.

C:\Users\user>cd..

C:\Users>cd..

C:\>cd 'apktool'l/'directory'
The system cannot find the path specified.

C:\>cd android/apktool

C:\android\apktool>apktool d framework.jar
I: Baksmaling...
Exception in thread "main" java.lang.RuntimeException: bad magic value: 64 65 78
0a 30 33 36 00
at org.jf.dexlib.DexFile.<init>(DexFile.java:377)
at org.jf.dexlib.DexFile.<init>(DexFile.java:274)
at brut.androlib.src.SmaliDecoder.decode(SmaliDecoder.java:44)
at brut.androlib.src.SmaliDecoder.decode(SmaliDecoder.java:33)
at brut.androlib.Androlib.decodeSourcesSmali(Androlib.java:68)
at brut.androlib.ApkDecoder.decode(ApkDecoder.java:85)
at brut.apktool.Main.cmdDecode(Main.java:128)
at brut.apktool.Main.main(Main.java:65)

C:\android\apktool>apktool b framework.jar.out
Exception in thread "main" brut.androlib.AndrolibException: brut.directory.PathN
otExist: apktool.yml
at brut.androlib.Androlib.readMetaFile(Androlib.java:142)
at brut.androlib.Androlib.build(Androlib.java:159)
at brut.androlib.Androlib.build(Androlib.java:154)
at brut.apktool.Main.cmdBuild(Main.java:182)
at brut.apktool.Main.main(Main.java:67)
Caused by: brut.directory.PathNotExist: apktool.yml
at brut.directory.AbstractDirectory.getFileInput(AbstractDirectory.java:
103)
at brut.androlib.Androlib.readMetaFile(Androlib.java:138)
... 4 more
********************************************************************************************************************************************
Is sumthng went wrong in above process?
 
Last edited:

devilex94

Senior Member
Sep 24, 2011
383
433
"Dist" is not created in my case :(
*Push the newly compiled framework.jar from apktool/framework.jar.out/dist
************************************************************************************************************************
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.

C:\Users\user>cd..

C:\Users>cd..

C:\>cd 'apktool'l/'directory'
The system cannot find the path specified.

C:\>cd android/apktool

C:\android\apktool>apktool d framework.jar
I: Baksmaling...
Exception in thread "main" java.lang.RuntimeException: bad magic value: 64 65 78
0a 30 33 36 00
at org.jf.dexlib.DexFile.<init>(DexFile.java:377)
at org.jf.dexlib.DexFile.<init>(DexFile.java:274)
at brut.androlib.src.SmaliDecoder.decode(SmaliDecoder.java:44)
at brut.androlib.src.SmaliDecoder.decode(SmaliDecoder.java:33)
at brut.androlib.Androlib.decodeSourcesSmali(Androlib.java:68)
at brut.androlib.ApkDecoder.decode(ApkDecoder.java:85)
at brut.apktool.Main.cmdDecode(Main.java:128)
at brut.apktool.Main.main(Main.java:65)

C:\android\apktool>apktool b framework.jar.out
Exception in thread "main" brut.androlib.AndrolibException: brut.directory.PathN
otExist: apktool.yml
at brut.androlib.Androlib.readMetaFile(Androlib.java:142)
at brut.androlib.Androlib.build(Androlib.java:159)
at brut.androlib.Androlib.build(Androlib.java:154)
at brut.apktool.Main.cmdBuild(Main.java:182)
at brut.apktool.Main.main(Main.java:67)
Caused by: brut.directory.PathNotExist: apktool.yml
at brut.directory.AbstractDirectory.getFileInput(AbstractDirectory.java:
103)
at brut.androlib.Androlib.readMetaFile(Androlib.java:138)
... 4 more
********************************************************************************************************************************************
Is sumthng went wrong in above process?
Did you followed the apktool guide properly?
It seems that you didn't followed the apktool guide properly
EDIT: Check if you have installed the proper framework files
and I think that you are using a already themed rom
hence you getting the errors.
 
Last edited:

fshami

Senior Member
Oct 14, 2010
1,815
987
Dubai
Hiya mate, good work. Tried to make the mod for my sense 4 mod, got this error while recompiling:

C:\Users\nb>java -Xmx512M -jar smali.jar classout/ -o new-classes.dex

UNEXPECTED TOP-LEVEL EXCEPTION:
org.jf.dexlib.Util.ExceptionWithContext: method index is too large.
at org.jf.dexlib.Util.ExceptionWithContext.withContext(ExceptionWithContext.java:54)
at org.jf.dexlib.Item.addExceptionContext(Item.java:177)
at org.jf.dexlib.Item.writeTo(Item.java:120)
at org.jf.dexlib.Section.writeTo(Section.java:119)
at org.jf.dexlib.DexFile.writeTo(DexFile.java:716)
at org.jf.smali.main.main(main.java:231)
Caused by: java.lang.RuntimeException: method index is too large.
at org.jf.dexlib.Code.Format.Instruction35c.writeInstruction(Instruction35c.java:102)
at org.jf.dexlib.Code.Instruction.write(Instruction.java:57)
at org.jf.dexlib.CodeItem.writeItem(CodeItem.java:258)
at org.jf.dexlib.Item.writeTo(Item.java:117)
... 3 more
code_item @0x1e5a74 (Landroid/accessibilityservice/AccessibilityService$IEventListenerWrapper;->executeMessage(Landroid/os/Message;)V)

Any clue?
 

devilex94

Senior Member
Sep 24, 2011
383
433
Hiya mate, good work. Tried to make the mod for my sense 4 mod, got this error while recompiling:

C:\Users\nb>java -Xmx512M -jar smali.jar classout/ -o new-classes.dex

UNEXPECTED TOP-LEVEL EXCEPTION:
org.jf.dexlib.Util.ExceptionWithContext: method index is too large.
at org.jf.dexlib.Util.ExceptionWithContext.withContext(ExceptionWithContext.java:54)
at org.jf.dexlib.Item.addExceptionContext(Item.java:177)
at org.jf.dexlib.Item.writeTo(Item.java:120)
at org.jf.dexlib.Section.writeTo(Section.java:119)
at org.jf.dexlib.DexFile.writeTo(DexFile.java:716)
at org.jf.smali.main.main(main.java:231)
Caused by: java.lang.RuntimeException: method index is too large.
at org.jf.dexlib.Code.Format.Instruction35c.writeInstruction(Instruction35c.java:102)
at org.jf.dexlib.Code.Instruction.write(Instruction.java:57)
at org.jf.dexlib.CodeItem.writeItem(CodeItem.java:258)
at org.jf.dexlib.Item.writeTo(Item.java:117)
... 3 more
code_item @0x1e5a74 (Landroid/accessibilityservice/AccessibilityService$IEventListenerWrapper;->executeMessage(Landroid/os/Message;)V)

Any clue?
did you installed the framework files in apktool. It may help. :)
Give the results soon.
 

Annex1

Senior Member
Sep 9, 2009
668
1,631
Phoenix
Nice job! I always loved widgets even though they drain the battery just a bit more.
Thanks for the post
 

Top Liked Posts

  • There are no posts matching your filters.
  • 25
    Hi all
    This is the guide to port LG weather widget found in optimus black to all roms like cm7

    Requirements-
    *A nice working rooted mobile phone
    *A working PC with java installed
    *apktool-[Simple guide by PulseDroid]


    Note :This Guide is only for android 2.3 because many people having errors on android 4.0+. Sorry I have no workthrough :( . Try this widget ;). It's the widget from LG UI 3.0.

    Procedure-
    *Extract framework.jar from /system/framework/ through any root file manager.
    *Decompile it through apktool, a newly created framework.jar.out will be there.

    Code:
    apktool d framework.jar
    *Download LG smali.zip from attachment and extract it
    *Copy "lge" from com folder of LG smali and paste it in framework.jar.out/smali/com ( in apktool folder )
    It must be like this "framework.jar.out/smali/com/lge"
    *Compile framework.jar.out

    Code:
    apktool b framework.jar.out
    *Push the newly compiled framework.jar from apktool/framework.jar.out/dist into your phone's /system/framework directory
    *Reboot your phone.Don't worry it will take time to reboot.
    *Lastly Download the widget from here and install as regular app

    gsmarena_002.jpg
    1
    Hi devilex94. Thank you for post on the other thread about the solution to my problem, but after read your guide I got really confused :D.
    I don't know how to use apktool (already looked on XDA and Google but nothing is easy to understand). Went to cmd but it says that the path isn't right (grrr)...
    I believe this really helps who understands programming but I don't know how to change frameworks :-/ already root my device, already extracted framework.jar from system... but after that I got stuck :(

    in the first command he forgot an "r" : framewok instead of framework.

    your problem is that you need to cd to the directory of apktools. If the apktools is in C drive , the command is cd C:\apktools or any folder that is it in. if you have it in a series of folders it should be cd C:\your path to apktools and then do this tut.