From 2c8ad576f34fce45ede53e8e85bd92d5dc5cf79b Mon Sep 17 00:00:00 2001
From: hch <305670599@qq.com>
Date: 星期三, 14 八月 2024 18:33:27 +0800
Subject: [PATCH] 0312 越南官网sdk通信改非明文

---
 SdkProject/library/build.gradle |  139 ++++++++++++++++++++++++++++++++++++----------
 1 files changed, 109 insertions(+), 30 deletions(-)

diff --git a/SdkProject/library/build.gradle b/SdkProject/library/build.gradle
index 3c23e87..f324c84 100644
--- a/SdkProject/library/build.gradle
+++ b/SdkProject/library/build.gradle
@@ -1,6 +1,7 @@
 plugins {
     id 'com.android.library'
 }
+
 def rootPath = rootProject.getRootDir().getAbsolutePath()
 def channelPath = "${rootPath}/channel/${CHANNEL_NAME}"
 
@@ -13,6 +14,7 @@
 
 applyGradle("${rootPath}/utils")//宸ュ叿鑴氭湰
 applyGradle("${channelPath}/build")//娓犻亾鑴氭湰
+applyGradle("${channelPath}/deps")//娓犻亾鐨勮繙绋嬩緷璧栬剼鏈�
 
 Properties localProp = loadProperties('local')//鏈湴閰嶇疆
 Properties channelProp = loadProperties("${channelPath}/config")//娓犻亾鎵�灞炵殑閰嶇疆
@@ -24,24 +26,27 @@
 //鎻掍欢鑴氭湰
 plugins.each {
     applyGradle("${rootPath}/plugins/${it}/build")
+    applyGradle("${rootPath}/plugins/${it}/deps")
 }
 
 //娓犻亾闇�瑕佽鐩栦富鐩綍鐨刯ava鏂囦欢
 def channelJavaFiles = getAllFiles(new ArrayList<File>(), "${channelPath}/java")
 
 android {
-    compileSdkVersion 29
-    buildToolsVersion "30.0.2"
+    compileSdkVersion 34
+    buildToolsVersion "34.0.0"
 
     defaultConfig {
         minSdkVersion 21
-        targetSdkVersion 29
+        targetSdkVersion 34
         versionCode 1
         versionName "1.0"
 
-        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
+//        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
         consumerProguardFiles "consumer-rules.pro"
+        multiDexEnabled true
     }
+
 
     flavorDimensions "version"
     productFlavors {
@@ -57,9 +62,10 @@
         }
     }
     compileOptions {
-        sourceCompatibility JavaVersion.VERSION_1_8
-        targetCompatibility JavaVersion.VERSION_1_8
+        sourceCompatibility JavaVersion.VERSION_11
+        targetCompatibility JavaVersion.VERSION_11
     }
+    packagingOptions {exclude 'META-INF/rxjava.properties'}
     lintOptions {
         checkReleaseBuilds false
         abortOnError false
@@ -96,11 +102,7 @@
                 java.srcDirs "${pluginPath}/java"
                 jniLibs.srcDirs "${pluginPath}libs"
                 res.srcDirs "${pluginPath}/res"
-                manifest {
-                    File file = file("${pluginPath}/AndroidManifest.xml")
-                    if (file.exists())
-                        srcFile "${pluginPath}/AndroidManifest.xml"
-                }
+                //娓呭崟鍙兘鍚堝苟涓�涓紝鎵�鏈夋彃浠剁殑娓呭崟闇�瑕佹墜鍔ㄥ鍒跺埌瀵瑰簲鐨勬笭閬撻噷
             }
         }
     }
@@ -112,32 +114,109 @@
     }
 }
 
-//鎷疯礉娓呭崟鏂囦欢浣滀负unity鐩存帴浣跨敤
+//鎷疯礉娓呭崟鏂囦欢
+task copyDebugManifest(type: Copy) {
+    from zipTree("build/outputs/aar/library-debug-${CHANNEL_NAME}.aar")
+    include "AndroidManifest.xml"
+    into "${outPutPath}\\${CHANNEL_NAME}\\debug"
+}
+//鎷疯礉娓呭崟鏂囦欢
 task copyManifest(type: Copy) {
-    dependsOn 'assembleRelease'
+    dependsOn 'copyDebugManifest'
     from zipTree("build/outputs/aar/library-release-${CHANNEL_NAME}.aar")
     include "AndroidManifest.xml"
-    into "${outPutPath}\\${CHANNEL_NAME}\\"
+    into "${outPutPath}\\${CHANNEL_NAME}\\release"
+}
+
+//鎷疯礉debug aar
+task copyDebugSdk(type: Copy) {
+    from "build/outputs/aar/"
+    include "library-debug-${CHANNEL_NAME}.aar"
+    into "${outPutPath}\\${CHANNEL_NAME}\\debug\\libs\\"
+}
+
+task copyReleaseSdk(type: Copy) {
+    from "build/outputs/aar/"
+    include "library-release-${CHANNEL_NAME}.aar"
+    into "${outPutPath}\\${CHANNEL_NAME}\\release\\libs\\"
+}
+
+task deleteSdk() {
+    delete "${outPutPath}\\${CHANNEL_NAME}\\debug"
+    delete "${outPutPath}\\${CHANNEL_NAME}\\release"
 }
 
 //鎵ц鎵撳寘浠诲姟浠ュ強鎷疯礉鍒板閮�
