Commit 885de2dc by pye52

增加daemon打包时自动签名的配置及证书,避免因为daemon没有签名而安装失败

parent 0b51e3c7
apply plugin: 'com.android.application' apply plugin: 'com.android.application'
apply plugin: 'kotlin-android' apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions' apply plugin: 'kotlin-android-extensions'
android { android {
......
package com.bgycc.smartcanteen.util; package com.bgycc.smartcanteen.util;
import android.app.PendingIntent; import android.app.PendingIntent;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
...@@ -8,8 +9,8 @@ import android.support.annotation.RequiresPermission; ...@@ -8,8 +9,8 @@ import android.support.annotation.RequiresPermission;
import android.telephony.SmsManager; import android.telephony.SmsManager;
import android.telephony.TelephonyManager; import android.telephony.TelephonyManager;
import android.text.TextUtils; import android.text.TextUtils;
import android.util.Log;
import com.blankj.utilcode.util.LogUtils;
import com.blankj.utilcode.util.ShellUtils; import com.blankj.utilcode.util.ShellUtils;
import com.blankj.utilcode.util.Utils; import com.blankj.utilcode.util.Utils;
...@@ -117,7 +118,7 @@ public class DangerousUtils { ...@@ -117,7 +118,7 @@ public class DangerousUtils {
&& commandResult.successMsg.toLowerCase().contains("success")) { && commandResult.successMsg.toLowerCase().contains("success")) {
return true; return true;
} else { } else {
Log.e("AppUtils", "installAppSilent successMsg: " + commandResult.successMsg + LogUtils.e("AppUtils", "installAppSilent successMsg: " + commandResult.successMsg +
", errorMsg: " + commandResult.errorMsg); ", errorMsg: " + commandResult.errorMsg);
return false; return false;
} }
...@@ -173,7 +174,7 @@ public class DangerousUtils { ...@@ -173,7 +174,7 @@ public class DangerousUtils {
&& commandResult.successMsg.toLowerCase().contains("success")) { && commandResult.successMsg.toLowerCase().contains("success")) {
return true; return true;
} else { } else {
Log.e("AppUtils", "uninstallAppSilent successMsg: " + commandResult.successMsg + LogUtils.e("AppUtils", "uninstallAppSilent successMsg: " + commandResult.successMsg +
", errorMsg: " + commandResult.errorMsg); ", errorMsg: " + commandResult.errorMsg);
return false; return false;
} }
...@@ -325,7 +326,7 @@ public class DangerousUtils { ...@@ -325,7 +326,7 @@ public class DangerousUtils {
setDataEnabledMethod.invoke(tm, enabled); setDataEnabledMethod.invoke(tm, enabled);
return true; return true;
} catch (Exception e) { } catch (Exception e) {
Log.e("NetworkUtils", "setMobileDataEnabled: ", e); LogUtils.e("NetworkUtils", "setMobileDataEnabled: ", e);
} }
return false; return false;
} }
......
...@@ -12,6 +12,22 @@ android { ...@@ -12,6 +12,22 @@ android {
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
} }
signingConfigs {
canteen {
keyAlias 'town'
keyPassword 'maxrocky'
storeFile file('./canteen.jks')
storePassword 'maxrocky'
}
buildTypes {
debug {
signingConfig signingConfigs.canteen
}
release {
signingConfig signingConfigs.canteen
}
}
}
buildTypes { buildTypes {
debug { debug {
minifyEnabled false minifyEnabled false
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment