Remove Zimperium and InAuth SDK
Perform the following steps to remove the legacy Zimperium inAuth SDK from your iOS and Android project:
Android
Remove obsolete binaries
- Remove the
zdetection.aarfile in the app/libs folder. - Remove the shared libraries,
libLIB-v3.8.2.so.
Update your gradle build script
Remove the link to the zdetection.aar file in the application's gradle build script.
-
Old content
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
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 ... }
Update the source code
These classes are no longer available. You can update the application source code to remove them:
GAHINAConfigGAHZMPConfig
Clean up obsolete files and folders
By removing the Zimperium & InAuth modules, the application can do a clean up of the obsolete files and folders created inside the application storage to save space.
Here is the list of files and folders that 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 and folders:
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!");
}
iOS
Remove obsolete frameworks
-
Remove the
Zdetection.frameworkfile in the Xcode project. -
Remove the value
$(SRCROOT)/../../Frameworks/ZDetectionset in the framework search path in Settings > FRAMEWORK_SEARCH_PATHS.
Remove obsolete permissions
The NSLocalNetworkUsageDescription permission can be removed from your application’s Info.plist, unless it is needed by another application component. It was previously requested from Zimperium.
Update the source code
These configuration classes are no longer available. You can update the application source code to remove them:
GAHINAConfigGAHZMPConfig
Clean up obsolete files and folders
By removing the Zimperium and InAuth modules, the application can do a clean up of the obsolete files and folders created inside the application storage, to save space.
Here is the list of obsolete files under the Documents folder that can be removed:
- ZDetection.sqlite
- ZDetection.sqlite-shm
- ZDetection.sqlite-wal
- trm.bin
- trm.dat
- trm_severity.dat
- zcore_full.zee9
- zcore_zphish.fdeep
- zcore_zphish.zee9
- zdb.bin
Here is a sample of implementation to remove those files and folders:
- (void)clearObsoletedDataFromPreviousVersion
{
NSString *documentDirectory = [[[[NSFileManager defaultManager] URLsForDirectory:NSDocumentDirectory inDomains:NSUserDomainMask] objectAtIndex:0] path];
NSArray *obsoletedFiles = [NSArray arrayWithObjects:@"ZDetection.sqlite", @"ZDetection.sqlite-shm", @"ZDetection.sqlite-wal", @"trm.bin", @"trm.dat", @"trm_severity.dat", @"zcore_full.zee9", @"zcore_zphish.fdeep", @"zcore_zphish.zee9", @"zdb.bin", nil];
for (NSString *file in obsoletedFiles) {
NSString *resource = [documentDirectory stringByAppendingPathComponent:file];
[self removeDirectoryOrFileIfExists:resource];
}
}
- (void)removeDirectoryOrFileIfExists:(NSString *)path
{
if ([[NSFileManager defaultManager] fileExistsAtPath:path]) {
[[NSFileManager defaultManager] removeItemAtPath:path error:nil];
}
}