magnusja / libaums

Open source library to access USB Mass Storage devices on Android without rooting your device
Apache License 2.0
1.26k stars 270 forks source link

How can I use PackageManager.getPackageArchiveInfo on USB file #322

Closed xulifan closed 2 years ago

xulifan commented 2 years ago

Problem

I am developing virus scan application. I need scan the files inside USB drive. With libaums, I can list all the files inside a USB drive. However, to parse an APK file using PackageManager.getPackageArchiveInfo, I need the full path of the file. How can I do this with libaums?

Expected behavior

Actual behavior

Stacktrace of Excpetion

(if exists)

Code where problem occurs

magnusja commented 2 years ago

Not possible as this is a user space lib. You need to parse the apk yourself or see if it offers an API which does not take file path but instead raw bytes.

magnusja commented 2 years ago

maybe the storageprovider module can help but I am unsure