Android 混淆導包APK時報錯

2021-07-03 19:38:48 字數 1659 閱讀 9645

proguard returned with error code 1. see console

note: there were 4 duplicate class definitions.

warning: library class android.content.res.xmlresourceparser extends or implements program class org.xmlpull.v1.xmlpullparser

warning: library class android.content.intent depends on program class org.xmlpull.v1.xmlpullparser

。。。心裡想著,真是好事多磨呀!

那就趕緊問度娘呀,終於在一位網友那裡找到了答案。

對於android匯入了第三方jar包時,proguard混淆指令碼會出現錯誤,而出現上面的錯誤是因為程式中引入了第三方jar包[ksoap2-android-assembly-2.6.5-jar-with-dependencies.jar],二話不說,立馬行動:

在proguard-project.txt中增加了

-ignorewarnings

-libraryjars lib/ksoap2-android-assembly-2.5.4-jar-with-dependencies.jar (jar包路徑)

即在檔案中增加了如下紅色的兩行:

-dontusemixedcaseclassnames

-dontskipnonpubliclibraryclasses

-verbose

-ignorewarnings

# optimization is turned off by default. dex does not like code run

# through the proguard optimize and preverify steps (and performs some

# of these optimizations on its own).

-dontoptimize

#-dontoptimize

# note that if you want to enable optimization, you cannot just

# include optimization flags in your own project configuration file;

# instead you will need to point to the

# "proguard-android-optimize.txt" file instead of this one from your

# project.properties file.

-libraryjars libs/ksoap2-android-assembly-2.6.5-jar-with-dependencies.jar 

-keepattributes *annotation*

-keep public class com.google.vending.licensing.ilicensingservice

-keep public class com.android.vending.licensing.ilicensingservice

最後,重新打包,一切ok。

gradle導包 混淆問題

今天就遇到了乙個奇葩的問題.好吧.大概原因出來了.沒錯.就是打包必須做的事 混淆的問題.原來module裡面我用了混淆,android studio 會預設幫你配置混淆的.只要你設定了 minifyenabled true 你的內容就會根據預設配置幫你混淆.所以明白了嗎?方法兩種 1.module直...

android中APK包的安裝

1.adb push apk 目錄是將apk傳送到手機指定的目錄 adb push test.apk sdcard test test.apk 2.adb install 電腦中apk的路徑是安裝電腦中的apk到手機 adb install users test test.apk 3.強制安裝 有時...

ADB獲取Android應用的APK包

詳細過程了解可以參照 2 可以通過先在手機中啟動相應的應用,使該應用位於前台。通過指令 adb shell dumpsys window findstr mcurrentfocus可以獲取到 3 通過packagemanager 獲取整個應用列表然後在自己選擇 adb shell pm list p...