Browse Source

自定义安卓签名任务

everywindchase 9 months ago
parent
commit
ad64de6537

+ 28 - 1
app/build.gradle

@@ -13,7 +13,7 @@ android {
         targetSdk 34
         versionCode 1
         versionName "1.0"
-
+        ndk { abiFilters    "armeabi","x86","x86_64","armeabi-v7a","arm64-v8a" }
         testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
     }
 
@@ -23,6 +23,33 @@ android {
             proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
         }
     }
+    splits  {
+        abi {
+//            enable  true
+//            reset()
+            include "armeabi","x86","x86_64","armeabi-v7a","arm64-v8a"
+//            universalApk   false
+        }
+
+    }
+
+
+
+//    signingConfigs {
+//        release {
+//            storeFile file('..\\keystore\\psbc.jks')
+//            storePassword '123456'
+//            keyAlias 'psbc'
+//            keyPassword '123456'
+//        }
+//        debug{
+//            storeFile file('..\\keystore\\psbc.jks')
+//            storePassword '123456'
+//            keyAlias 'psbc'
+//            keyPassword '123456'
+//        }
+//    }
+
     compileOptions {
         sourceCompatibility JavaVersion.VERSION_1_8
         targetCompatibility JavaVersion.VERSION_1_8

+ 1 - 1
app/src/main/AndroidManifest.xml

@@ -3,7 +3,7 @@
           xmlns:tools="http://schemas.android.com/tools">
 
     <application
-            android:name=".app.InternalApp"
+            android:name=".apps.InternalApp"
             android:allowBackup="true"
             android:dataExtractionRules="@xml/data_extraction_rules"
             android:fullBackupContent="@xml/backup_rules"

+ 1 - 1
app/src/main/java/jx/cn/escort/app/InternalApp.kt → app/src/main/java/jx/cn/escort/apps/InternalApp.kt

@@ -1,4 +1,4 @@
-package jx.cn.escort.app
+package jx.cn.escort.apps
 
 import android.app.Application
 import androidx.lifecycle.Lifecycle

+ 3 - 1
build.gradle

@@ -2,4 +2,6 @@
 plugins {
 id 'com.android.application' version '8.2.0' apply false
     id 'org.jetbrains.kotlin.android' version '1.9.23' apply false
-}
+}
+
+apply from: rootProject.file("gradle/sign.gradle")

+ 18 - 0
gradle/sign.gradle

@@ -0,0 +1,18 @@
+tasks.register('generateKeystore') {
+    group  'sign'
+    description 'create jks'
+    doFirst {
+        def keystorePath = "D:\\home_work\\escort-app\\app\\sign\\demo.jks"
+        exec {
+            workingDir "."
+            commandLine "D:\\jdk\\jdk-17.0.10\\bin\\keytool", "-genkey","-v",
+                    "-alias", "jx.escort",
+                    "-keyalg", "RSA",
+                    "-keypass", "jxit12",
+                    "-storepass", "jxit12",
+                    "-keystore", keystorePath,
+                    "-keysize" ,2048,
+                    "-validity", 30
+        }
+    }
+}

+ 2 - 2
gradle/wrapper/gradle-wrapper.properties

@@ -1,6 +1,6 @@
-#Wed May 22 10:33:05 CST 2024
+#Wed May 22 19:04:59 CST 2024
 distributionBase=GRADLE_USER_HOME
 distributionPath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
 zipStoreBase=GRADLE_USER_HOME
 zipStorePath=wrapper/dists