Please close streams!!!! #1143

Closed
wheijke opened this Issue Jan 22, 2016 · 2 comments

Comments

Projects
None yet
2 participants
@wheijke

wheijke commented Jan 22, 2016

Hi,
You need to close your streams!

 InputStream inStream = new FileInputStream(inFile);

In several places (SmaliBuilder, SmaliMod) these are not closed and are causing problems with my code!
Thanks,
Wouter

@wheijke

This comment has been minimized.

Show comment
Hide comment
@wheijke

wheijke Jan 22, 2016

Opened /tmp/mergingDirectory2909843626888556615.tmp/target/smali/com/cooltool/reflectioncontext/interaction/listeners/GetAllTrackIdsListener.smali by thread:main on Fri Jan 22 10:55:42 CET 2016
    at java.io.FileInputStream.<init>(FileInputStream.java:147)
    at brut.androlib.src.SmaliBuilder.buildFile(SmaliBuilder.java:66)
    at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:55)
    at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:41)
    at brut.androlib.Androlib.buildSourcesSmali(Androlib.java:378)
    at brut.androlib.Androlib.buildSources(Androlib.java:305)
    at brut.androlib.Androlib.build(Androlib.java:288)
    at brut.androlib.Androlib.build(Androlib.java:261)
    at com.my.cool.tool.tools.ApkMergeTool.makeTargetApk(ApkMergeTool.java:177)
    at com.my.cool.tool.tools.ApkMergeTool.merge(ApkMergeTool.java:217)
    at com.my.cool.tool.tools.PomApkUpdater.mergeApks(PomApkUpdater.java:154)
    at com.my.cool.tool.tools.PomApkUpdateTool.run(PomApkUpdateTool.java:153)
    at com.my.cool.tool.tools.PomApkUpdateTool.main(PomApkUpdateTool.java:96)
Opened /tmp/mergingDirectory2909843626888556615.tmp/target/smali/com/cooltool/reflectioncontext/interaction/listeners/GetAllTrackIdsListener.smali by thread:main on Fri Jan 22 10:55:42 CET 2016
    at java.io.FileInputStream.<init>(FileInputStream.java:147)
    at brut.androlib.mod.SmaliMod.assembleSmaliFile(SmaliMod.java:59)
    at brut.androlib.src.SmaliBuilder.buildFile(SmaliBuilder.java:70)
    at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:55)
    at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:41)
    at brut.androlib.Androlib.buildSourcesSmali(Androlib.java:378)
    at brut.androlib.Androlib.buildSources(Androlib.java:305)
    at brut.androlib.Androlib.build(Androlib.java:288)
    at brut.androlib.Androlib.build(Androlib.java:261)
    at com.my.cool.tool.tools.ApkMergeTool.makeTargetApk(ApkMergeTool.java:177)
    at com.my.cool.tool.tools.ApkMergeTool.merge(ApkMergeTool.java:217)
    at com.my.cool.tool.tools.PomApkUpdater.mergeApks(PomApkUpdater.java:154)
    at com.my.cool.tool.tools.PomApkUpdateTool.run(PomApkUpdateTool.java:153)
    at com.my.cool.tool.tools.PomApkUpdateTool.main(PomApkUpdateTool.java:96)

wheijke commented Jan 22, 2016

Opened /tmp/mergingDirectory2909843626888556615.tmp/target/smali/com/cooltool/reflectioncontext/interaction/listeners/GetAllTrackIdsListener.smali by thread:main on Fri Jan 22 10:55:42 CET 2016
    at java.io.FileInputStream.<init>(FileInputStream.java:147)
    at brut.androlib.src.SmaliBuilder.buildFile(SmaliBuilder.java:66)
    at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:55)
    at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:41)
    at brut.androlib.Androlib.buildSourcesSmali(Androlib.java:378)
    at brut.androlib.Androlib.buildSources(Androlib.java:305)
    at brut.androlib.Androlib.build(Androlib.java:288)
    at brut.androlib.Androlib.build(Androlib.java:261)
    at com.my.cool.tool.tools.ApkMergeTool.makeTargetApk(ApkMergeTool.java:177)
    at com.my.cool.tool.tools.ApkMergeTool.merge(ApkMergeTool.java:217)
    at com.my.cool.tool.tools.PomApkUpdater.mergeApks(PomApkUpdater.java:154)
    at com.my.cool.tool.tools.PomApkUpdateTool.run(PomApkUpdateTool.java:153)
    at com.my.cool.tool.tools.PomApkUpdateTool.main(PomApkUpdateTool.java:96)
Opened /tmp/mergingDirectory2909843626888556615.tmp/target/smali/com/cooltool/reflectioncontext/interaction/listeners/GetAllTrackIdsListener.smali by thread:main on Fri Jan 22 10:55:42 CET 2016
    at java.io.FileInputStream.<init>(FileInputStream.java:147)
    at brut.androlib.mod.SmaliMod.assembleSmaliFile(SmaliMod.java:59)
    at brut.androlib.src.SmaliBuilder.buildFile(SmaliBuilder.java:70)
    at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:55)
    at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:41)
    at brut.androlib.Androlib.buildSourcesSmali(Androlib.java:378)
    at brut.androlib.Androlib.buildSources(Androlib.java:305)
    at brut.androlib.Androlib.build(Androlib.java:288)
    at brut.androlib.Androlib.build(Androlib.java:261)
    at com.my.cool.tool.tools.ApkMergeTool.makeTargetApk(ApkMergeTool.java:177)
    at com.my.cool.tool.tools.ApkMergeTool.merge(ApkMergeTool.java:217)
    at com.my.cool.tool.tools.PomApkUpdater.mergeApks(PomApkUpdater.java:154)
    at com.my.cool.tool.tools.PomApkUpdateTool.run(PomApkUpdateTool.java:153)
    at com.my.cool.tool.tools.PomApkUpdateTool.main(PomApkUpdateTool.java:96)
@BurgerZ

This comment has been minimized.

Show comment
Hide comment
@BurgerZ

BurgerZ Jan 22, 2016

Contributor

Yep, agreed. A lot of streams stay open so you can't delete some folders and files from apk.

Contributor

BurgerZ commented Jan 22, 2016

Yep, agreed. A lot of streams stay open so you can't delete some folders and files from apk.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment