puddly / android-otp-extractor

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

Fix `ls /` line reader end detection #25

Closed sebastianst closed 5 years ago

sebastianst commented 5 years ago

With the old logic, it never printed the weird sentinel for me, so it just threw the ValueError instead of returning... I changed it instead to echo __end__ and detect that __end__ token. There will probably never be a file called __end__ in your phone's root directory...

puddly commented 5 years ago

I completely forgot about using echo so thanks for the fix.

What device is this on? Could you change __end__ to some other random value (like I had) so there's virtually no chance of a collision?

sebastianst commented 5 years ago

OK did it. That's on a Pixel 2, rooted stock rom.

puddly commented 5 years ago

Looks good to me, thanks.

I'd like to see why my original approach didn't work on a Pixel 2, though, so more glitches like this don't happen. What exact version of Android are you running on it?

sebastianst commented 5 years ago

Thanks for merging. It's running Android 9.