腾讯X5TBS 混淆规则

jar包本来就已经是混淆好的了,如果你打包时候没有添加规则再混淆一遍的话,就会无法使用x5内核了。所以需要添加混淆规则:

下载混淆文件:http://res.imtt.qq.com/TES/proguard.zip

解压后用文本编辑器打开,复制里面的内容到你项目的proguard-rules.pro混淆文件即可。

也可从这复制

#------tbs腾讯x5混淆规则-------

#-optimizationpasses 7
#-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*
-dontoptimize
-dontusemixedcaseclassnames
-verbose
-dontskipnonpubliclibraryclasses
-dontskipnonpubliclibraryclassmembers
-dontwarn dalvik.**
-dontwarn com.tencent.smtt.**
#-overloadaggressively

# ------------------ Keep LineNumbers and properties ---------------- #
-keepattributes Exceptions,InnerClasses,Signature,Deprecated,SourceFile,LineNumberTable,*Annotation*,EnclosingMethod
# --------------------------------------------------------------------------

# Addidional for x5.sdk classes for apps

-keep class com.tencent.smtt.export.external.**{
    *;
}

-keep class com.tencent.tbs.video.interfaces.IUserStateChangedListener {
    *;
}

-keep class com.tencent.smtt.sdk.CacheManager {
    public *;
}

-keep class com.tencent.smtt.sdk.CookieManager {
    public *;
}

-keep class com.tencent.smtt.sdk.WebHistoryItem {
    public *;
}

-keep class com.tencent.smtt.sdk.WebViewDatabase {
    public *;
}

-keep class com.tencent.smtt.sdk.WebBackForwardList {
    public *;
}

-keep public class com.tencent.smtt.sdk.WebView {
    public ;
    public ;
}

-keep public class com.tencent.smtt.sdk.WebView$HitTestResult {
    public static final ;
    public java.lang.String getExtra();
    public int getType();
}

-keep public class com.tencent.smtt.sdk.WebView$WebViewTransport {
    public ;
}

-keep public class com.tencent.smtt.sdk.WebView$PictureListener {
    public ;
    public ;
}


-keepattributes InnerClasses

-keep public enum com.tencent.smtt.sdk.WebSettings$** {
    *;
}

-keep public enum com.tencent.smtt.sdk.QbSdk$** {
    *;
}

-keep public class com.tencent.smtt.sdk.WebSettings {
    public *;
}


-keepattributes Signature
-keep public class com.tencent.smtt.sdk.ValueCallback {
    public ;
    public ;
}

-keep public class com.tencent.smtt.sdk.WebViewClient {
    public ;
    public ;
}

-keep public class com.tencent.smtt.sdk.DownloadListener {
    public ;
    public ;
}

-keep public class com.tencent.smtt.sdk.WebChromeClient {
    public ;
    public ;
}

-keep public class com.tencent.smtt.sdk.WebChromeClient$FileChooserParams {
    public ;
    public ;
}

-keep class com.tencent.smtt.sdk.SystemWebChromeClient{
    public *;
}
# 1. extension interfaces should be apparent
-keep public class com.tencent.smtt.export.external.extension.interfaces.* {
    public protected *;
}

# 2. interfaces should be apparent
-keep public class com.tencent.smtt.export.external.interfaces.* {
    public protected *;
}

-keep public class com.tencent.smtt.sdk.WebViewCallbackClient {
    public protected *;
}

-keep public class com.tencent.smtt.sdk.WebStorage$QuotaUpdater {
    public ;
    public ;
}

-keep public class com.tencent.smtt.sdk.WebIconDatabase {
    public ;
    public ;
}

-keep public class com.tencent.smtt.sdk.WebStorage {
    public ;
    public ;
}

-keep public class com.tencent.smtt.sdk.DownloadListener {
    public ;
    public ;
}

-keep public class com.tencent.smtt.sdk.QbSdk {
    public ;
    public ;
}

-keep public class com.tencent.smtt.sdk.QbSdk$PreInitCallback {
    public ;
    public ;
}
-keep public class com.tencent.smtt.sdk.CookieSyncManager {
    public ;
    public ;
}

-keep public class com.tencent.smtt.sdk.Tbs* {
    public ;
    public ;
}

-keep public class com.tencent.smtt.utils.LogFileUtils {
    public ;
    public ;
}

-keep public class com.tencent.smtt.utils.TbsLog {
    public ;
    public ;
}

-keep public class com.tencent.smtt.utils.TbsLogClient {
    public ;
    public ;
}

-keep public class com.tencent.smtt.sdk.CookieSyncManager {
    public ;
    public ;
}

# Added for game demos
-keep public class com.tencent.smtt.sdk.TBSGamePlayer {
    public ;
    public ;
}

-keep public class com.tencent.smtt.sdk.TBSGamePlayerClient* {
    public ;
    public ;
}

-keep public class com.tencent.smtt.sdk.TBSGamePlayerClientExtension {
    public ;
    public ;
}

-keep public class com.tencent.smtt.sdk.TBSGamePlayerService* {
    public ;
    public ;
}

-keep public class com.tencent.smtt.utils.Apn {
    public ;
    public ;
}
-keep class com.tencent.smtt.** {
    *;
}
# end


-keep public class com.tencent.smtt.export.external.extension.proxy.ProxyWebViewClientExtension {
    public ;
    public ;
}

-keep class MTT.ThirdAppInfoNew {
    *;
}

-keep class com.tencent.mtt.MttTraceEvent {
    *;
}

# Game related
-keep public class com.tencent.smtt.gamesdk.* {
    public protected *;
}

-keep public class com.tencent.smtt.sdk.TBSGameBooter {
        public ;
        public ;
}

-keep public class com.tencent.smtt.sdk.TBSGameBaseActivity {
    public protected *;
}

-keep public class com.tencent.smtt.sdk.TBSGameBaseActivityProxy {
    public protected *;
}

-keep public class com.tencent.smtt.gamesdk.internal.TBSGameServiceClient {
    public *;
}
#---------------------------------------------------------------------------


#------------------  下方是android平台自带的排除项,这里不要动         ----------------

-keep public class * extends android.app.Activity{
    public ;
    public ;
}
-keep public class * extends android.app.Application{
    public ;
    public ;
}
-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.BackupAgentHelper
-keep public class * extends android.preference.Preference

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

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

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

-keepattributes *Annotation*

-keepclasseswithmembernames class *{
    native ;
}

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

#------------------  下方是共性的排除项目         ----------------
# 方法名中含有“JNI”字符的,认定是Java Native Interface方法,自动排除
# 方法名中含有“JRI”字符的,认定是Java Reflection Interface方法,自动排除

-keepclasseswithmembers class * {
    ... *JNI*(...);
}

-keepclasseswithmembernames class * {
    ... *JRI*(...);
}

-keep class **JNI* {*;}


你可能感兴趣的:(腾讯X5TBS 混淆规则)