chore: fix warnings reported by snyk

This commit is contained in:
Skylot
2021-04-21 11:08:21 +01:00
parent 1462acbb92
commit c28e8142f4
3 changed files with 28 additions and 7 deletions
+9 -2
View File
@@ -7,7 +7,14 @@ dependencies {
// TODO: finish own smali printer
implementation 'org.smali:baksmali:2.5.2'
implementation 'com.google.guava:guava:30.1-jre' // force latest version for smali
// force latest version for smali
constraints {
implementation 'com.google.guava:guava:30.1-jre'
implementation 'com.beust:jcommander:1.81'
}
testImplementation 'org.smali:smali:2.5.2' // compile smali files in tests
// compile smali files in tests
testImplementation('org.smali:smali:2.5.2') {
exclude(group: 'junit', module: 'junit') // ignore junit 4 transitive dependency
}
}
@@ -1,6 +1,7 @@
package jadx.plugins.input.dex;
import java.io.BufferedInputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
@@ -15,8 +16,6 @@ import java.util.stream.Collectors;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.google.common.io.ByteStreams;
import jadx.api.plugins.utils.ZipSecurity;
import jadx.plugins.input.dex.sections.DexConsts;
@@ -93,7 +92,16 @@ public class DexFileLoader {
}
private static byte[] readAllBytes(InputStream in) throws IOException {
return ByteStreams.toByteArray(in);
ByteArrayOutputStream buf = new ByteArrayOutputStream();
byte[] data = new byte[8192];
while (true) {
int read = in.read(data);
if (read == -1) {
break;
}
buf.write(data, 0, read);
}
return buf.toByteArray();
}
private static int getNextUniqId() {
+8 -2
View File
@@ -7,6 +7,12 @@ dependencies {
implementation(project(":jadx-plugins:jadx-dex-input"))
implementation 'org.smali:smali:2.5.2'
implementation 'com.google.guava:guava:30.1-jre' // force latest version for smali
implementation('org.smali:smali:2.5.2') {
exclude(group: 'junit', module: 'junit') // ignore junit 4 transitive dependency
}
// force latest version for smali
constraints {
implementation 'com.google.guava:guava:30.1-jre'
implementation 'com.beust:jcommander:1.81'
}
}