-task assembleAndCopySdk(type: Copy) {
-    dependsOn copyManifest
-    from "build/outputs/aar/"
-    include "library-release-${CHANNEL_NAME}.aar"
-    into "${outPutPath}\\${CHANNEL_NAME}\\libs\\"
+task assembleAndCopySdk() {
+    dependsOn 'assemble'
+    dependsOn deleteSdk
+    dependsOn copyDebugSdk
+    dependsOn copyReleaseSdk
+
+    tasks.findByName('deleteSdk').mustRunAfter 'assembleMerger'
+    tasks.findByName('copyDebugSdk').mustRunAfter 'deleteSdk'
+    tasks.findByName('copyReleaseSdk').mustRunAfter 'deleteSdk'
+
+    //瀵煎嚭鎵�鏈夊閮ㄥ紩鐢�
+    String content = ""
+    def deps = file("${channelPath}\\deps.gradle")
+    deps.eachLine { line ->
+        if (line != null)
+            content += line + "\n"
+    }
+    plugins.each {
+        deps = file("${rootPath}/plugins/${it}/deps.gradle")
+        if(deps.exists()){
+            deps.eachLine { line ->
+                if (line != null)
+                    content += line + "\n"
+            }
+        }
+    }
+    def dir = new File("${outPutPath}\\${CHANNEL_NAME}")
+    def libraries = new File("${outPutPath}\\${CHANNEL_NAME}\\deps.gradle")
+    dir.mkdir()
+    if (libraries.exists())
+        libraries.delete()
+    if (!libraries.exists())
+        libraries.createNewFile()
+    libraries.text = content
 }
 
 dependencies {
-    implementation 'androidx.appcompat:appcompat:1.2.0'
-    implementation 'com.google.android.material:material:1.2.1'
-    implementation 'androidx.constraintlayout:constraintlayout:2.0.3'
-    implementation 'androidx.navigation:navigation-fragment:2.3.1'
-    implementation 'androidx.navigation:navigation-ui:2.3.1'
-    testImplementation 'junit:junit:4.13.1'
-    androidTestImplementation 'androidx.test.ext:junit:1.1.2'
-    androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
 
-    implementation 'com.github.pqpo:Log4a:1.4.2@aar'
-    implementation files('libs/unity-classes.jar')
-}
\ No newline at end of file
+    implementation fileTree(dir: "../channel/${CHANNEL_NAME}/libs/", include: ['*.jar'])
+    plugins.each {
+        implementation fileTree(dir: "${rootPath}/plugins/${it}/libs/", include: ['*.jar'])
+    }
+    implementation fileTree(dir: 'libs', include: ['*.jar'], exclude: ['unity-classes.jar'])
+    compileOnly files('libs/unity-classes.jar')
+
+//浠ヤ笅涓哄繀闇�渚濊禆鐨勫簱
+    implementation(name: 'ald_v', ext: 'aar')
+    //SDK鍩虹鑳藉姏
+    implementation 'com.appsflyer:af-android-sdk:6.9.0'
+    implementation 'com.android.installreferrer:installreferrer:2.2'
+    api 'androidx.annotation:annotation:1.5.0'
+    api 'androidx.core:core:1.6.0'
+    api 'androidx.percentlayout:percentlayout:1.0.0'
+    //google ID
+    implementation 'com.google.android.gms:play-services-ads-identifier:18.0.1'
+    //firebase
+    implementation 'com.google.firebase:firebase-analytics'
+    implementation platform('com.google.firebase:firebase-bom:31.2.2') {
+        exclude group: 'com.android.support', module: 'support-compat'
+    }
+    //base  theme
+    api 'androidx.appcompat:appcompat:1.2.0'
+    //ald ui鐢�
+    api 'androidx.cardview:cardview:1.0.0'
+
+    //rustore
+    implementation 'org.jetbrains:annotations:15.0'
+    implementation("ru.rustore.sdk:billingclient:6.0.0")
+
+    //paypal
+    //implementation('com.paypal.checkout:android-sdk:1.3.0')
+    implementation('androidx.browser:browser:1.5.0')
+}

--
Gitblit v1.8.0