Open TechnoHT opened 3 years ago
On Windows you must enter the tools' full path in the project.yaml
.
On Windows you must enter the tools' full path in the
project.yaml
.
I pointed directly to the wrapper script, or execute directly from PATH, it seem to Work until apktool found the file path but failed to decompile it
How was it "failed to decompile it"?
take a quick look at
info: Removing old Android unpacked files
info: Unpacking Android original package
info: Execuating ["apktool", "d", "C:\\Users\\hieut\\arcaea-builder\\project\\original\\arcaea_3.5.3c.apk", "-o", "C:\\Users\\hieut\\arcaea-builder\\project\\original\\package"]
info: Removing extra 64 bit binaries from Android unpacked files
Error: spawnSync apktool ENOENT
It found and executed apktook.bat ( which is the wrapper script ) but nothing showed up afterwards, no matter I point the project.yaml to the apktool.jar or apktool.bat, $PATH either.
Oh no sorry I didn't use the path provided by project.yaml
. I'll fix it right now.
yarn run v1.22.10
$ ts-node -r tsconfig-paths/register src/main unpack
info: Project directory: C:\Users\hieut\arcaea-builder\project
info: Removing old Android unpacked files
info: Unpacking Android original package
info: Execuating ["C:/Windows", "d", "C:\\Users\\hieut\\arcaea-builder\\project\\original\\arcaea_3.5.3c.apk", "-o", "C:\\Users\\hieut\\arcaea-builder\\project\\original\\package"]
info: Removing extra 64 bit binaries from Android unpacked files
Error: spawnSync C:/Windows ENOENT
at Object.spawnSync (node:internal/child_process:1086:20)
at spawnSync (node:child_process:693:24)
at Object.execFileSync (node:child_process:720:15)
at Object.exec (C:\Users\hieut\arcaea-builder\src\lib\exec.ts:8:17)
at Object.action (C:\Users\hieut\arcaea-builder\src\actions\unpack.ts:24:7)
at Object.runAction (C:\Users\hieut\arcaea-builder\src\action.ts:35:10)
error Command failed with exit code 1.
I: Using Apktool 2.5.0 on arcaea_3.5.3c.apk
I: Loading resource table...
I: Decoding AndroidManifest.xml with resources...
I: Loading resource table from file: C:\Users\hieut\AppData\Local\apktool\framework\1.apk
I: Regular manifest package...
I: Decoding file-resources...
I: Decoding values */* XMLs...
I: Baksmaling classes.dex...
I: Copying assets and libs...
I: Copying unknown files...
I: Copying original files...
Press any key to continue . . .
info: Removing extra 64 bit binaries from Android unpacked files
info: Removing ALL songs (except for tutorial) from Android unpack files
Done in 30.06s.
Worked Not really what I expected 😂 exec apktool after the error I will try to rewrite exec.ts to execute the wrapper script instead
What did you write in your project.yaml
both produced the same thing
tools:
apktool: C:\Windows\apktool.bat
jarsigner: jarsigner
targets:
android: arcaea_3.5.3c.apk
tools:
apktool: C:\Windows
jarsigner: jarsigner
targets:
android: arcaea_3.5.3c.apk
C:\Windows is where I put the apktool.jar and apktool.bat
if I point the .jar file it need to be executed under java -jar apktool.jar
instead
C:\Windows\apktool.bat
is correct
told ya both give the
Error: spawnSync C:/Windows ENOENT
because the command apktool can be executed from the wrapper script without .bat/.cmd unless exec.ts require .bat/.cmd
I don't know why your C:\Windows\apktool.bat
leads to spawnSync C:/Windows
... The filename is eaten ...
will try to make a specific snippet for Windows
for now it seem to work except the press any key to continue .....
because the .bat/.cmd can't be called from exec.ts with the command only 😂
Why it can't be called? I'm not familiar with Windows but I think .bat is just like .sh
In Windows certain command or $PATH have to be suffixed with .bat/.cmd because PATH/APPEND/PROMPT/SET/ASSOC in .cmd files will set ERRORLEVEL regardless of error while .bat sets ERRORLEVEL only on errors. have to be called with something similar to
require('child_process').spawnSync('apktool.bat')
or include cross-spawn module for spawnSync
So why I can't execFileSync("C:\\Windows\\apktool.bat")
?
I don't really know if it's related to the Windows compatibility layer for .bat .bat is for 16-bit env, while .cmd is for 32-bit env ( similar to .sh ) so far the only solution I'm trying is cross spawn
It seem like Linux fs path is not compatible with WinNT