Skip to content

Commit

Permalink
修复app.autojs.versionName和app.autojs.versionCode问题
Browse files Browse the repository at this point in the history
  • Loading branch information
wilinz committed Aug 13, 2022
1 parent 8f5a5f8 commit af54fd8
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions autojs/src/main/assets/modules/__app__.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,16 @@ module.exports = function (runtime, global) {
app.versionCode = context.getPackageManager().getPackageInfo(context.getPackageName(), 0).versionCode;
app.versionName = context.getPackageManager().getPackageInfo(context.getPackageName(), 0).versionName;

var buildConfig
if (context.getPackageName().startsWith("org.autojs.autoxjs")){
buildConfig = org.autojs.autoxjs.BuildConfig
}else{
buildConfig = org.autojs.autoxjs.inrt.BuildConfig
}

app.autojs = {
versionCode: org.autojs.autoxjs.BuildConfig.VERSION_CODE,
versionName: org.autojs.autoxjs.BuildConfig.VERSION_NAME
versionCode: buildConfig.VERSION_CODE,
versionName: buildConfig.VERSION_NAME
};

app.intentToShell = function(i) {
Expand Down

0 comments on commit af54fd8

Please sign in to comment.