From 66ee2fb000a5d542bd95cd732fcbdc76b9cd4e79 Mon Sep 17 00:00:00 2001 From: kvii <13721952202@163.com> Date: Wed, 16 Oct 2024 17:50:06 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E9=A1=B9=E7=9B=AE=E6=89=93?= =?UTF-8?q?=E5=8C=85=E7=9A=84=20apk=20=E5=AE=89=E8=A3=85=E5=90=8E=E6=97=A0?= =?UTF-8?q?=E6=B3=95=E8=BF=90=E8=A1=8C=E7=9A=84=E9=97=AE=E9=A2=98=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../autojs/ui/project/BuildActivity.java | 30 ++++++++++++------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/app/src/main/java/org/autojs/autojs/ui/project/BuildActivity.java b/app/src/main/java/org/autojs/autojs/ui/project/BuildActivity.java index 9bcbfc8b..d7090ab9 100644 --- a/app/src/main/java/org/autojs/autojs/ui/project/BuildActivity.java +++ b/app/src/main/java/org/autojs/autojs/ui/project/BuildActivity.java @@ -423,7 +423,9 @@ private void doBuildingApk() { private ApkBuilder.AppConfig createAppConfig() { if (mProjectConfig != null) { - return ApkBuilder.AppConfig.fromProjectConfig(mSource, mProjectConfig); + return ApkBuilder.AppConfig.fromProjectConfig(mSource, mProjectConfig) + .setAbis(getSelectedAbis()) + .setLibs(getSelectedLibs()); } String jsPath = mSourcePath.getText().toString(); String versionName = mVersionName.getText().toString(); @@ -431,6 +433,18 @@ private ApkBuilder.AppConfig createAppConfig() { String appName = mAppName.getText().toString(); String packageName = mPackageName.getText().toString(); + return new ApkBuilder.AppConfig() + .setAppName(appName) + .setSourcePath(jsPath) + .setPackageName(packageName) + .setVersionName(versionName) + .setVersionCode(versionCode) + .setAbis(getSelectedAbis()) + .setLibs(getSelectedLibs()) + .setIcon(mIsDefaultIcon ? null : () -> BitmapUtils.drawableToBitmap(mIcon.getDrawable())); + } + + private ArrayList getSelectedAbis() { ArrayList abis = new ArrayList<>(); for (int i = 0; i < mFlexboxAbis.getChildCount(); i += 1) { @@ -445,6 +459,10 @@ private ApkBuilder.AppConfig createAppConfig() { } } + return abis; + } + + private ArrayList getSelectedLibs() { ArrayList libs = new ArrayList<>(); for (int i = 0; i < mFlexboxLibs.getChildCount(); i += 1) { @@ -459,15 +477,7 @@ private ApkBuilder.AppConfig createAppConfig() { } } - return new ApkBuilder.AppConfig() - .setAppName(appName) - .setSourcePath(jsPath) - .setPackageName(packageName) - .setVersionName(versionName) - .setVersionCode(versionCode) - .setAbis(abis) - .setLibs(libs) - .setIcon(mIsDefaultIcon ? null : () -> BitmapUtils.drawableToBitmap(mIcon.getDrawable())); + return libs; } private ApkBuilder callApkBuilder(File tmpDir, File outApk, ApkBuilder.AppConfig appConfig) throws Exception {