Skip to content

Commit

Permalink
fix: remove declared exceptions that aren't thrown
Browse files Browse the repository at this point in the history
  • Loading branch information
iBotPeaches committed Mar 12, 2021
1 parent 4d11c13 commit f4c2f9b
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ public void setAnalysisMode(boolean mode, boolean pass) throws AndrolibException
}
}

public void setTargetSdkVersion() throws AndrolibException, IOException {
public void setTargetSdkVersion() throws AndrolibException {
if (mResTable == null) {
mResTable = mAndrolib.getResTable(mApkFile);
}
Expand All @@ -247,7 +247,7 @@ public void setForceDelete(boolean forceDelete) {
mForceDelete = forceDelete;
}

public void setFrameworkTag(String tag) throws AndrolibException {
public void setFrameworkTag(String tag) {
mAndrolib.apkOptions.frameworkTag = tag;
}

Expand Down Expand Up @@ -437,21 +437,21 @@ private void putVersionInfo(MetaInfo meta) throws AndrolibException {
meta.versionInfo = info;
}

private void putUnknownInfo(MetaInfo meta) throws AndrolibException {
private void putUnknownInfo(MetaInfo meta) {
meta.unknownFiles = mAndrolib.mResUnknownFiles.getUnknownFiles();
}

private void putFileCompressionInfo(MetaInfo meta) throws AndrolibException {
private void putFileCompressionInfo(MetaInfo meta) {
if (mUncompressedFiles != null && !mUncompressedFiles.isEmpty()) {
meta.doNotCompress = mUncompressedFiles;
}
}

private void putSparseResourcesInfo(MetaInfo meta) throws AndrolibException {
private void putSparseResourcesInfo(MetaInfo meta) {
meta.sparseResources = mResTable.getSparseResources();
}

private void putSharedLibraryInfo(MetaInfo meta) throws AndrolibException {
private void putSharedLibraryInfo(MetaInfo meta) {
meta.sharedLibrary = mResTable.getSharedLibrary();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,7 @@ public ResPackage loadMainPkg(ResTable resTable, ExtFile apkFile)
return pkg;
}

public ResPackage selectPkgWithMostResSpecs(ResPackage[] pkgs)
throws AndrolibException {
public ResPackage selectPkgWithMostResSpecs(ResPackage[] pkgs) {
int id = 0;
int value = 0;
int index = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,24 @@
package brut.androlib.res.decoder;

import android.util.TypedValue;
import brut.androlib.Androlib;
import brut.androlib.AndrolibException;
import brut.androlib.res.data.*;
import brut.androlib.res.data.value.*;
import brut.util.Duo;
import brut.androlib.res.data.ResTable;
import brut.util.ExtDataInput;
import com.google.common.io.LittleEndianDataInputStream;
import java.io.*;
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.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.logging.Logger;
import org.apache.commons.io.input.CountingInputStream;

public class ARSCDecoder {
public static ARSCData decode(InputStream arscStream, boolean findFlagsOffsets, boolean keepBroken)
Expand Down Expand Up @@ -468,7 +473,7 @@ private ResConfigFlags readConfigFlags() throws IOException, AndrolibException {
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
if (((in0 >> 7) & 1) == 1) {
int first = in1 & 0x1F;
Expand All @@ -482,7 +487,7 @@ private char[] unpackLanguageOrRegion(byte in0, byte in1, char base) throws Andr
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);

while(length-- != 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -517,8 +517,7 @@ public boolean isAttributeDefault(int index) {

// ///////////////////////////////// dummies
@Override
public void setInput(InputStream stream, String inputEncoding)
throws XmlPullParserException {
public void setInput(InputStream stream, String inputEncoding) {
open(stream);
}

Expand All @@ -538,12 +537,12 @@ public int getColumnNumber() {
}

@Override
public boolean isEmptyElementTag() throws XmlPullParserException {
public boolean isEmptyElementTag() {
return false;
}

@Override
public boolean isWhitespace() throws XmlPullParserException {
public boolean isWhitespace() {
return false;
}

Expand Down

0 comments on commit f4c2f9b

Please sign in to comment.