Android
Removing obsoleted binaries
- Remove the
zdetection.aarfile in the app/libs folder. - Remove the shared libraries,
libLIB-v3.8.2.so.
Updating your gradle build script
Remove the link to the zdetection.aar file in the application's gradle build script.
* Old content
```gradle
dependencies {
implementation "com.android.support:appcompat-v7:28.0.0"
// Add Risk Management Platform java library
releaseImplementation files("libs/release/GAHRiskEngine.jar")
debugImplementation files("libs/debug/GAHRiskEngine.jar")
// Add ZDetection java library
implementation files("libs/zdetection@aar")
// other config ...
}
```
- New content
```gradle
dependencies {
implementation "com.android.support:appcompat-v7:28.0.0"
// Add Risk Management Platform java library releaseImplementation files("libs/release/GAHRiskEngine.jar") debugImplementation files("libs/debug/GAHRiskEngine.jar") // other config ...} ```
Updating the source code
These classes are no longer available, you can update the application source code to remove them:
GAHINAConfigGAHZMPConfig
Clean up obsoleted files/folders
By removing the Zimperium & InAuth modules, the application can do a clean up of the obsoleted files/folders created inside the application storage to save space.
Here is the list of files/folders can be removed * databases/zdetection.db * databases/zdetection.db-journal * shared_prefs/zcloud.xml * shared_prefs/zcore_stats.xml * shared_prefs/zdebug_log_2.xml * shared_prefs/zdetection_urls.xml * shared_prefs/ziap_features.xml * shared_prefs/ziap_version.xml * files/mob * files/.zee9 * files/.lookup * files/zdb.bin * files/zdb-blackwhitelist.bin
Here is a sample of implementation to remove those files/folder
private void cleanUpFile(Context context) {
boolean error = false;
// List of common files
List<String> FILES_TO_REMOVE_1 = Arrays.asList(
"databases/zdetection.db",
"databases/zdetection.db-journal",
"shared_prefs/zcloud.xml",
"shared_prefs/zcore_stats.xml",
"shared_prefs/zdebug_log_2.xml",
"shared_prefs/zdetection_urls.xml",
"shared_prefs/ziap_features.xml",
"shared_prefs/ziap_version.xml"
);
// Data inside "files" folder
String FILES_TO_REMOVE_2 = "mob";
List<String> FILES_TO_REMOVE_3 = Arrays.asList(
".lookup",
".zee9",
"zdb.bin",
"zdb-blackwhitelist.bin"
);
// Deleting common files
File based = context.getFilesDir().getParentFile();
for (String file : FILES_TO_REMOVE_1) {
File f = new File(based, file);
f.delete();
}
// Deleting folder inside "files"
try {
Runtime.getRuntime().exec("rm -rf " + FILES_TO_REMOVE_2,
null,
context.getFilesDir()
);
} catch (Exception ex) {
ex.printStackTrace();
Log.e(TAG, "Failed to remove data: " + FILES_TO_REMOVE_2);
error = true;
}
// Deleting files with specific name
File[] files = context.getFilesDir().listFiles((File file) -> {
boolean accepted = false;
for (String name : FILES_TO_REMOVE_3)
if (file.getName().endsWith(name)) {
accepted = true;
break;
}
return accepted;
});
if (files != null) {
for (File f : files)
f.delete();
}
if (error)
Log.e(TAG, "Failed to remove data file!");
else
Log.w(TAG, "Old data files have been removed!");
}