安卓签名

plugins {
id 'com.android.application'
}

android {
compileSdkVersion 30
buildToolsVersion "30.0.3"

defaultConfig {
applicationId "com.example.paipan"
minSdkVersion 28
targetSdkVersion 30
versionCode 1
versionName "1.0"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

signingConfigs {
release {//发布版本的签名配置
keyAlias 'key0'
keyPassword '331415926'
storeFile file('D:/android/xxx.jks')
storePassword '331415926'
}
debug {//调试版本的签名配置
keyAlias 'key0'
keyPassword '331415926'
storeFile file('D:/android/xxx.jks')
storePassword '331415926'
}
}

buildTypes {
release { //生成release apk
zipAlignEnabled true //4字节对齐,减少运行内存消耗 
minifyEnabled true //false = 关闭混淆
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
}
debug { //生成debug apk
zipAlignEnabled true
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}

dependencies {

implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'com.google.android.material:material:1.2.1'
implementation 'androidx.constraintlayout:constraintlayout:2.0.1'
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
}

posted on 2021-07-15 23:38  万里驰骋  阅读(63)  评论(0编辑  收藏  举报

导航