puddly / android-otp-extractor

Extracts OTP tokens from rooted Android devices
GNU General Public License v3.0
238 stars 22 forks source link

Pass commands to su as single arguments #3

Closed DeeUnderscore closed 6 years ago

DeeUnderscore commented 6 years ago

With my setup (Kubuntu 17.10 and Lineage 14.1), when the script calls su -c printf TEST on the device, it ends up telling su to run printf as user TEST, as opposed to telling it to run printf TEST, and passing no user argument. Same deal with the cat command invoked in adb_read_file().

This change makes it so that when su is invoked on device, the argument to -c is passed as one thing. The cat command also quotes the path to prevent problems with spaces in paths, although I don't expect those to happen often on Android.

I haven't tested this on Windows, or other *nix platforms. I assume the script works somewhere as-is, but I speculate these changes shouldn't break it.

Resolves #2

puddly commented 6 years ago

Thanks for the fix