pkumza / LibRadar

LibRadar - A detecting tool for 3rd-party libraries in Android apps.
Apache License 2.0
256 stars 51 forks source link

Is there a file name wrong in QuickStart.md ? #34

Closed daydayup1 closed 7 years ago

daydayup1 commented 7 years ago

1.I can't find APIDict.py anywhere which is written in QuickStart.md,but I find a python file which name is api_dictionary.py. And api_dictionary.py's function is extracting Apis. So I guess the name of APIDict.py may be wrong, is it? 2.Can I skip the third step which is written as follow in QuickStart.md:3. Get android.jar from Android SDK and place them into $Project_HOME$/Data/RawData, Run APIDict.py? Because there is a wrong when I run api_dictionary.py:"Maybe there is something wrong with jad status".Can I run job_dispatching.py directly? 3.I put my apk files to D:\testapk folder and ran job_dispatching.py,but I got results as follows: C:\Users\Administrator>python d:LibRadar\LibRadar\job_dispatching.py 'rm' 不是内部或外部命令,也不是可运行的程序或批处理文件。 2017-05-23 09:01:30,415: INFO Pool created 2017-05-23 09:01:30,434: INFO Waiting for all sub-processes done. 2017-05-23 09:01:30,638: INFO Process 00 is running 2017-05-23 09:01:30,677: INFO Process 01 is running 2017-05-23 09:01:30,694: INFO Process 02 is running 2017-05-23 09:01:30,730: INFO Process 03 is running 2017-05-23 09:02:00,641: INFO Process 00 returns 2017-05-23 09:02:00,648: INFO Process 04 is running 2017-05-23 09:02:00,678: INFO Process 01 returns 2017-05-23 09:02:00,686: INFO Process 05 is running 2017-05-23 09:02:00,696: INFO Process 02 returns 2017-05-23 09:02:00,701: INFO Process 06 is running 2017-05-23 09:02:00,733: INFO Process 03 returns 2017-05-23 09:02:00,736: INFO Process 07 is running 2017-05-23 09:02:30,651: INFO Process 04 returns 2017-05-23 09:02:30,688: INFO Process 05 returns 2017-05-23 09:02:30,704: INFO Process 06 returns 2017-05-23 09:02:30,740: INFO Process 07 returns 2017-05-23 09:02:30,858: CRITICAL All sub-processes done. 'eject' 不是内部或外部命令,也不是可运行的程序或批处理文件。 I trid to change ded = DexExtractorDispatcher("D:\testapk") to ded = DexExtractorDispatcher("D:\\testapk") ,but I got simmilar Info except more 'rm' 不是内部或外部命令,也不是可运行的程序或批处理文件。. Where are the analysis results put to? Thanks.

pkumza commented 7 years ago
  1. API dict and Job_dispatching is just for professional use(That means you want to extract features from large data set of APKs by yourself.) If you just want to exam several apks' libraries, just use one python script: "libradar.py"

  2. Even if you want to extract millions of apks to extract features by yourself, you can skip api_dictionary.py.

  3. My Operating System is Mac OS X. Any Unix-like OS can use LibRadar. I haven't check this tool on Windows. I guess it could works the same, until you move out "rm" & "eject" because they are instructions for Linux shell. Just remove the code line and try again.

daydayup1 commented 7 years ago

I moved out "rm" & "eject" and ran job_dispatching.py again, the results are as follows:

C:\Users\Administrator>python d:\LibRadar\LibRadar\job_dispatching.py
2017-05-23 10:01:45,394: INFO     Pool created
2017-05-23 10:01:45,403: INFO     Waiting for all sub-processes done.
2017-05-23 10:01:45,608: INFO     Process 00 is running
2017-05-23 10:01:45,627: INFO     Process 01 is running
2017-05-23 10:01:45,645: INFO     Process 02 is running
2017-05-23 10:01:45,671: INFO     Process 03 is running
2017-05-23 10:05:35,523: INFO     Process 00 returns
2017-05-23 10:05:35,707: INFO     Process 04 is running
2017-05-23 10:05:36,079: INFO     Process 03 returns
2017-05-23 10:05:36,250: INFO     Process 05 is running
2017-05-23 10:05:49,125: INFO     Process 01 returns
2017-05-23 10:05:49,341: INFO     Process 06 is running
2017-05-23 10:05:53,923: INFO     Process 02 returns
2017-05-23 10:05:54,101: INFO     Process 07 is running
2017-05-23 10:06:05,709: INFO     Process 04 returns
2017-05-23 10:06:06,252: INFO     Process 05 returns
2017-05-23 10:06:19,342: INFO     Process 06 returns
2017-05-23 10:06:24,102: INFO     Process 07 returns
2017-05-23 10:06:24,213: CRITICAL All sub-processes done.

I still don‘t know which folder the analysis results are put in.(I really want to analyse about 200 thousand apks.I tied to just use libradar.py for 100 apks,it takes about 7 seconds per apk, so it will spend too much time to analyse all apks).Thanks for your help.

pkumza commented 7 years ago

job_dispatching.py is not used for boosting libradar.py. It is used for feature training.

If you want to use libradar fastly, you can write a script to execute libradar.py on several processes.

daydayup1 commented 7 years ago

Oh,that's it.Thank you very much!

IzzySoft commented 7 years ago

until you move out "rm" & "eject" because they are instructions for Linux shell

I don't know what LibRadar used eject (which is to eject compact-disks/dvds and the like) – but instead of rm, there are the platform independent os.unlink (to remove a file) or os.rmdir / os.removedirs (to remove a directory / recursively). But I guess there's a reason you didn't use any of those, @pkumza (didn't check thoroughly; it's the loop cleaning up the smali stuff I guess).

pkumza commented 7 years ago

Eject is just a trick for notice you works have been done (It eject your cd-rom).

Use os module instead of rm is a good practice for compatibility. Yes. But I don't want to waste much time for it as just few people will use job_dispatching.py for training stage. To clear that, I'd like just rm -rf harshly.