###winzipaes
final String path = "/data/data/package-name/databases/my.db";
final File dbFile = new File(path);
final File file = new File(backupRoot, "db.zip");
AesZipFileEncrypter ze = null;
try {
final AESEncrypter aesEncrypter = new AESEncrypterBC();
ze = new AesZipFileEncrypter(file, aesEncrypter);
ze.add(dbFile.getName(), new FileInputStream(dbFile), "password");
} catch (IOException e) {
//
} finally {
if (ze != null) {
try {
ze.close();
} catch (IOException e) {
// ignore
}
}
}
final String path = "/data/data/package-name/databases/my.db";
final File dbFile = new File(path);
final File file = new File(backupRoot, "db.zip");
AesZipFileDecrypter ze = null;
try {
ze = new AesZipFileDecrypter(file, new AESDecrypterBC());
ExtZipEntry entry = ze.getEntry(dbFile.getName());
ze.extractEntry(entry, dbFile, "password");
} catch (DataFormatException | IOException e) {
//
} finally {
if (ze != null) {
try {
ze.close();
} catch (IOException e) {
// ignore
}
}
}