Example
- 22 Jan 2025
- 1 Minute à lire
- SombreLumière
- PDF
Example
- Mis à jour le 22 Jan 2025
- 1 Minute à lire
- SombreLumière
- PDF
The content is currently unavailable in French. You are viewing the default English version.
Résumé de l’article
Avez-vous trouvé ce résumé utile ?
Merci pour vos commentaires
Java
public class ExtendedObserverImplementation implements ExtendedObserver { public void handleCallback(CallbackData data) { switch (data.getCallbackType()) { case ROOTING: { RootingData callbackData = (RootingData) data; handleRootingCallback( callbackData.isDeviceCertainlyRooted(), callbackData.getRootingProbability()); break; } case HOOKING_FRAMEWORKS: { HookingFrameworksData callbackData = (HookingFrameworksData) data; handleHookingFrameworksCallback( callbackData.areHookingFrameworksPresent(), callbackData.getLastUsedDetectionMethodCode()); break; } ... } } ... } ... ExtendedObserver observer = new ExtendedObserverImplementation(); CallbackManager.addObserver(context, observer);
Kotlin
class ExtendedObserverImplementation : ExtendedObserver { override fun handleCallback(data: CallbackData) { when (data?.callbackType) { CallbackType.ROOTING -> { val callbackData = data as RootingData handleRootingCallback( callbackData.isDeviceCertainlyRooted, callbackData.rootingProbability ) } CallbackType.HOOKING_FRAMEWORKS -> { val callbackData = data as HookingFrameworksData handleHookingFrameworksCallback( callbackData.areHookingFrameworksPresent(), callbackData.getLastUsedDetectionMethodCode() ) } ... else -> { ... } } } ... } ... val observer: ExtendedObserver = ExtendedObserverImplementation() CallbackManager.addObserver(context, observer)
Cet article vous a-t-il été utile ?