version:1.1
update: bugfixes:修复闪退
This commit is contained in:
@@ -1,5 +1,13 @@
|
|||||||
apply plugin: 'com.android.application'
|
apply plugin: 'com.android.application'
|
||||||
|
|
||||||
|
static def appName() {
|
||||||
|
return "HomeVideoPlayer"
|
||||||
|
}
|
||||||
|
|
||||||
|
static def releaseTime() {
|
||||||
|
return new Date().format("yyyyMMdd-HHmmss", TimeZone.getDefault())
|
||||||
|
}
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdkVersion 28
|
compileSdkVersion 28
|
||||||
buildToolsVersion "30.0.3"
|
buildToolsVersion "30.0.3"
|
||||||
@@ -24,42 +32,63 @@ android {
|
|||||||
abortOnError false
|
abortOnError false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//签名
|
|
||||||
signingConfigs {
|
|
||||||
debug {
|
|
||||||
storeFile file("src/doc/tuixin.jks")
|
|
||||||
storePassword "123456"
|
|
||||||
keyAlias "universal"
|
|
||||||
keyPassword "123456"
|
|
||||||
v2SigningEnabled false
|
|
||||||
}
|
|
||||||
release {// 签名文件
|
|
||||||
storeFile file("src/doc/tuixin.jks")
|
|
||||||
storePassword "123456"
|
|
||||||
keyAlias "universal"
|
|
||||||
keyPassword "123456"
|
|
||||||
v2SigningEnabled false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
buildTypes {
|
|
||||||
release {
|
|
||||||
minifyEnabled false
|
|
||||||
zipAlignEnabled true
|
|
||||||
signingConfig signingConfigs.release
|
|
||||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
|
||||||
}
|
|
||||||
debug {
|
|
||||||
minifyEnabled false
|
|
||||||
zipAlignEnabled false
|
|
||||||
signingConfig signingConfigs.release
|
|
||||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
compileOptions {
|
compileOptions {
|
||||||
sourceCompatibility JavaVersion.VERSION_1_8
|
sourceCompatibility JavaVersion.VERSION_1_8
|
||||||
targetCompatibility JavaVersion.VERSION_1_8
|
targetCompatibility JavaVersion.VERSION_1_8
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//签名
|
||||||
|
signingConfigs {
|
||||||
|
tuixin {// 签名文件
|
||||||
|
storeFile file("src/doc/tuixin.jks")
|
||||||
|
storePassword "123456"
|
||||||
|
keyAlias "universal"
|
||||||
|
keyPassword "123456"
|
||||||
|
v2SigningEnabled false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
buildTypes {
|
||||||
|
debug {
|
||||||
|
buildConfigField "String", "platform", '"UMTK11"'
|
||||||
|
versionNameSuffix "-debug"
|
||||||
|
//Zipalign优化
|
||||||
|
zipAlignEnabled true
|
||||||
|
minifyEnabled false
|
||||||
|
signingConfig signingConfigs.tuixin
|
||||||
|
applicationVariants.all { variant ->
|
||||||
|
variant.outputs.each { output ->
|
||||||
|
if (outputFile != null) {
|
||||||
|
def fileName = "${appName()}-${variant.versionCode}-V${variant.versionName}-${releaseTime()}-${buildType.name}.apk"
|
||||||
|
output.outputFileName = fileName
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
release {
|
||||||
|
buildConfigField "String", "platform", '"UMTK11"'
|
||||||
|
//Zipalign优化
|
||||||
|
zipAlignEnabled true
|
||||||
|
//混淆
|
||||||
|
minifyEnabled false
|
||||||
|
//前一部分代表系统默认的android程序的混淆文件,该文件已经包含了基本的混淆声明,后一个文件是自己的定义混淆文件
|
||||||
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||||
|
//签名
|
||||||
|
signingConfig signingConfigs.tuixin
|
||||||
|
// 将release版本的包名重命名,加上版本及日期
|
||||||
|
applicationVariants.all { variant ->
|
||||||
|
variant.outputs.each { output ->
|
||||||
|
def outputFile = ""
|
||||||
|
if (outputFile != null) {
|
||||||
|
def fileName = "${appName()}-${variant.versionCode}-V${variant.versionName}-${releaseTime()}-${buildType.name}.apk"
|
||||||
|
output.outputFileName = new File(outputFile, fileName)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
|
|||||||
@@ -440,7 +440,7 @@ public class MainActivity extends BaseLightActivity implements MainAContact.Main
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setHomeVideo(ArrayList<LocalVideoInfo> video) {
|
public void setHomeVideo(ArrayList<LocalVideoInfo> video) {
|
||||||
if (video.size() == 0) {
|
if (video == null || video.size() == 0) {
|
||||||
tips.setVisibility(View.VISIBLE);
|
tips.setVisibility(View.VISIBLE);
|
||||||
recyclerView.setVisibility(View.GONE);
|
recyclerView.setVisibility(View.GONE);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user