H2SO4T / RONIN

GNU General Public License v3.0
3 stars 3 forks source link

Does not work on windows #1

Closed samadanc closed 1 year ago

samadanc commented 1 year ago

Hey guys!

I was trying to replicate your work from the paper "Assessing the Security of Inter-App Communications in Android through Reinforcement Learning".

I'm facing this error when running this on a windows laptop:

Traceback (most recent call last):
  File "C:\Users\samad\Projects\RONIN\main.py", line 47, in <module>
    lets_go()
  File "C:\Users\samad\Projects\RONIN\main.py", line 24, in lets_go
    result, package = static_analysis_manager.start_static_analysis(apk_path=os.path.abspath(app))
  File "C:\Users\samad\Projects\RONIN\static_analysis\static_analysis_manager.py", line 32, in start_static_analysis
    java_command = sh_split(f'java -jar {jar_file} {package} {apk_path} {android_jar_path}')
  File "C:\Users\samad\anaconda3\envs\ronin_env\lib\shlex.py", line 315, in split
    return list(lex)
  File "C:\Users\samad\anaconda3\envs\ronin_env\lib\shlex.py", line 300, in __next__
    token = self.get_token()
  File "C:\Users\samad\anaconda3\envs\ronin_env\lib\shlex.py", line 109, in get_token
    raw = self.read_token()
  File "C:\Users\samad\anaconda3\envs\ronin_env\lib\shlex.py", line 210, in read_token
    raise ValueError("No escaped character")
ValueError: No escaped character

I tried fixing it by putting in manual entries for the run, but I'm still facing this error running the jar file for the static analysis.

starting static analysis of: RepackagingLab\RepackagingLab.apk
Running on Windows
java -jar C:\Users\samad\Projects\RONIN\static_analysis\SootAndro-2.8.jar com.mobiseed.repackaging C:\Users\samad\Projects\RONIN\RepackagingLab\RepackagingLab.apk C:\Users\samad\AppData\Local\Android\Sdk\platforms
manual java_command split: ['java', '-jar', 'C:\\Users\\samad\\Projects\\RONIN\\static_analysis\\SootAndro-2.8.jar', 'com.mobiseed.repackaging', 'C:\\Users\\samad\\Projects\\RONIN\\RepackagingLab\\RepackagingLab.apk', 'C:\\Users\\samad\\AppData\\Local\\Android\\Sdk\\platforms']
[main] WARN soot.jimple.toolkits.callgraph.CallGraphBuilder - using incomplete callgraph containing only application classes.
No SOOT output

I'm using the RepackagingLab apk you can find here: https://seedsecuritylabs.org/Labs_16.04/Mobile/Android_Repackaging/

Let me know if the apk folder needs to have more than just the apk file and if there's any clues to why this is failing :)

Samad

H2SO4T commented 1 year ago

Dear @samadanc, I apologize for the delay and appreciate your interest in RONIN.

1) the java command manually inserted should be the following: java_command = ['java', '-jar', jar_file, package, apk_path, android_jar_path] 2) the folder can also contain a single apk 3) The line No SOOT output seems a problem related to SOOT that is unable to unpack the apk unfortunately I can not intervene on that

samadanc commented 1 year ago

Thanks! I forgot to mention it's working now - that's precisely what I used for the manual java commands.

I ran it on the Ghera dataset instead of a random apk as mentioned in the paper and it worked fine - thank you so much for replying and for all your help! 😄