mirror of
https://github.com/revanced/Apktool.git
synced 2025-01-23 02:07:36 +01:00
Merge branch 'MarcMil-master'
This commit is contained in:
commit
af1e24be64
@ -187,6 +187,11 @@ public class Main {
|
|||||||
} catch (DirectoryException ex) {
|
} catch (DirectoryException ex) {
|
||||||
System.err.println("Could not modify internal dex files. Please ensure you have permission.");
|
System.err.println("Could not modify internal dex files. Please ensure you have permission.");
|
||||||
System.exit(1);
|
System.exit(1);
|
||||||
|
} finally {
|
||||||
|
try {
|
||||||
|
decoder.close();
|
||||||
|
} catch (IOException e) {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -741,6 +741,10 @@ public class Androlib {
|
|||||||
return files;
|
return files;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void close() throws IOException {
|
||||||
|
mAndRes.close();
|
||||||
|
}
|
||||||
|
|
||||||
private final static Logger LOGGER = Logger.getLogger(Androlib.class.getName());
|
private final static Logger LOGGER = Logger.getLogger(Androlib.class.getName());
|
||||||
|
|
||||||
private final static String SMALI_DIRNAME = "smali";
|
private final static String SMALI_DIRNAME = "smali";
|
||||||
|
@ -60,6 +60,12 @@ public class ApkDecoder {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void setApkFile(File apkFile) {
|
public void setApkFile(File apkFile) {
|
||||||
|
if (mApkFile != null) {
|
||||||
|
try {
|
||||||
|
mApkFile.close();
|
||||||
|
} catch (IOException ignored) {}
|
||||||
|
}
|
||||||
|
|
||||||
mApkFile = new ExtFile(apkFile);
|
mApkFile = new ExtFile(apkFile);
|
||||||
mResTable = null;
|
mResTable = null;
|
||||||
}
|
}
|
||||||
@ -73,93 +79,99 @@ public class ApkDecoder {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void decode() throws AndrolibException, IOException, DirectoryException {
|
public void decode() throws AndrolibException, IOException, DirectoryException {
|
||||||
File outDir = getOutDir();
|
|
||||||
AndrolibResources.sKeepBroken = mKeepBrokenResources;
|
|
||||||
|
|
||||||
if (!mForceDelete && outDir.exists()) {
|
|
||||||
throw new OutDirExistsException();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!mApkFile.isFile() || !mApkFile.canRead()) {
|
|
||||||
throw new InFileNotFoundException();
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
OS.rmdir(outDir);
|
File outDir = getOutDir();
|
||||||
} catch (BrutException ex) {
|
AndrolibResources.sKeepBroken = mKeepBrokenResources;
|
||||||
throw new AndrolibException(ex);
|
|
||||||
}
|
|
||||||
outDir.mkdirs();
|
|
||||||
|
|
||||||
LOGGER.info("Using Apktool " + Androlib.getVersion() + " on " + mApkFile.getName());
|
if (!mForceDelete && outDir.exists()) {
|
||||||
|
throw new OutDirExistsException();
|
||||||
if (hasResources()) {
|
|
||||||
switch (mDecodeResources) {
|
|
||||||
case DECODE_RESOURCES_NONE:
|
|
||||||
mAndrolib.decodeResourcesRaw(mApkFile, outDir);
|
|
||||||
break;
|
|
||||||
case DECODE_RESOURCES_FULL:
|
|
||||||
setTargetSdkVersion();
|
|
||||||
setAnalysisMode(mAnalysisMode, true);
|
|
||||||
|
|
||||||
if (hasManifest()) {
|
|
||||||
mAndrolib.decodeManifestWithResources(mApkFile, outDir, getResTable());
|
|
||||||
}
|
|
||||||
mAndrolib.decodeResourcesFull(mApkFile, outDir, getResTable());
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
// if there's no resources.asrc, decode the manifest without looking
|
if (!mApkFile.isFile() || !mApkFile.canRead()) {
|
||||||
// up attribute references
|
throw new InFileNotFoundException();
|
||||||
if (hasManifest()) {
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
OS.rmdir(outDir);
|
||||||
|
} catch (BrutException ex) {
|
||||||
|
throw new AndrolibException(ex);
|
||||||
|
}
|
||||||
|
outDir.mkdirs();
|
||||||
|
|
||||||
|
LOGGER.info("Using Apktool " + Androlib.getVersion() + " on " + mApkFile.getName());
|
||||||
|
|
||||||
|
if (hasResources()) {
|
||||||
switch (mDecodeResources) {
|
switch (mDecodeResources) {
|
||||||
case DECODE_RESOURCES_NONE:
|
case DECODE_RESOURCES_NONE:
|
||||||
mAndrolib.decodeManifestRaw(mApkFile, outDir);
|
mAndrolib.decodeResourcesRaw(mApkFile, outDir);
|
||||||
break;
|
break;
|
||||||
case DECODE_RESOURCES_FULL:
|
case DECODE_RESOURCES_FULL:
|
||||||
mAndrolib.decodeManifestFull(mApkFile, outDir,
|
setTargetSdkVersion();
|
||||||
getResTable());
|
setAnalysisMode(mAnalysisMode, true);
|
||||||
|
|
||||||
|
if (hasManifest()) {
|
||||||
|
mAndrolib.decodeManifestWithResources(mApkFile, outDir, getResTable());
|
||||||
|
}
|
||||||
|
mAndrolib.decodeResourcesFull(mApkFile, outDir, getResTable());
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// if there's no resources.asrc, decode the manifest without looking
|
||||||
|
// up attribute references
|
||||||
|
if (hasManifest()) {
|
||||||
|
switch (mDecodeResources) {
|
||||||
|
case DECODE_RESOURCES_NONE:
|
||||||
|
mAndrolib.decodeManifestRaw(mApkFile, outDir);
|
||||||
|
break;
|
||||||
|
case DECODE_RESOURCES_FULL:
|
||||||
|
mAndrolib.decodeManifestFull(mApkFile, outDir,
|
||||||
|
getResTable());
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (hasSources()) {
|
||||||
|
switch (mDecodeSources) {
|
||||||
|
case DECODE_SOURCES_NONE:
|
||||||
|
mAndrolib.decodeSourcesRaw(mApkFile, outDir, "classes.dex");
|
||||||
|
break;
|
||||||
|
case DECODE_SOURCES_SMALI:
|
||||||
|
mAndrolib.decodeSourcesSmali(mApkFile, outDir, "classes.dex", mBakDeb, mApi);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (hasSources()) {
|
if (hasMultipleSources()) {
|
||||||
switch (mDecodeSources) {
|
// foreach unknown dex file in root, lets disassemble it
|
||||||
case DECODE_SOURCES_NONE:
|
Set<String> files = mApkFile.getDirectory().getFiles(true);
|
||||||
mAndrolib.decodeSourcesRaw(mApkFile, outDir, "classes.dex");
|
for (String file : files) {
|
||||||
break;
|
if (file.endsWith(".dex")) {
|
||||||
case DECODE_SOURCES_SMALI:
|
if (! file.equalsIgnoreCase("classes.dex")) {
|
||||||
mAndrolib.decodeSourcesSmali(mApkFile, outDir, "classes.dex", mBakDeb, mApi);
|
switch(mDecodeSources) {
|
||||||
break;
|
case DECODE_SOURCES_NONE:
|
||||||
}
|
mAndrolib.decodeSourcesRaw(mApkFile, outDir, file);
|
||||||
}
|
break;
|
||||||
|
case DECODE_SOURCES_SMALI:
|
||||||
if (hasMultipleSources()) {
|
mAndrolib.decodeSourcesSmali(mApkFile, outDir, file, mBakDeb, mApi);
|
||||||
// foreach unknown dex file in root, lets disassemble it
|
break;
|
||||||
Set<String> files = mApkFile.getDirectory().getFiles(true);
|
}
|
||||||
for (String file : files) {
|
|
||||||
if (file.endsWith(".dex")) {
|
|
||||||
if (! file.equalsIgnoreCase("classes.dex")) {
|
|
||||||
switch(mDecodeSources) {
|
|
||||||
case DECODE_SOURCES_NONE:
|
|
||||||
mAndrolib.decodeSourcesRaw(mApkFile, outDir, file);
|
|
||||||
break;
|
|
||||||
case DECODE_SOURCES_SMALI:
|
|
||||||
mAndrolib.decodeSourcesSmali(mApkFile, outDir, file, mBakDeb, mApi);
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
mAndrolib.decodeRawFiles(mApkFile, outDir);
|
mAndrolib.decodeRawFiles(mApkFile, outDir);
|
||||||
mAndrolib.decodeUnknownFiles(mApkFile, outDir, mResTable);
|
mAndrolib.decodeUnknownFiles(mApkFile, outDir, mResTable);
|
||||||
mUncompressedFiles = new ArrayList<String>();
|
mUncompressedFiles = new ArrayList<String>();
|
||||||
mAndrolib.recordUncompressedFiles(mApkFile, mUncompressedFiles);
|
mAndrolib.recordUncompressedFiles(mApkFile, mUncompressedFiles);
|
||||||
mAndrolib.writeOriginalFiles(mApkFile, outDir);
|
mAndrolib.writeOriginalFiles(mApkFile, outDir);
|
||||||
writeMetaFile();
|
writeMetaFile();
|
||||||
|
} finally {
|
||||||
|
try {
|
||||||
|
mApkFile.close();
|
||||||
|
} catch (IOException ignored) {}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDecodeSources(short mode) throws AndrolibException {
|
public void setDecodeSources(short mode) throws AndrolibException {
|
||||||
@ -273,6 +285,10 @@ public class ApkDecoder {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void close() throws IOException {
|
||||||
|
mAndrolib.close();
|
||||||
|
}
|
||||||
|
|
||||||
public final static short DECODE_SOURCES_NONE = 0x0000;
|
public final static short DECODE_SOURCES_NONE = 0x0000;
|
||||||
public final static short DECODE_SOURCES_SMALI = 0x0001;
|
public final static short DECODE_SOURCES_SMALI = 0x0001;
|
||||||
|
|
||||||
|
@ -121,7 +121,8 @@ final public class AndrolibResources {
|
|||||||
File apk = getFrameworkApk(id, frameTag);
|
File apk = getFrameworkApk(id, frameTag);
|
||||||
|
|
||||||
LOGGER.info("Loading resource table from file: " + apk);
|
LOGGER.info("Loading resource table from file: " + apk);
|
||||||
ResPackage[] pkgs = getResPackagesFromApk(new ExtFile(apk), resTable, true);
|
mFramework = new ExtFile(apk);
|
||||||
|
ResPackage[] pkgs = getResPackagesFromApk(mFramework, resTable, true);
|
||||||
|
|
||||||
ResPackage pkg;
|
ResPackage pkg;
|
||||||
if (pkgs.length > 1) {
|
if (pkgs.length > 1) {
|
||||||
@ -555,8 +556,15 @@ final public class AndrolibResources {
|
|||||||
private ResPackage[] getResPackagesFromApk(ExtFile apkFile,ResTable resTable, boolean keepBroken)
|
private ResPackage[] getResPackagesFromApk(ExtFile apkFile,ResTable resTable, boolean keepBroken)
|
||||||
throws AndrolibException {
|
throws AndrolibException {
|
||||||
try {
|
try {
|
||||||
BufferedInputStream bfi = new BufferedInputStream(apkFile.getDirectory().getFileInput("resources.arsc"));
|
Directory dir = apkFile.getDirectory();
|
||||||
return ARSCDecoder.decode(bfi, false, keepBroken, resTable).getPackages();
|
BufferedInputStream bfi = new BufferedInputStream(dir.getFileInput("resources.arsc"));
|
||||||
|
try {
|
||||||
|
return ARSCDecoder.decode(bfi, false, keepBroken, resTable).getPackages();
|
||||||
|
} finally {
|
||||||
|
try {
|
||||||
|
bfi.close();
|
||||||
|
} catch (IOException ignored) {}
|
||||||
|
}
|
||||||
} catch (DirectoryException ex) {
|
} catch (DirectoryException ex) {
|
||||||
throw new AndrolibException("Could not load resources.arsc from file: " + apkFile, ex);
|
throw new AndrolibException("Could not load resources.arsc from file: " + apkFile, ex);
|
||||||
}
|
}
|
||||||
@ -810,6 +818,10 @@ final public class AndrolibResources {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void close() throws IOException {
|
||||||
|
mFramework.close();
|
||||||
|
}
|
||||||
|
|
||||||
public ApkOptions apkOptions;
|
public ApkOptions apkOptions;
|
||||||
|
|
||||||
// TODO: dirty static hack. I have to refactor decoding mechanisms.
|
// TODO: dirty static hack. I have to refactor decoding mechanisms.
|
||||||
@ -819,6 +831,8 @@ final public class AndrolibResources {
|
|||||||
|
|
||||||
private File mFrameworkDirectory = null;
|
private File mFrameworkDirectory = null;
|
||||||
|
|
||||||
|
private ExtFile mFramework = null;
|
||||||
|
|
||||||
private String mMinSdkVersion = null;
|
private String mMinSdkVersion = null;
|
||||||
private String mMaxSdkVersion = null;
|
private String mMaxSdkVersion = null;
|
||||||
private String mTargetSdkVersion = null;
|
private String mTargetSdkVersion = null;
|
||||||
|
@ -48,12 +48,12 @@ public class SmaliDecoder {
|
|||||||
|
|
||||||
private void decode() throws AndrolibException {
|
private void decode() throws AndrolibException {
|
||||||
try {
|
try {
|
||||||
BaksmaliOptions options = new BaksmaliOptions();
|
final BaksmaliOptions options = new BaksmaliOptions();
|
||||||
|
|
||||||
// options
|
// options
|
||||||
options.deodex = false;
|
options.deodex = false;
|
||||||
options.implicitReferences = false;
|
options.implicitReferences = false;
|
||||||
options.parameterRegisters = false;
|
options.parameterRegisters = true;
|
||||||
options.localsDirective = true;
|
options.localsDirective = true;
|
||||||
options.sequentialLabels = true;
|
options.sequentialLabels = true;
|
||||||
options.debugInfo = mBakDeb;
|
options.debugInfo = mBakDeb;
|
||||||
|
@ -0,0 +1,103 @@
|
|||||||
|
package brut.androlib;
|
||||||
|
|
||||||
|
import brut.common.BrutException;
|
||||||
|
import brut.directory.ExtFile;
|
||||||
|
import brut.util.OS;
|
||||||
|
import org.junit.AfterClass;
|
||||||
|
import org.junit.BeforeClass;
|
||||||
|
import org.junit.Test;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.nio.file.Files;
|
||||||
|
import java.nio.file.Paths;
|
||||||
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
|
import static org.junit.Assert.assertEquals;
|
||||||
|
|
||||||
|
public class DefaultBaksmaliVariableTest {
|
||||||
|
|
||||||
|
@BeforeClass
|
||||||
|
public static void beforeClass() throws Exception, BrutException {
|
||||||
|
sTmpDir = new ExtFile(OS.createTempDirectory());
|
||||||
|
sTestOrigDir = new ExtFile(sTmpDir, "testjar-orig");
|
||||||
|
sTestNewDir = new ExtFile(sTmpDir, "testjar-new");
|
||||||
|
LOGGER.info("Unpacking testjar...");
|
||||||
|
TestUtils.copyResourceDir(BuildAndDecodeJarTest.class, "brut/apktool/issue1481/", sTestOrigDir);
|
||||||
|
|
||||||
|
LOGGER.info("Building issue1481.jar...");
|
||||||
|
File testJar = new File(sTmpDir, "issue1481.jar");
|
||||||
|
new Androlib().build(sTestOrigDir, testJar);
|
||||||
|
|
||||||
|
LOGGER.info("Decoding issue1481.jar...");
|
||||||
|
ApkDecoder apkDecoder = new ApkDecoder(testJar);
|
||||||
|
apkDecoder.setOutDir(sTestNewDir);
|
||||||
|
apkDecoder.decode();
|
||||||
|
}
|
||||||
|
|
||||||
|
@AfterClass
|
||||||
|
public static void afterClass() throws BrutException {
|
||||||
|
OS.rmdir(sTmpDir);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void confirmBaksmaliParamsAreTheSame() throws BrutException, IOException {
|
||||||
|
String expected = TestUtils.replaceNewlines(".class public final Lcom/ibotpeaches/issue1481/BuildConfig;\n" +
|
||||||
|
".super Ljava/lang/Object;\n" +
|
||||||
|
".source \"BuildConfig.java\"\n" +
|
||||||
|
"\n" +
|
||||||
|
"\n" +
|
||||||
|
"# static fields\n" +
|
||||||
|
".field public static final APPLICATION_ID:Ljava/lang/String; = \"com.ibotpeaches.issue1481\"\n" +
|
||||||
|
"\n" +
|
||||||
|
".field public static final BUILD_TYPE:Ljava/lang/String; = \"debug\"\n" +
|
||||||
|
"\n" +
|
||||||
|
".field public static final DEBUG:Z\n" +
|
||||||
|
"\n" +
|
||||||
|
".field public static final FLAVOR:Ljava/lang/String; = \"\"\n" +
|
||||||
|
"\n" +
|
||||||
|
".field public static final VERSION_CODE:I = 0x1\n" +
|
||||||
|
"\n" +
|
||||||
|
".field public static final VERSION_NAME:Ljava/lang/String; = \"1.0\"\n" +
|
||||||
|
"\n" +
|
||||||
|
"\n" +
|
||||||
|
"# direct methods\n" +
|
||||||
|
".method static constructor <clinit>()V\n" +
|
||||||
|
" .locals 1\n" +
|
||||||
|
"\n" +
|
||||||
|
" .prologue\n" +
|
||||||
|
" .line 7\n" +
|
||||||
|
" const-string v0, \"true\"\n" +
|
||||||
|
"\n" +
|
||||||
|
" invoke-static {v0}, Ljava/lang/Boolean;->parseBoolean(Ljava/lang/String;)Z\n" +
|
||||||
|
"\n" +
|
||||||
|
" move-result v0\n" +
|
||||||
|
"\n" +
|
||||||
|
" sput-boolean v0, Lcom/ibotpeaches/issue1481/BuildConfig;->DEBUG:Z\n" +
|
||||||
|
"\n" +
|
||||||
|
" return-void\n" +
|
||||||
|
".end method\n" +
|
||||||
|
"\n" +
|
||||||
|
".method public constructor <init>()V\n" +
|
||||||
|
" .locals 0\n" +
|
||||||
|
"\n" +
|
||||||
|
" .prologue\n" +
|
||||||
|
" .line 6\n" +
|
||||||
|
" invoke-direct {p0}, Ljava/lang/Object;-><init>()V\n" +
|
||||||
|
"\n" +
|
||||||
|
" return-void\n" +
|
||||||
|
".end method");
|
||||||
|
|
||||||
|
byte[] encoded = Files.readAllBytes(Paths.get(sTestNewDir + File.separator + "smali" + File.separator
|
||||||
|
+ "com" + File.separator + "ibotpeaches" + File.separator + "issue1481" + File.separator + "BuildConfig.smali"));
|
||||||
|
|
||||||
|
String obtained = TestUtils.replaceNewlines(new String(encoded));
|
||||||
|
assertEquals(expected, obtained);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static ExtFile sTmpDir;
|
||||||
|
private static ExtFile sTestOrigDir;
|
||||||
|
private static ExtFile sTestNewDir;
|
||||||
|
|
||||||
|
private final static Logger LOGGER = Logger.getLogger(BuildAndDecodeJarTest.class.getName());
|
||||||
|
}
|
@ -0,0 +1,2 @@
|
|||||||
|
version: 2.2.3
|
||||||
|
apkFileName: issue1481.jar
|
@ -0,0 +1,45 @@
|
|||||||
|
.class public final Lcom/ibotpeaches/issue1481/BuildConfig;
|
||||||
|
.super Ljava/lang/Object;
|
||||||
|
.source "BuildConfig.java"
|
||||||
|
|
||||||
|
|
||||||
|
# static fields
|
||||||
|
.field public static final APPLICATION_ID:Ljava/lang/String; = "com.ibotpeaches.issue1481"
|
||||||
|
|
||||||
|
.field public static final BUILD_TYPE:Ljava/lang/String; = "debug"
|
||||||
|
|
||||||
|
.field public static final DEBUG:Z
|
||||||
|
|
||||||
|
.field public static final FLAVOR:Ljava/lang/String; = ""
|
||||||
|
|
||||||
|
.field public static final VERSION_CODE:I = 0x1
|
||||||
|
|
||||||
|
.field public static final VERSION_NAME:Ljava/lang/String; = "1.0"
|
||||||
|
|
||||||
|
|
||||||
|
# direct methods
|
||||||
|
.method static constructor <clinit>()V
|
||||||
|
.registers 1
|
||||||
|
|
||||||
|
.prologue
|
||||||
|
.line 7
|
||||||
|
const-string v0, "true"
|
||||||
|
|
||||||
|
invoke-static {v0}, Ljava/lang/Boolean;->parseBoolean(Ljava/lang/String;)Z
|
||||||
|
|
||||||
|
move-result v0
|
||||||
|
|
||||||
|
sput-boolean v0, Lcom/ibotpeaches/issue1481/BuildConfig;->DEBUG:Z
|
||||||
|
|
||||||
|
return-void
|
||||||
|
.end method
|
||||||
|
|
||||||
|
.method public constructor <init>()V
|
||||||
|
.registers 1
|
||||||
|
|
||||||
|
.prologue
|
||||||
|
.line 6
|
||||||
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
||||||
|
|
||||||
|
return-void
|
||||||
|
.end method
|
@ -17,6 +17,7 @@
|
|||||||
package brut.directory;
|
package brut.directory;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
import java.util.LinkedHashMap;
|
import java.util.LinkedHashMap;
|
||||||
@ -235,6 +236,11 @@ public abstract class AbstractDirectory implements Directory {
|
|||||||
return dirs;
|
return dirs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void close() throws IOException {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
private SubPath getSubPath(String path) throws PathNotExist {
|
private SubPath getSubPath(String path) throws PathNotExist {
|
||||||
ParsedPath parsed = parsePath(path);
|
ParsedPath parsed = parsePath(path);
|
||||||
if (parsed.dir == null) {
|
if (parsed.dir == null) {
|
||||||
|
@ -50,5 +50,8 @@ public interface Directory {
|
|||||||
public int getCompressionLevel(String fileName)
|
public int getCompressionLevel(String fileName)
|
||||||
throws DirectoryException;
|
throws DirectoryException;
|
||||||
|
|
||||||
|
|
||||||
|
public void close() throws IOException;
|
||||||
|
|
||||||
public final char separator = '/';
|
public final char separator = '/';
|
||||||
}
|
}
|
||||||
|
@ -17,6 +17,7 @@
|
|||||||
package brut.directory;
|
package brut.directory;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
import java.io.IOException;
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -54,5 +55,9 @@ public class ExtFile extends File {
|
|||||||
return mDirectory;
|
return mDirectory;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void close() throws IOException {
|
||||||
|
mDirectory.close();
|
||||||
|
}
|
||||||
|
|
||||||
private Directory mDirectory;
|
private Directory mDirectory;
|
||||||
}
|
}
|
||||||
|
@ -151,4 +151,8 @@ public class ZipRODirectory extends AbstractDirectory {
|
|||||||
return mZipFile;
|
return mZipFile;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void close() throws IOException {
|
||||||
|
mZipFile.close();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user