hanada31 / Fax

Fair Android Explorer
20 stars 8 forks source link

ant build exception #4

Closed dah-fari7009 closed 1 month ago

dah-fari7009 commented 1 year ago

Hi,

When I try running the tool on an APK, after the decompilation step, there seems to be some issue with the ant build afterwards and no APK is outputted:

java.io.FileNotFoundException: Result_testGen/testcases/PlutoTV_5.21.1_apkcombo.com/generatedApp/PlutoTV_5_21_1_apkcombo_com/bin/PlutoTV_5_21_1_apkcombo_com-debug.apk (No such file or directory) at java.io.FileInputStream.open0(Native Method) at java.io.FileInputStream.open(FileInputStream.java:195) at java.io.FileInputStream.(FileInputStream.java:138) at com.google.common.io.Files$FileByteSource.openStream(Files.java:125) at com.google.common.io.Files$FileByteSource.openStream(Files.java:115) at com.google.common.io.ByteSource.copyTo(ByteSource.java:239) at com.google.common.io.Files.copy(Files.java:305) at com.google.common.io.Files.move(Files.java:490) at utils.Utils.moveFile(Utils.java:186) at generator.TestGenerator.moveGeratedAPK(TestGenerator.java:122) at generator.TestGenerator.buildProject(TestGenerator.java:785) at generator.TestGenerationofAll.analyze(TestGenerationofAll.java:110) at main.Main.analyzeSingleApk(Main.java:206) at main.Main.generateTestCase(Main.java:167) at main.Main.analyzeArgs(Main.java:118) at main.Main.main(Main.java:54) TestGeneration Finish...

I tried running the ant command directly from the terminal, I obtained this error message:

ant debug -buildfile Result_testGen/testcases/PlutoTV_5.21.1_apkcombo.com/generatedApp/PlutoTV_5_21_1_apkcombo_com/build.xml Buildfile: /data/Faridah/exploration-tools/Fax/Result_testGen/testcases/PlutoTV_5.21.1_apkcombo.com/generatedApp/PlutoTV_5_21_1_apkcombo_com/build.xml

-set-mode-check:

-set-debug-files:

-check-env: [checkenv] Android SDK Tools Revision 25.2.2 [checkenv] Installed at /data/Faridah/android

-setup: [echo] Project Name: PlutoTV_5_21_1_apkcombo_com [gettype] Project Type: Application

-set-debug-mode:

-debug-obfuscation-check:

-pre-build:

-build-setup: [getbuildtools] Using latest Build Tools: 32.0.0 [echo] Resolving Build Target for PlutoTV_5_21_1_apkcombo_com... [gettarget] Project Target: Android 7.1.1 [gettarget] API level: 25 [gettarget] WARNING: No minSdkVersion value set. Application will install on all Android versions. [echo] ---------- [echo] Creating output directories if needed... [mkdir] Created dir: /data/Faridah/exploration-tools/Fax/Result_testGen/testcases/PlutoTV_5.21.1_apkcombo.com/generatedApp/PlutoTV_5_21_1_apkcombo_com/bin/rsObj [mkdir] Created dir: /data/Faridah/exploration-tools/Fax/Result_testGen/testcases/PlutoTV_5.21.1_apkcombo.com/generatedApp/PlutoTV_5_21_1_apkcombo_com/bin/rsLibs [echo] ---------- [echo] Resolving Dependencies for PlutoTV_5_21_1_apkcombo_com... [dependency] Library dependencies: [dependency] No Libraries [dependency] [dependency] ------------------ [echo] ---------- [echo] Building Libraries with 'debug'... [subant] No sub-builds to iterate on

-code-gen: [mergemanifest] No changes in the AndroidManifest files. [echo] Handling aidl files... [aidl] No AIDL files to compile. [echo] ---------- [echo] Handling RenderScript files... [echo] ---------- [echo] Handling Resources... [aapt] No changed resources. R.java and Manifest.java untouched. [echo] ---------- [echo] Handling BuildConfig class... [buildconfig] Generating BuildConfig class.

-pre-compile:

-compile: [javac] Compiling 21 source files to /data/Faridah/exploration-tools/Fax/Result_testGen/testcases/PlutoTV_5.21.1_apkcombo.com/generatedApp/PlutoTV_5_21_1_apkcombo_com/bin/classes [javac] warning: [options] source value 1.5 is obsolete and will be removed in a future release [javac] warning: [options] target value 1.5 is obsolete and will be removed in a future release [javac] warning: [options] To suppress warnings about obsolete options, use -Xlint:-options. [javac] /data/Faridah/exploration-tools/Fax/Result_testGen/testcases/PlutoTV_5.21.1_apkcombo.com/generatedApp/PlutoTV_5_21_1_apkcombo_com/src/fax/tv/pluto/android/Activity_1.java:45: error: cannot find symbol [javac] Button button1=(Button)findViewById(R.id.button1); [javac] ^ [javac] symbol: variable id [javac] location: class R [javac] /data/Faridah/exploration-tools/Fax/Result_testGen/testcases/PlutoTV_5.21.1_apkcombo.com/generatedApp/PlutoTV_5_21_1_apkcombo_com/src/fax/tv/pluto/android/Activity_10.java:43: error: cannot find symbol [javac] Button button1=(Button)findViewById(R.id.button1); [javac] ^ [javac] symbol: variable id [javac] location: class R [javac] /data/Faridah/exploration-tools/Fax/Result_testGen/testcases/PlutoTV_5.21.1_apkcombo.com/generatedApp/PlutoTV_5_21_1_apkcombo_com/src/fax/tv/pluto/android/Activity_11.java:42: error: cannot find symbol [javac] Button button1=(Button)findViewById(R.id.button1); [javac] ^ [javac] symbol: variable id [javac] location: class R

... [javac] 17 errors [javac] 3 warnings

BUILD FAILED /data/Faridah/android/tools/ant/build.xml:716: The following error occurred while executing this line: /data/Faridah/android/tools/ant/build.xml:730: Compile failed; see the compiler error output for details.

hanada31 commented 1 year ago

Does this problem also happen with apk files under folder apk/ or only with PlutoTV_5_21_1_apkcombo_com-debug.apk?

hanada31 commented 1 year ago

Hi, @dah-fari7009

The ant failure may be caused by bugs in generating java files, which aim to send ICC messages to AUT. Sorry that I do not have time to look deeper into it recently. To facilitate your debugging, the code of Fax.jar is uploaded now.

Maybe you can see how the compile bug happens and fix the code in the file TestGenerator.java. And it will be great to creat and submit a PR if possible.

dah-fari7009 commented 1 year ago

Thank you for the pointers and for uploading the code! I'll look into it