Disable hook detection
By default, the hook detection is always enabled in the release version of OIP Risk Management SDK.
The application can disable this feature or take the necessary action by implementing the GAHErrorListener interface and send the implementation object to GAHCoreConfig, and send the GAHCoreConfig object to initialize().
Note
A runtime exception will be thrown on detection of hooking on critical methods of OIP Risk Management SDK.
class GAHHookDetectionListener implements GAHErrorListener
{
private SharedPreferences mSharedPreference;
@Override
public Object SDKAbort() {
return false;
}
}
GAHCoreConfig coreConfig = new GAHCoreConfig.Builder(getApplicationContext(), URL)
.setSDKErrorListener(new GAHHookDetectionListener())
.build();
#import <OIP Risk Management/OIP Risk Management.h>
@interface hookDetectionListener : GAHErrorListener
@end
#import "hookDetectionListener.h"
@implementation hookDetectionListener
-(BOOL)SDKAbort {
return NO;
}
@end
//add this in init, appdelegate
hookDetectionListener * _hookDetectionListener = [[hookDetectionListener alloc] init];
[reConfig setSDKErrorListener:_hookDetectionListener];
class hookDetectionListener: GAHErrorListener {
override func sdkAbort() -> Bool {
return false;
}
}
let hookDetectionListener = hookDetectionListener()
reConfig .setSDKErrorListener(hookDetectionListener)