Windows: Error building with NDK
This is the complete output:
D:\dex2c>python dcc.py -a SkyCloudDriven.apk -o out.apk -p --filter filter.txt
[INFO ] dcc: Creating .tmp folder
[INFO ] dcc: Backing up jni folder
[INFO ] dcc: Adjusting Application.mk file using available abis from apk
[INFO ] dcc: No lib abis found in apk, using the ones defined in Application.mk file
[WARNING ] androguard.core.api_specific_resources: Requested API level 35 is larger than maximum we have, returning API level 34 instead.
make: *** No rule to make target 'jni/nc/Java_cn_sky_app_adapter_FileListAdapter_00024_00024ExternalSyntheticLambda0__0003cinit_0003e__Lcn_sky_app_adapter_FileListAdapter_2Lcn_sky_app_adapter_FileListAdapter_00024ViewHolder_2Ljava_lang_String_2.cpp', needed by 'obj/local/armeabi-v7a/objs/stub/nc/Java_cn_sky_app_adapter_FileListAdapter_00024_00024ExternalSyntheticLambda0__0003cinit_0003e__Lcn_sky_app_adapter_FileListAdapter_2Lcn_sky_app_adapter_FileListAdapter_00024ViewHolder_2Ljava_lang_String_2.o'. Stop.
make: *** Waiting for unfinished jobs....
[ERROR ] dcc: Compile SkyCloudDriven.apk failed!
Traceback (most recent call last):
File "D:\QQ\1127367472\FileRecv\Source\dex2c\dcc.py", line 1189, in
Help plz!
Hi @SharkPika,
Just some questions:
- Your initial command shows the project location at
D:\dex2cand then after few lines it shows atD:\QQ\1127367472\FileRecv\Source\dex2c? - What Android NDK Version you're using, have you confirmed the correct location of the ndk path and
ndk-buildfile under it ? - Are you on latest commit of the repo or not?
Thanks, Abhi
Furthermore, you might also want to consider looking at this issue related to windows as well: https://github.com/codehasan/dex2c/issues/33#issuecomment-2507617194
The paths are all correct, but I manually deleted QQ\1127367472\FileRecv\Source\
The NDK version used is the latest stable version, r28b
and I used dex2c after "git clone"
I can run the command manually using CMD, but it seems to suddenly stop halfway through without any errors just like: E:\BaiduNetdiskDownload\Android\Ndk>ndk-build.cmd -j12 -C D:\QQ\1127367472\FileRecv\Source\dex2c\compile\jni make: Entering directory 'D:/QQ/1127367472/FileRecv/Source/dex2c/compile/jni' [armeabi-v7a] Compile++ thumb: stub <= Java_cn_sky_app_BuildConfig__0003cinit_0003e__.cpp make: Leaving directory 'D:/QQ/1127367472/FileRecv/Source/dex2c/compile/jni' make: Entering directory 'D:/QQ/1127367472/FileRecv/Source/dex2c/compile/jni' [armeabi-v7a] Compile++ thumb: stub <= Java_cn_sky_app_LoginActivity_000241__0003cinit_0003e__Lcn_sky_app_LoginActivity_2Ljava_lang_String_2Ljava_lang_String_2.cpp make: Leaving directory 'D:/QQ/1127367472/FileRecv/Source/dex2c/compile/jni' make: Entering directory 'D:/QQ/1127367472/FileRecv/Source/dex2c/compile/jni' [armeabi-v7a] Compile++ thumb: stub <= Java_cn_sky_app_LoginActivity_000241_onFailure__Lretrofit2_Call_2Ljava_lang_Throwable_2.cpp ····· make: Entering directory 'D:/QQ/1127367472/FileRecv/Source/dex2c/compile/jni' [armeabi-v7a] Compile++ thumb: stub <= Java_cn_sky_app_Tool_getImages__Landroid_content_Context_2.cpp make: Leaving directory 'D:/QQ/1127367472/FileRecv/Source/dex2c/compile/jni' make: Entering directory 'D:/QQ/1127367472/FileRecv/Source/dex2c/compile/jni' [armeabi-v7a] Compile++ thumb: stub <= Java_cn_sky_app_Tool_getVideos__Landroid_content_Context_2.cpp make: Leaving directory 'D:/QQ/1127367472/FileRecv/Source/dex2c/compile/jni' make: Entering directory 'D:/QQ/1127367472/FileRecv/Source/dex2c/compile/jni' [armeabi-v7a] Compile++ thumb: stub <= Java_cn_sky_app_adapter_FileListAdapter_00024ViewHolder__0003cinit_0003e__Landroid_view_View_2.cpp make: Leaving directory 'D:/QQ/1127367472/FileRecv/Source/dex2c/compile/jni'
E:\BaiduNetdiskDownload\Android\Ndk>
and done it created "obj" folder under output folder, but the number of files inside is much fewer than the compiled cpp files
I can run the command manually using CMD
You shouldn't do that
I can run the command manually using CMD
You shouldn't do that
I only did this for testing purposes
Please attempt to compile it again with the correct configurations, test it on other sample apps, and verify whether the issue persists exclusively with this specific application. If feasible, provide the sample you are working on to help reproduce the problem.
I am unable to upload the file, so I will only provide a verbal description start cmd: python dcc.py -a SkyCloudDriven.apk -o out.apk -p --filter filter.txt filter: cn/sky/app/.;. Application.mk change: APP_PLATFORM := android-19 -> APP_PLATFORM := android-21 NDK path: "E:\BaiduNetdiskDownload\Android\Ndk" dex2c path: "D:\QQ\1127367472\FileRecv\Source\dex2c" cfg: { "apktool": "tools/apktool.jar", "ndk_dir": "E:\\BaiduNetdiskDownload\\Android\\Ndk", "signature": { "keystore_path": "keystore/skyclouddriven.keystore", "alias": "skycloud", "keystore_pass": "skycloud", "store_pass": "skycloud", "v1_enabled": true, "v2_enabled": true, "v3_enabled": true } }
filter: cn/sky/app/.;.
Your filter seems invalid. check out https://github.com/codehasan/dex2c#filters for guidance on creating valid filters.
"ndk_dir": "E:\BaiduNetdiskDownload\Android\Ndk",
Kindly avoid using \ in paths and replace them with / instead. This is why I suggested referring to https://github.com/codehasan/dex2c/issues/33#issuecomment-2507617194 a few messages earlier.
filter: cn/sky/app/.;.
Your filter seems invalid. check out https://github.com/codehasan/dex2c#filters for guidance on creating valid filters.
"ndk_dir": "E:\BaiduNetdiskDownload\Android\Ndk",
Kindly avoid using
\in paths and replace them with/instead. This is why I suggested referring to #33 (comment) a few messages earlier.
Github replace "*" to none
and I replace "\" to "/" still the same result
Github replace "*" to none
makes sense, got it.
and I replace "" to "/" still the same result
Without any way to reproduce your issue, we can't help you.
SkyCloudDriven.zip this is my apk file, try obf it with Dex2c plz
SkyCloudDriven.zip this is my apk file, try obf it with Dex2c plz
Thanks for the sample, I'll get back to you in a while.
SkyCloudDriven.zip this is my apk file, try obf it with Dex2c plz
Hi, I'm able to reproduce the issue on windows, for now the solution is to either use WSL (in windows) or a Linux machine, until I (or someone else) can figure out the root cause and push a fix.
Thanks, Abhi