0

I am working on a sort of android applications analyzer, by inspecting apps' smali code. In particular I need to know whenever an app tries to get the list of files included in a certain parent directory, so I am currently tracking the following method call (and its overloads):

File[] children = someFolder.listFiles();

What I would like to know is if there is any other method that leads to the same result that I should add to my "tracked" methods, or if the above-mentioned method is the only way to list a folder's content?

user2340612
  • 10,053
  • 4
  • 41
  • 66

1 Answers1

1

Depending on the kernel/ROM a user could run a command in the likes of ls /your/watched/path and just get the output of that command.

If the phone is rooted they most certainly can do this (usually a rooted phone will have busybox). On a non-rooted device this may or may not be possible due to file restrictions and such.

See a related answer: Any way to run shell commands on android programmatically?

Community
  • 1
  • 1
Jes
  • 2,748
  • 18
  • 22
  • On a rooted device you're basically out of luck, whatever you do the user can probably get past it. You could add some encryption to the directory, but again, if the key is on the device, someone will find it. – Jes Nov 14 '15 at 16:21
  • Well, all I want to know is if the app tries to read a folder's content, but in any case I won't prevent the app from doing it – user2340612 Nov 14 '15 at 16:33