From aa46855e60ea439a484dff2d32e3f578b085a5cf Mon Sep 17 00:00:00 2001 From: v7lin Date: Tue, 30 Jun 2020 23:06:08 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=20Android=20=E4=BE=9D?= =?UTF-8?q?=E8=B5=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- android/build.gradle | 16 +++++++++-- android/consumer-rules.pro | 3 --- android/consumer-vendor-rules.pro | 3 +++ android/src/main/AndroidManifest.xml | 34 +---------------------- android/src/vendor/AndroidManifest.xml | 37 ++++++++++++++++++++++++++ 5 files changed, 55 insertions(+), 38 deletions(-) create mode 100644 android/consumer-vendor-rules.pro create mode 100644 android/src/vendor/AndroidManifest.xml diff --git a/android/build.gradle b/android/build.gradle index 2a1837e..391aaaf 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -37,10 +37,22 @@ android { lintOptions { disable 'InvalidPackage' } + + flavorDimensions 'vendor' + + productFlavors { + vendor { + dimension 'vendor' + + // library 混淆 -> 随 library 引用,自动添加到 apk 打包混淆 + consumerProguardFiles 'consumer-vendor-rules.pro' + } + } } dependencies { - implementation fileTree(include: ['*.jar'], dir: 'libs') + implementation 'androidx.annotation:annotation:1.0.0' - implementation 'androidx.legacy:legacy-support-v4:1.0.0' + vendorImplementation fileTree(include: ['*.jar'], dir: 'libs') + vendorImplementation 'androidx.legacy:legacy-support-v4:1.0.0' } diff --git a/android/consumer-rules.pro b/android/consumer-rules.pro index 93985ed..e69de29 100644 --- a/android/consumer-rules.pro +++ b/android/consumer-rules.pro @@ -1,3 +0,0 @@ -# --- open_sdk --- - --keep class com.tencent.** {*;} diff --git a/android/consumer-vendor-rules.pro b/android/consumer-vendor-rules.pro new file mode 100644 index 0000000..da69731 --- /dev/null +++ b/android/consumer-vendor-rules.pro @@ -0,0 +1,3 @@ +# --- QQ --- + +-keep class com.tencent.** {*;} diff --git a/android/src/main/AndroidManifest.xml b/android/src/main/AndroidManifest.xml index a4242b4..1e3d957 100644 --- a/android/src/main/AndroidManifest.xml +++ b/android/src/main/AndroidManifest.xml @@ -1,39 +1,7 @@ - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + +