将打包apk重命名
android { //命令打包apk重命名 android.applicationVariants.all { variant -> variant.outputs.all { outputFileName = "YT-${variant.name}-${variant.versionName}.apk" } } }
manifestPlaceholders妙用
https://www.cnblogs.com/zhaohongtian/p/6808962.html 参考
String jpush_appkey; try { ApplicationInfo appInfo = getPackageManager() .getApplicationInfo(getPackageName(), PackageManager.GET_META_DATA); jpush_appkey = appInfo.metaData.getString("JPUSH_APPKEY"); Logger.d("jpush_appkey=" + jpush_appkey); } catch (PackageManager.NameNotFoundException e) { e.printStackTrace(); }
end