src/main/java/de/blau/android/resources/KeyDatabaseHelper.java
/**
     * Read keys from assets
     * 
     * Assumes they are in a file named Files.FILE_NAME_KEYS_V2
     * 
     * @param ctx an Android Context
     */
Read keys from assets

Assumes they are in a file named Files.FILE_NAME_KEYS_V2

@param ctx an Android Context
Read keys from assets Assumes they are in a file named Files . FILE_NAME_KEYS_V2 @param ctx an Android Context
public static void readKeysFromAssets(@NonNull Context ctx) {
        AssetManager assetManager = ctx.getAssets();
        try (KeyDatabaseHelper keys = new KeyDatabaseHelper(ctx)) {
            keys.keysFromStream(assetManager.open(Files.FILE_NAME_KEYS_V2_DEFAULT));
            keys.keysFromStream(assetManager.open(Files.FILE_NAME_KEYS_V2));
        } catch (IOException e) {
            Log.e(DEBUG_TAG, "Error reading keys file " + e.getMessage());
        }
    }
public static void readKeysFromAssets ( @ NonNull Context ctx ) { AssetManager assetManager = ctx . getAssets ( ) ; try ( KeyDatabaseHelper keys = new KeyDatabaseHelper ( ctx ) ) { keys . keysFromStream ( assetManager . open ( Files . FILE_NAME_KEYS_V2_DEFAULT ) ) ; keys . keysFromStream ( assetManager . open ( Files . FILE_NAME_KEYS_V2 ) ) ; } catch ( IOException e ) { Log . e ( DEBUG_TAG , "Error reading keys file " + e . getMessage ( ) ) ; } }
Read keys from assets
Read keys from assets
// these will be overwritten if Files.FILE_NAME_KEYS_V2 exists