Only show App Bundle warning after patching single APK
This commit is contained in:
+4
-2
@@ -4,7 +4,7 @@ import chalk from 'chalk'
|
||||
import Listr from 'listr'
|
||||
import tempy from 'tempy'
|
||||
|
||||
import patchApk from './patch-apk'
|
||||
import patchApk, { showAppBundleWarning } from './patch-apk'
|
||||
import { patchXapkBundle, patchApksBundle } from './patch-app-bundle'
|
||||
|
||||
import Apktool from './tools/apktool'
|
||||
@@ -64,7 +64,9 @@ async function main() {
|
||||
console.log(chalk.dim(` Using temporary directory:\n ${tmpDir}\n`))
|
||||
|
||||
taskFunction({ inputPath, outputPath, tmpDir, apktool }).run().then(context => {
|
||||
if (context.onFinished) context.onFinished()
|
||||
if (taskFunction === patchApk && context.usesAppBundle) {
|
||||
showAppBundleWarning()
|
||||
}
|
||||
|
||||
console.log(
|
||||
chalk`\n {green.inverse Done! } Patched file: {bold ./${outputName}}\n`,
|
||||
|
||||
+2
-4
@@ -30,9 +30,7 @@ export default function patchApk({ inputPath, outputPath, tmpDir, apktool }: Tas
|
||||
)
|
||||
nscName = result.nscName
|
||||
|
||||
if (result.usesAppBundle) {
|
||||
context.onFinished = showAppBundleWarning
|
||||
}
|
||||
context.usesAppBundle = result.usesAppBundle
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -87,7 +85,7 @@ export default function patchApk({ inputPath, outputPath, tmpDir, apktool }: Tas
|
||||
])
|
||||
}
|
||||
|
||||
function showAppBundleWarning() {
|
||||
export function showAppBundleWarning() {
|
||||
console.log(chalk`{yellow
|
||||
{inverse.bold WARNING }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user