fix: remove declared exceptions that aren't thrown

This commit is contained in:
Connor Tumbleson 2021-03-12 07:47:19 -05:00
parent 4d11c13e44
commit f4c2f9bc50
No known key found for this signature in database
GPG Key ID: C3CC0A201EC7DA75
4 changed files with 23 additions and 20 deletions

View File

@ -228,7 +228,7 @@ public class ApkDecoder {
} }
} }
public void setTargetSdkVersion() throws AndrolibException, IOException { public void setTargetSdkVersion() throws AndrolibException {
if (mResTable == null) { if (mResTable == null) {
mResTable = mAndrolib.getResTable(mApkFile); mResTable = mAndrolib.getResTable(mApkFile);
} }
@ -247,7 +247,7 @@ public class ApkDecoder {
mForceDelete = forceDelete; mForceDelete = forceDelete;
} }
public void setFrameworkTag(String tag) throws AndrolibException { public void setFrameworkTag(String tag) {
mAndrolib.apkOptions.frameworkTag = tag; mAndrolib.apkOptions.frameworkTag = tag;
} }
@ -437,21 +437,21 @@ public class ApkDecoder {
meta.versionInfo = info; meta.versionInfo = info;
} }
private void putUnknownInfo(MetaInfo meta) throws AndrolibException { private void putUnknownInfo(MetaInfo meta) {
meta.unknownFiles = mAndrolib.mResUnknownFiles.getUnknownFiles(); meta.unknownFiles = mAndrolib.mResUnknownFiles.getUnknownFiles();
} }
private void putFileCompressionInfo(MetaInfo meta) throws AndrolibException { private void putFileCompressionInfo(MetaInfo meta) {
if (mUncompressedFiles != null && !mUncompressedFiles.isEmpty()) { if (mUncompressedFiles != null && !mUncompressedFiles.isEmpty()) {
meta.doNotCompress = mUncompressedFiles; meta.doNotCompress = mUncompressedFiles;
} }
} }
private void putSparseResourcesInfo(MetaInfo meta) throws AndrolibException { private void putSparseResourcesInfo(MetaInfo meta) {
meta.sparseResources = mResTable.getSparseResources(); meta.sparseResources = mResTable.getSparseResources();
} }
private void putSharedLibraryInfo(MetaInfo meta) throws AndrolibException { private void putSharedLibraryInfo(MetaInfo meta) {
meta.sharedLibrary = mResTable.getSharedLibrary(); meta.sharedLibrary = mResTable.getSharedLibrary();
} }

View File

@ -92,8 +92,7 @@ final public class AndrolibResources {
return pkg; return pkg;
} }
public ResPackage selectPkgWithMostResSpecs(ResPackage[] pkgs) public ResPackage selectPkgWithMostResSpecs(ResPackage[] pkgs) {
throws AndrolibException {
int id = 0; int id = 0;
int value = 0; int value = 0;
int index = 0; int index = 0;

View File

@ -17,20 +17,25 @@
package brut.androlib.res.decoder; package brut.androlib.res.decoder;
import android.util.TypedValue; import android.util.TypedValue;
import brut.androlib.Androlib;
import brut.androlib.AndrolibException; import brut.androlib.AndrolibException;
import brut.androlib.res.data.*; import brut.androlib.res.data.*;
import brut.androlib.res.data.value.*; import brut.androlib.res.data.value.*;
import brut.util.Duo; import brut.util.Duo;
import brut.androlib.res.data.ResTable;
import brut.util.ExtDataInput; import brut.util.ExtDataInput;
import com.google.common.io.LittleEndianDataInputStream; import com.google.common.io.LittleEndianDataInputStream;
import java.io.*;
import java.math.BigInteger;
import java.util.*;
import java.util.logging.Logger;
import org.apache.commons.io.input.CountingInputStream; import org.apache.commons.io.input.CountingInputStream;
import java.io.DataInput;
import java.io.EOFException;
import java.io.IOException;
import java.io.InputStream;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.logging.Logger;
public class ARSCDecoder { public class ARSCDecoder {
public static ARSCData decode(InputStream arscStream, boolean findFlagsOffsets, boolean keepBroken) public static ARSCData decode(InputStream arscStream, boolean findFlagsOffsets, boolean keepBroken)
throws AndrolibException { throws AndrolibException {
@ -468,7 +473,7 @@ public class ARSCDecoder {
colorMode, isInvalid, size); colorMode, isInvalid, size);
} }
private char[] unpackLanguageOrRegion(byte in0, byte in1, char base) throws AndrolibException { private char[] unpackLanguageOrRegion(byte in0, byte in1, char base) {
// check high bit, if so we have a packed 3 letter code // check high bit, if so we have a packed 3 letter code
if (((in0 >> 7) & 1) == 1) { if (((in0 >> 7) & 1) == 1) {
int first = in1 & 0x1F; int first = in1 & 0x1F;
@ -482,7 +487,7 @@ public class ARSCDecoder {
return new char[] { (char) in0, (char) in1 }; return new char[] { (char) in0, (char) in1 };
} }
private String readScriptOrVariantChar(int length) throws AndrolibException, IOException { private String readScriptOrVariantChar(int length) throws IOException {
StringBuilder string = new StringBuilder(16); StringBuilder string = new StringBuilder(16);
while(length-- != 0) { while(length-- != 0) {

View File

@ -517,8 +517,7 @@ public class AXmlResourceParser implements XmlResourceParser {
// ///////////////////////////////// dummies // ///////////////////////////////// dummies
@Override @Override
public void setInput(InputStream stream, String inputEncoding) public void setInput(InputStream stream, String inputEncoding) {
throws XmlPullParserException {
open(stream); open(stream);
} }
@ -538,12 +537,12 @@ public class AXmlResourceParser implements XmlResourceParser {
} }
@Override @Override
public boolean isEmptyElementTag() throws XmlPullParserException { public boolean isEmptyElementTag() {
return false; return false;
} }
@Override @Override
public boolean isWhitespace() throws XmlPullParserException { public boolean isWhitespace() {
return false; return false;
} }