android-support-v4.jar 混淆出错

本文探讨了在尝试混淆Android支持库v4时遇到的问题,包括找不到超类、接口及引用的方法等警告,并提供了可能的解决方案,比如调整API级别或更换支持库版本。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

将工程混淆下,但是发现有如下的错误:

 [java] Warning: android.support.v4.view.accessibility.AccessibilityNodeProviderCompatJellyBean$1: can't find superclass or interface android.view.accessibility.AccessibilityNodeProvider
     [java] Warning: android.support.v4.app.NavUtilsJB: can't find referenced method 'android.content.Intent getParentActivityIntent()' in class android.app.Activity
     [java] Warning: android.support.v4.app.NavUtilsJB: can't find referenced method 'boolean shouldUpRecreateTask(android.content.Intent)' in class android.app.Activity
     [java] Warning: android.support.v4.app.NavUtilsJB: can't find referenced method 'boolean navigateUpTo(android.content.Intent)' in class android.app.Activity
     [java] Warning: android.support.v4.app.NavUtilsJB: can't find referenced field 'java.lang.String parentActivityName' in class android.content.pm.ActivityInfo
     [java] Warning: android.support.v4.app.NotificationCompatJellybean: can't find referenced method 'android.app.Notification$Builder setSubText(java.lang.CharSequence)' in class android.app.Notification$Builder
     [java] Warning: android.support.v4.app.NotificationCompatJellybean: can't find referenced method 'android.app.Notification$Builder setUsesChronometer(boolean)' in class android.app.Notification$Builder
     [java] Warning: android.support.v4.app.NotificationCompatJellybean: can't find referenced method 'android.app.Notification$Builder setPriority(int)' in class android.app.Notification$Builder
     [java] Warning: android.support.v4.app.NotificationCompatJellybean: can't find referenced method 'android.app.Notification$Builder addAction(int,java.lang.CharSequence,android.app.PendingIntent)' in class android.app.Notification$Builder

...
...

由于之前混淆这个 android-support-v4.jar包是没有问题的,

可想问题出现:目前的这个android-support-v4.jar JAR包上,果然,当初建工程的时候,引导工程默认是

使用最新的API-17来建工程的,所以系统默认使用支持4.1 Jelly Bean 的android-support-v4.jar JAR包,

打包的时候 API-level调到 >= 16即可,或者将 /libs/android-support-v4.jar 替换成较老版本的。

LOCAL_PATH:= $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE_TAGS := optional LOCAL_SRC_FILES := $(call all-java-files-under, src) LOCAL_AIDL_INCLUDES := $(LOCAL_PATH)/src/aidl LOCAL_AIDL_FILES := $(call all-aidl-files-under, $(LOCAL_PATH)/src/aidl) LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/res LOCAL_PACKAGE_NAME := FactoryMode LOCAL_PRIVATE_PLATFORM_APIS := false LOCAL_PRIVILEGED_MODULE := true LOCAL_CERTIFICATE := platform LOCAL_USE_AAPT2 := true LOCAL_PROGUARD_ENABLED := disabled LOCAL_DEX_PREOPT := false LOCAL_STATIC_ANDROID_LIBRARIES += \ android-support-constraint-layout \ android-support-compat \ android-support-v4 \ android-support-v13 \ android-support-v7-appcompat \ android-support-v7-cardview \ android-support-v7-preference \ android-support-v14-preference \ androidx.recyclerview_recyclerview \ LOCAL_STATIC_JAVA_LIBRARIES += upgradeProxy \ zxing \ someip \ clusterKit \ wayto-annotation \ wayto-base \ mshi \ jwriter \ okio-jvm \ kotlin \ sshd-sftp \ sshd-core \ sshd-common \ slf4j-simple \ slf4j-api \ testsftp-client \ gson-jar \ lifecycle-jar \ LOCAL_JAVA_LIBRARIES += android.car #LOCAL_JNI_SHARED_LIBRARIES := jni include $(BUILD_PACKAGE) include $(CLEAR_VARS) LOCAL_PREBUILT_STATIC_JAVA_LIBRARIES += upgradeProxy:libs/upgradeProxy.jar \ zxing:libs/zxing.jar \ someip:libs/someip.jar \ clusterKit:libs/ClusterKit-debug.aar \ wayto-annotation:libs/wayto-annotation.jar \ wayto-base:libs/wayto-base-debug.aar \ mshi:libs/moshi-1.15.0.jar \ jwriter:libs/javawriter-2.1.1.jar \ moshi:libs/moshi-1.15.0.jar \ okio-jvm:libs/okio-jvm-2.10.0.jar \ kotlin:libs/kotlin-stdlib-1.9.24.jar \ sshd-sftp:libs/sshd-sftp-2.7.0.jar \ sshd-core:libs/sshd-core-2.7.0.jar \ sshd-common:libs/sshd-common-2.7.0.jar \ slf4j-simple:libs/slf4j-simple-2.0.7.jar \ slf4j-api:libs/slf4j-api-2.0.7.jar \ testsftp-client:libs/jsch-0.1.55.jar \ gson-jar:libs/gson-2.8.9.jar \ lifecycle-jar:libs/lifecycle-common-2.6.1.jar \ include $(BUILD_MULTI_PREBUILT) include $(call all-makefiles-under, $(LOCAL_PATH))
最新发布
07-18
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值