@@ -46,7 +46,7 @@ import java.util.zip.ZipEntry
4646
4747class SensorsAnalyticsTransform extends Transform {
4848 private SensorsAnalyticsTransformHelper transformHelper
49- public static final String VERSION = " 3.1.0 "
49+ public static final String VERSION = " 3.1.1 "
5050 public static final String MIN_SDK_VERSION = " 3.0.0"
5151 private WaitableExecutor waitableExecutor
5252
@@ -254,8 +254,8 @@ class SensorsAnalyticsTransform extends Transform {
254254 }
255255
256256 private File modifyJar (File jarFile , File tempDir , boolean isNameHex ) {
257- // 取原 jar
258- def file = new JarFile (jarFile)
257+ // 取原 jar, verify 参数传 false, 代表对 jar 包不进行签名校验
258+ def file = new JarFile (jarFile, false )
259259 // 设置输出到的 jar
260260 def tmpNameHex = " "
261261 if (isNameHex) {
@@ -267,8 +267,13 @@ class SensorsAnalyticsTransform extends Transform {
267267
268268 while (enumeration. hasMoreElements()) {
269269 JarEntry jarEntry = (JarEntry ) enumeration. nextElement()
270- InputStream inputStream = file. getInputStream(jarEntry)
271-
270+ InputStream inputStream
271+ try {
272+ inputStream = file. getInputStream(jarEntry)
273+ } catch (Exception e) {
274+ e. printStackTrace()
275+ return null
276+ }
272277 String entryName = jarEntry. getName()
273278 if (entryName. endsWith(" .DSA" ) || entryName. endsWith(" .SF" )) {
274279 // ignore
0 commit comments