当前位置: 首页 > 面试题库 >

保障与错误

单于轶
2023-03-14
问题内容

我使用这个proguard文件:

 -dontskipnonpubliclibraryclasses
 -dontskipnonpubliclibraryclassmembers

 !code/simplification/arithmetic,!code/simplification/cast,!field/*,!class/merging/*
 -optimizationpasses 10
 -allowaccessmodification
 -mergeinterfacesaggressively
 -overloadaggressively

 -assumenosideeffects class android.util.Log {
*;
 }

-keep public class * extends android.app.Activity
-keep public class * extends android.app.Application
-keep public class * extends android.app.Service
-keep public class * extends android.content.BroadcastReceiver
-keep public class * extends android.content.ContentProvider
-keep public class * extends android.app.backup.BackupAgent
-keep public class * extends android.preference.Preference
-keep public class * extends android.support.v4.app.Fragment
-keep public class * extends android.support.v4.app.DialogFragment
-keep public class * extends com.actionbarsherlock.app.SherlockListFragment
-keep public class * extends com.actionbarsherlock.app.SherlockFragment
-keep public class * extends com.actionbarsherlock.app.SherlockFragmentActivity
-keep public class * extends android.app.Fragment
-keep public class com.android.vending.licensing.ILicensingService
-keep public class org.jsoup.** {
public *;
}

-keep public class * extends android.view.View {
 public <init>(android.content.Context);
 public <init>(android.content.Context, android.util.AttributeSet);
 public <init>(android.content.Context, android.util.AttributeSet, int);
 public void set*(...);
}

-keepclasseswithmembers class * {
 public <init>(android.content.Context, android.util.AttributeSet);
}

-keepclasseswithmembers class * {
 public <init>(android.content.Context, android.util.AttributeSet, int);
}

-keepclassmembers class * extends android.app.Activity {
 public void *(android.view.View);
}

-keepclassmembers enum * {
 public static **[] values();
 public static ** valueOf(java.lang.String);
}

-keep class * implements android.os.Parcelable {
 public static final android.os.Parcelable$Creator *;
}

-keepclassmembers class **.R$* {
 public static <fields>;
}

-keep class android.support.v4.app.** { *; }
-keep interface android.support.v4.app.** { *; }
-keep class com.actionbarsherlock.** { *; }
-keep interface com.actionbarsherlock.** { *; }

-keep class com.google.ads.** {*;}
-keep class com.google.ads.internal.** {*;}
-keep class com.google.ads.mediation.** {*;}
-keep class com.google.ads.mediation.adfonic.** {*;}
-keep class com.google.ads.mediation.admob.** {*;}
-keep class com.google.ads.mediation.adfonic.util.** {*;}
-keep class com.google.ads.mediation.customevent.** {*;}
-keep class com.google.ads.searchads.** {*;}
-keep class com.google.ads.util.** {*;}

-dontwarn android.support.**
-dontwarn com.google.ads.**

但是在对代码进行一些更新之后,我出现了以下错误:

Warning:com.google.android.gms.internal.zzw$zza: can't find superclass or interface org.apache.http.client.methods.HttpEntityEnclosingRequestBase
Warning:com.google.android.gms.analytics.internal.zzam: can't find referenced class org.apache.http.NameValuePair
Warning:com.google.android.gms.analytics.internal.zzam: can't find referenced class org.apache.http.client.utils.URLEncodedUtils
Warning:com.google.android.gms.analytics.internal.zzam: can't find referenced class org.apache.http.NameValuePair
Warning:com.google.android.gms.analytics.internal.zzj: can't find referenced class org.apache.http.NameValuePair
Warning:com.google.android.gms.analytics.internal.zzj: can't find referenced class org.apache.http.client.utils.URLEncodedUtils
Warning:com.google.android.gms.analytics.internal.zzj: can't find referenced class org.apache.http.NameValuePair
Warning:com.google.android.gms.internal.zzac: can't find referenced class android.net.http.AndroidHttpClient
Warning:com.google.android.gms.internal.zzqt: can't find referenced class org.apache.http.HttpEntity
Warning:com.google.android.gms.internal.zzqt: can't find referenced class org.apache.http.HttpResponse
Warning:com.google.android.gms.internal.zzqt: can't find referenced class org.apache.http.StatusLine
Warning:com.google.android.gms.internal.zzqt: can't find referenced class org.apache.http.client.HttpClient
Warning:com.google.android.gms.internal.zzqt: can't find referenced class org.apache.http.client.methods.HttpGet
Warning:com.google.android.gms.internal.zzqt: can't find referenced class org.apache.http.conn.ClientConnectionManager
Warning:com.google.android.gms.internal.zzqt: can't find referenced class org.apache.http.impl.client.DefaultHttpClient
Warning:com.google.android.gms.internal.zzqt: can't find referenced class org.apache.http.params.BasicHttpParams
Warning:com.google.android.gms.internal.zzqt: can't find referenced class org.apache.http.client.methods.HttpGet
Warning:com.google.android.gms.internal.zzqt: can't find referenced class org.apache.http.impl.client.DefaultHttpClient
Warning:com.google.android.gms.internal.zzqt: can't find referenced class org.apache.http.params.BasicHttpParams
Warning:com.google.android.gms.internal.zzqt: can't find referenced class org.apache.http.HttpEntity
Warning:com.google.android.gms.internal.zzqt: can't find referenced class org.apache.http.HttpResponse
Warning:com.google.android.gms.internal.zzqt: can't find referenced class org.apache.http.StatusLine
Warning:com.google.android.gms.internal.zzqt: can't find referenced class org.apache.http.client.HttpClient
Warning:com.google.android.gms.internal.zzqt: can't find referenced class org.apache.http.conn.ClientConnectionManager
Warning:com.google.android.gms.internal.zzqt: can't find referenced class org.apache.http.client.HttpClient
Warning:com.google.android.gms.internal.zzqt: can't find referenced class org.apache.http.HttpResponse
Warning:com.google.android.gms.internal.zzqt: can't find referenced class org.apache.http.client.HttpClient
Warning:com.google.android.gms.internal.zzt: can't find referenced class org.apache.http.Header
Warning:com.google.android.gms.internal.zzt: can't find referenced class org.apache.http.HttpEntity
Warning:com.google.android.gms.internal.zzt: can't find referenced class org.apache.http.HttpResponse
Warning:com.google.android.gms.internal.zzt: can't find referenced class org.apache.http.StatusLine
Warning:com.google.android.gms.internal.zzt: can't find referenced class org.apache.http.impl.cookie.DateUtils
Warning:com.google.android.gms.internal.zzt: can't find referenced class org.apache.http.Header
Warning:com.google.android.gms.internal.zzt: can't find referenced class org.apache.http.HttpEntity
Warning:com.google.android.gms.internal.zzt: can't find referenced class org.apache.http.HttpResponse
Warning:com.google.android.gms.internal.zzt: can't find referenced class org.apache.http.StatusLine
Warning:com.google.android.gms.internal.zzt: can't find referenced class org.apache.http.HttpEntity
Warning:com.google.android.gms.internal.zzt: can't find referenced class org.apache.http.Header
Warning:com.google.android.gms.internal.zzw: can't find referenced class org.apache.http.client.HttpClient
Warning:com.google.android.gms.internal.zzw: can't find referenced class org.apache.http.client.methods.HttpDelete
Warning:com.google.android.gms.internal.zzw: can't find referenced class org.apache.http.client.methods.HttpEntityEnclosingRequestBase
Warning:com.google.android.gms.internal.zzw: can't find referenced class org.apache.http.client.methods.HttpGet
Warning:com.google.android.gms.internal.zzw: can't find referenced class org.apache.http.client.methods.HttpHead
Warning:com.google.android.gms.internal.zzw: can't find referenced class org.apache.http.client.methods.HttpOptions
Warning:com.google.android.gms.internal.zzw: can't find referenced class org.apache.http.client.methods.HttpPost
Warning:com.google.android.gms.internal.zzw: can't find referenced class org.apache.http.client.methods.HttpPut
Warning:com.google.android.gms.internal.zzw: can't find referenced class org.apache.http.client.methods.HttpTrace
Warning:com.google.android.gms.internal.zzw: can't find referenced class org.apache.http.client.methods.HttpUriRequest
Warning:com.google.android.gms.internal.zzw: can't find referenced class org.apache.http.entity.ByteArrayEntity
Warning:com.google.android.gms.internal.zzw: can't find referenced method 'void addHeader(java.lang.String,java.lang.String)' in program class com.google.android.gms.internal.zzw$zza
Warning:com.google.android.gms.internal.zzw: can't find referenced class org.apache.http.client.methods.HttpDelete
Warning:com.google.android.gms.internal.zzw: can't find referenced class org.apache.http.client.methods.HttpEntityEnclosingRequestBase
Warning:com.google.android.gms.internal.zzw: can't find referenced class org.apache.http.client.methods.HttpGet
Warning:com.google.android.gms.internal.zzw: can't find referenced class org.apache.http.client.methods.HttpHead
Warning:com.google.android.gms.internal.zzw: can't find referenced class org.apache.http.client.methods.HttpOptions
Warning:com.google.android.gms.internal.zzw: can't find referenced class org.apache.http.client.methods.HttpPost
Warning:com.google.android.gms.internal.zzw: can't find referenced class org.apache.http.client.methods.HttpPut
Warning:com.google.android.gms.internal.zzw: can't find referenced class org.apache.http.client.methods.HttpTrace
Warning:com.google.android.gms.internal.zzw: can't find referenced class org.apache.http.entity.ByteArrayEntity
Warning:com.google.android.gms.internal.zzw: can't find referenced class org.apache.http.client.HttpClient
Warning:com.google.android.gms.internal.zzw: can't find referenced class org.apache.http.client.methods.HttpUriRequest
Warning:com.google.android.gms.internal.zzw: can't find referenced class org.apache.http.client.HttpClient
Warning:com.google.android.gms.internal.zzw: can't find referenced class org.apache.http.client.methods.HttpUriRequest
Warning:com.google.android.gms.internal.zzw: can't find referenced class org.apache.http.HttpResponse
Warning:com.google.android.gms.internal.zzw: can't find referenced class org.apache.http.client.methods.HttpUriRequest
Warning:com.google.android.gms.internal.zzw: can't find referenced class org.apache.http.client.methods.HttpEntityEnclosingRequestBase
Warning:com.google.android.gms.internal.zzw: can't find referenced class org.apache.http.client.methods.HttpUriRequest
Warning:com.google.android.gms.internal.zzw$zza: can't find referenced class org.apache.http.client.methods.HttpEntityEnclosingRequestBase
Warning:com.google.android.gms.internal.zzw$zza: can't find referenced method 'void setURI(java.net.URI)' in program class com.google.android.gms.internal.zzw$zza
Warning:com.google.android.gms.internal.zzw$zza: can't find referenced class org.apache.http.client.methods.HttpEntityEnclosingRequestBase
Warning:com.google.android.gms.internal.zzx: can't find referenced class org.apache.http.impl.cookie.DateParseException
Warning:com.google.android.gms.internal.zzx: can't find referenced class org.apache.http.impl.cookie.DateUtils
Warning:com.google.android.gms.internal.zzy: can't find referenced class org.apache.http.HttpResponse
Warning:com.google.android.gms.internal.zzz: can't find referenced class org.apache.http.ProtocolVersion
Warning:com.google.android.gms.internal.zzz: can't find referenced class org.apache.http.entity.BasicHttpEntity
Warning:com.google.android.gms.internal.zzz: can't find referenced class org.apache.http.message.BasicHeader
Warning:com.google.android.gms.internal.zzz: can't find referenced class org.apache.http.message.BasicHttpResponse
Warning:com.google.android.gms.internal.zzz: can't find referenced class org.apache.http.message.BasicStatusLine
Warning:com.google.android.gms.internal.zzz: can't find referenced class org.apache.http.ProtocolVersion
Warning:com.google.android.gms.internal.zzz: can't find referenced class org.apache.http.entity.BasicHttpEntity
Warning:com.google.android.gms.internal.zzz: can't find referenced class org.apache.http.message.BasicHeader
Warning:com.google.android.gms.internal.zzz: can't find referenced class org.apache.http.message.BasicHttpResponse
Warning:com.google.android.gms.internal.zzz: can't find referenced class org.apache.http.message.BasicStatusLine
Warning:com.google.android.gms.internal.zzz: can't find referenced class org.apache.http.HttpResponse
Warning:com.google.android.gms.internal.zzz: can't find referenced class org.apache.http.HttpEntity
Warning:com.google.android.gms.tagmanager.zzby: can't find referenced class org.apache.http.impl.client.DefaultHttpClient
Warning:com.google.android.gms.tagmanager.zzcx: can't find referenced class org.apache.http.Header
Warning:com.google.android.gms.tagmanager.zzcx: can't find referenced class org.apache.http.HttpEntity
Warning:com.google.android.gms.tagmanager.zzcx: can't find referenced class org.apache.http.HttpEntityEnclosingRequest
Warning:com.google.android.gms.tagmanager.zzcx: can't find referenced class org.apache.http.HttpHost
Warning:com.google.android.gms.tagmanager.zzcx: can't find referenced class org.apache.http.HttpResponse
Warning:com.google.android.gms.tagmanager.zzcx: can't find referenced class org.apache.http.StatusLine
Warning:com.google.android.gms.tagmanager.zzcx: can't find referenced class org.apache.http.client.ClientProtocolException
Warning:com.google.android.gms.tagmanager.zzcx: can't find referenced class org.apache.http.client.HttpClient
Warning:com.google.android.gms.tagmanager.zzcx: can't find referenced class org.apache.http.message.BasicHttpEntityEnclosingRequest
Warning:com.google.android.gms.tagmanager.zzcx: can't find referenced class org.apache.http.HttpHost
Warning:com.google.android.gms.tagmanager.zzcx: can't find referenced class org.apache.http.message.BasicHttpEntityEnclosingRequest
Warning:com.google.android.gms.tagmanager.zzcx: can't find referenced class org.apache.http.HttpEntity
Warning:com.google.android.gms.tagmanager.zzcx: can't find referenced class org.apache.http.HttpEntityEnclosingRequest
Warning:com.google.android.gms.tagmanager.zzcx: can't find referenced class org.apache.http.HttpResponse
Warning:com.google.android.gms.tagmanager.zzcx: can't find referenced class org.apache.http.StatusLine
Warning:com.google.android.gms.tagmanager.zzcx: can't find referenced class org.apache.http.client.HttpClient
Warning:com.google.android.gms.tagmanager.zzcx: can't find referenced class org.apache.http.HttpEntityEnclosingRequest

我尝试了:

-keep class org.apache.http.**
-keep interface org.apache.http.**
-dontwarn org.apache.**

但是仍然不起作用,怎么了?我真的不明白该怎么办。PS,您对优化我的文件有什么建议吗?提前致谢。


问题答案:

我有同样的问题。

我在这里找到了答案,并且对我有用:如何将ApacheHTTPAPI(旧版)添加为build.grade的编译时依赖项?

在顶层build.gradle文件中添加:

buildscript {
    ...
    dependencies {
        classpath 'com.android.tools.build:gradle:1.3.1'
    }
}
...

在特定于应用的build.gradle文件中添加:

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.0"
    useLibrary 'org.apache.http.legacy'
    ...
}

希望对你有帮助!现在可以在ProGuard上使用。我和你有完全一样的问题。



 类似资料:
  • 但还是不行,怎么了?我真的不明白我能做什么。PS为了优化我的文件,你有什么建议吗?提前道谢。

  • 业务订包方面 每月初全量卡订包检查,每天按订单定比抽取部分号码订包检查,失败号码次日凌晨复查,异常结果邮件报警,有问题第一时间反馈处理 基础功能方面 接入第三方测试平台,对号码在全国23个主要省份进行短信、网络方面测试,其中包括:短信漫游接收、网络ping测试、网络ftp上传、下载速度,GPRS网络附着率方面的基础功能以及每天24小时监控,提供详细准确的测试结果。异常结果邮件报警。 接口测试 对外

  • 我正在运行spring boot,KafkaListener是我的客户。问题是我们如何从失败的kafka配置中恢复,并避免应用程序在退出代码为0的过程结束时停止。例如,不正确的配置可能是不正确的endpointurl。如果无法访问Kafka服务器,也会出现同样的情况。因此,在任何情况下,KafkaListner进程都不应该杀死服务器。 ontext.java:895应用程序上下文异常:未能启动be

  • 主要内容:1.数据链路介绍,2.数据层测试,3.应用层测试,4.后续规划1.数据链路介绍 应用服务层、数据网关层、应用存储层、数据仓库,并且作业开发、元数据管理等平台为数据计算、任务调度以及数据查询提供了基础能力。 对于质量把控来说,最核心的两个部分是:数据仓库以及数据应用部分。因为这两部分属于数据链路中的核心环节,相对于其他层级而言,日常改动也更为频繁,出现问题的风险也比较大。 2.数据层测试 数据层的质量保障,可以分成三个方面:数据及时性、完整性、准确性。 2.1

  • 我在FUSE ESB中公开了一个CXF webservice。在出现异常的情况下,应用程序将抛出SOAP错误,响应在SOAP UI中如下所示。如何避免/删除响应中的classContext标记。

  • 我是个新手。js和我无法获得一个简单的POST请求来工作。我使用的是angular版本1.4。8.我的请求从未发送到服务器。相反,客户端似乎在发出请求之前出错了。我看不出我做错了什么,尽管我已经阅读了这里的文档:https://docs.angularjs.org/api/ng/service/$http#post。以下是我的相关错误信息(使用下面的代码示例生成): {“数据”:null,“状态”