update readme, remove old images

and properly close stream
This commit is contained in:
Helium314 2024-02-14 11:47:38 +01:00
parent daa20a1c2c
commit 161409a73e
7 changed files with 4 additions and 1 deletions

View file

@ -66,7 +66,9 @@ public final class JniUtils {
// if device is locked, this will throw an IllegalStateException
wantedChecksum = PreferenceManager.getDefaultSharedPreferences(app).getString(Settings.PREF_LIBRARY_CHECKSUM, wantedChecksum);
}
final String checksum = ChecksumCalculator.INSTANCE.checksum(new FileInputStream(userSuppliedLibrary));
final FileInputStream libStream = new FileInputStream(userSuppliedLibrary);
final String checksum = ChecksumCalculator.INSTANCE.checksum(libStream);
libStream.close();
if (TextUtils.equals(wantedChecksum, checksum)) {
// try loading the library
System.load(userSuppliedLibrary.getAbsolutePath());