s3eResult AdmobAdsInit_platform() { //Get the environment from the pointer JNIEnv* env = s3eEdkJNIGetEnv(); jobject obj = NULL; jmethodID cons = NULL; //Get the extension class jclass cls = s3eEdkAndroidFindClass("AdmobAds"); if (!cls) goto fail; //Get its constructor cons = env->GetMethodID(cls, "<init>", "()V"); if (!cons) goto fail; //Construct the java class obj = env->NewObject(cls, cons); if (!obj) goto fail; //Get all the extension methods g_InitAds = env->GetMethodID(cls, "InitAds", "(Ljava/lang/String;)I"); if (!g_InitAds) goto fail; g_ShowAds = env->GetMethodID(cls, "ShowAds", "()I"); if (!g_ShowAds) goto fail; g_HideAds = env->GetMethodID(cls, "HideAds", "()I"); if (!g_HideAds) goto fail; IwTrace(ADMOBADS, ("ADMOBADS init success")); g_Obj = env->NewGlobalRef(obj); env->DeleteLocalRef(obj); env->DeleteLocalRef(cls); // Add any platform-specific initialisation code here return S3E_RESULT_SUCCESS; fail: jthrowable exc = env->ExceptionOccurred(); if (exc) { env->ExceptionDescribe(); env->ExceptionClear(); IwTrace(AdmobAds, ("One or more java methods could not be found")); } return S3E_RESULT_ERROR; }
s3eResult s3eAudioFocusInit_platform() { // Get the environment from the pointer JNIEnv* env = s3eEdkJNIGetEnv(); jobject obj = NULL; jmethodID cons = NULL; // Get the extension class jclass cls = s3eEdkAndroidFindClass("s3eAudioFocus"); if (!cls) goto fail; // Get its constructor cons = env->GetMethodID(cls, "<init>", "()V"); if (!cons) goto fail; // Construct the java class obj = env->NewObject(cls, cons); if (!obj) goto fail; // Get all the extension methods g_s3eAudioFocusRequestFocuse = env->GetMethodID(cls, "s3eAudioFocusRequestFocuse", "()V"); if (!g_s3eAudioFocusRequestFocuse) goto fail; IwTrace(AUDIOFOCUS, ("AUDIOFOCUS init success")); g_Obj = env->NewGlobalRef(obj); env->DeleteLocalRef(obj); env->DeleteGlobalRef(cls); // Add any platform-specific initialisation code here return S3E_RESULT_SUCCESS; fail: jthrowable exc = env->ExceptionOccurred(); if (exc) { env->ExceptionDescribe(); env->ExceptionClear(); IwTrace(s3eAudioFocus, ("One or more java methods could not be found")); } env->DeleteLocalRef(obj); env->DeleteGlobalRef(cls); return S3E_RESULT_ERROR; }
s3eResult UserAgentInit_platform() { //Alloc buffer for returning strings g_RetStr = (char*)s3eEdkMallocOS(g_RetStrLen); // Get the environment from the pointer JNIEnv* env = s3eEdkJNIGetEnv(); jobject obj = NULL; jmethodID cons = NULL; // Get the extension class jclass cls = s3eEdkAndroidFindClass("UserAgent"); if (!cls) goto fail; // Get its constructor cons = env->GetMethodID(cls, "<init>", "()V"); if (!cons) goto fail; // Construct the java class obj = env->NewObject(cls, cons); if (!obj) goto fail; // Get all the extension methods g_getUserAgent = env->GetMethodID(cls, "getUserAgent", "()Ljava/lang/String;"); if (!g_getUserAgent) goto fail; IwTrace(USERAGENT, ("USERAGENT init success")); g_Obj = env->NewGlobalRef(obj); env->DeleteLocalRef(obj); env->DeleteGlobalRef(cls); // Add any platform-specific initialisation code here return S3E_RESULT_SUCCESS; fail: jthrowable exc = env->ExceptionOccurred(); if (exc) { env->ExceptionDescribe(); env->ExceptionClear(); IwTrace(UserAgent, ("One or more java methods could not be found")); } return S3E_RESULT_ERROR; }
s3eResult s3eKiipInit_platform() { // Get the environment from the pointer JNIEnv* env = s3eEdkJNIGetEnv(); jobject obj = NULL; jmethodID cons = NULL; // Get the extension class jclass cls = s3eEdkAndroidFindClass("s3eKiip"); if (!cls) goto fail; // Get its constructor cons = env->GetMethodID(cls, "<init>", "()V"); if (!cons) goto fail; // Construct the java class obj = env->NewObject(cls, cons); if (!obj) goto fail; // Get all the extension methods g_s3eKiipInitWithKeys = env->GetMethodID(cls, "s3eKiipInitWithKeys", "(Ljava/lang/String;Ljava/lang/String;)I"); if (!g_s3eKiipInitWithKeys) goto fail; g_s3eKiipRegisterCallback = env->GetMethodID(cls, "s3eKiipRegisterCallback", "()V"); if (!g_s3eKiipRegisterCallback) goto fail; g_s3eKiipSaveMoment = env->GetMethodID(cls, "s3eKiipSaveMoment", "(Ljava/lang/String;)I"); if (!g_s3eKiipSaveMoment) goto fail; g_s3eKiipSaveMomentWithValue = env->GetMethodID(cls, "s3eKiipSaveMomentWithValue", "(Ljava/lang/String;D)I"); if (!g_s3eKiipSaveMomentWithValue) goto fail; g_s3eKiipSetAutorotate = env->GetMethodID(cls, "s3eKiipSetAutorotate", "(Z)V"); if (!g_s3eKiipSetAutorotate) goto fail; g_s3eKiipGetAutorotate = env->GetMethodID(cls, "s3eKiipGetAutorotate", "()Z"); if (!g_s3eKiipGetAutorotate) goto fail; g_s3eKiipSetInterfaceOrientation = env->GetMethodID(cls, "s3eKiipSetInterfaceOrientation", "(I)V"); if (!g_s3eKiipSetInterfaceOrientation) goto fail; g_s3eKiipGetInterfaceOrientation = env->GetMethodID(cls, "s3eKiipGetInterfaceOrientation", "()I"); if (!g_s3eKiipGetInterfaceOrientation) goto fail; g_s3eKiipSetEmailAddress = env->GetMethodID(cls, "s3eKiipSetEmailAddress", "(Ljava/lang/String;)V"); if (!g_s3eKiipSetEmailAddress) goto fail; g_s3eKiipSetAlias = env->GetMethodID(cls, "s3eKiipSetAlias", "(Ljava/lang/String;)V"); if (!g_s3eKiipSetAlias) goto fail; g_s3eKiipSetGender = env->GetMethodID(cls, "s3eKiipSetGender", "(Ljava/lang/String;)V"); if (!g_s3eKiipSetGender) goto fail; g_s3eKiipSetBirthday = env->GetMethodID(cls, "s3eKiipSetBirthday", "(Ljava/lang/String;)V"); if (!g_s3eKiipSetBirthday) goto fail; { jclass receiver=s3eEdkAndroidFindClass( "com/s3eKiipExt/MainActivity" ); static const JNINativeMethod methods[]= { { "native_sessionStart", "(Ljava/lang/String;)V", (void*)&s3eKiip_sessionStartCallback }, { "native_sessionEnd", "(Ljava/lang/String;)V", (void*)&s3eKiip_sessionEndCallback }, { "native_swarmStart", "(Ljava/lang/String;)V", (void*)&s3eKiip_swarmStartCallback }, { "native_contentReceived", "(Lcom/s3eKiipExt/MainActivity$ReceivedContent;)V", (void*)&s3eKiip_contentReceivedCallback }, { "native_saveMomentCompletion", "(Ljava/lang/String;)V", (void*)&s3eKiip_saveMomentCompletionCallback } }; IwTrace(KIIP, ("KIIP registering native callbacks")); // Register the native hooks if(env->RegisterNatives( receiver, methods, sizeof(methods)/sizeof(methods[0])) ) goto fail; // Clean up env->DeleteGlobalRef(receiver); } IwTrace(KIIP, ("KIIP init success")); g_Obj = env->NewGlobalRef(obj); env->DeleteLocalRef(obj); env->DeleteGlobalRef(cls); // Add any platform-specific initialisation code here return S3E_RESULT_SUCCESS; fail: jthrowable exc = env->ExceptionOccurred(); if (exc) { env->ExceptionDescribe(); env->ExceptionClear(); IwTrace(s3eKiip, ("One or more java methods could not be found")); } return S3E_RESULT_ERROR; }
s3eResult s3eGameThriveInit_platform() { // Get the environment from the pointer JNIEnv* env = s3eEdkJNIGetEnv(); jobject obj = NULL; jmethodID cons = NULL; const JNINativeMethod nativeMethodDefs[] = { {"NotificationReceivedCallback", "(Ljava/lang/String;Ljava/lang/String;Z)V", (void *)&NotificationReceivedCallback}, {"TagsReceivedCallback", "(Ljava/lang/String;)V", (void *)&TagsReceivedCallback}, {"IdsAvailableCallback", "(Ljava/lang/String;Ljava/lang/String;)V", (void *)&IdsAvailableCallback}, }; // Get the extension class jclass cls = s3eEdkAndroidFindClass("s3eGameThrive"); if (!cls) goto fail; env->RegisterNatives(cls, nativeMethodDefs, sizeof(nativeMethodDefs)/sizeof(nativeMethodDefs[0])); // Get its constructor cons = env->GetMethodID(cls, "<init>", "()V"); if (!cons) goto fail; // Construct the java class obj = env->NewObject(cls, cons); if (!obj) goto fail; // Get all the extension methods g_GameThriveInitialize = env->GetMethodID(cls, "GameThriveInitialize", "(Ljava/lang/String;Ljava/lang/String;Z)V"); if (!g_GameThriveInitialize) goto fail; g_GameThriveSendTag = env->GetMethodID(cls, "GameThriveSendTag", "(Ljava/lang/String;Ljava/lang/String;)V"); if (!g_GameThriveSendTag) goto fail; g_GameThriveGetTags = env->GetMethodID(cls, "GameThriveGetTags", "()V"); if (!g_GameThriveGetTags) goto fail; g_GameThriveDeleteTag = env->GetMethodID(cls, "GameThriveDeleteTag", "(Ljava/lang/String;Ljava/lang/String;)V"); if (!g_GameThriveDeleteTag) goto fail; g_GameThriveSendPurchase = env->GetMethodID(cls, "GameThriveSendPurchase", "(D)V"); if (!g_GameThriveSendPurchase) goto fail; g_GameThriveGetIdsAvailable = env->GetMethodID(cls, "GameThriveGetIdsAvailable", "()V"); if (!g_GameThriveGetIdsAvailable) goto fail; g_GameThriveOnPause = env->GetMethodID(cls, "GameThriveOnPause", "()V"); if (!g_GameThriveOnPause) goto fail; g_GameThriveOnResume = env->GetMethodID(cls, "GameThriveOnResume", "()V"); if (!g_GameThriveOnResume) goto fail; g_GameThriveEnableVibrate = env->GetMethodID(cls, "GameThriveEnableVibrate", "(Z)V"); if (!g_GameThriveEnableVibrate) goto fail; g_GameThriveEnableSound = env->GetMethodID(cls, "GameThriveEnableSound", "(Z)V"); if (!g_GameThriveEnableSound) goto fail; IwTrace(GAMETHRIVE, ("GAMETHRIVE init success")); g_Obj = env->NewGlobalRef(obj); env->DeleteLocalRef(obj); env->DeleteGlobalRef(cls); // Add any platform-specific initialisation code here return S3E_RESULT_SUCCESS; fail: jthrowable exc = env->ExceptionOccurred(); if (exc) { env->ExceptionDescribe(); env->ExceptionClear(); IwTrace(s3eGameThrive, ("One or more java methods could not be found")); } return S3E_RESULT_ERROR; }
s3eResult ODKInit_platform() { // Get the environment from the pointer JNIEnv* env = s3eEdkJNIGetEnv(); jobject obj = NULL; jfieldID field = NULL; // Get the extension class jclass cls = s3eEdkAndroidFindClass("com/ODK/ODK"); if (!cls) goto fail; IwTrace(ODK, ("ODK init Found: com/ODK/ODK")); field = env->GetStaticFieldID(cls, "m_Activity", "Lcom/ODK/ODK;"); if (!field) goto fail; IwTrace(ODK, ("ODK init Found: GetStaticFieldID")); obj = env->GetStaticObjectField(cls,field); if (!obj) goto fail; IwTrace(ODK, ("ODK init Found: GetStaticObjectField ")); /* // Get its constructor cons = env->GetMethodID(cls, "<init>", "()V"); if (!cons) goto fail; // Construct the java class obj = env->NewObject(cls, cons); if (!obj) goto fail; */ // Get all the extension methods g_OuyaController_startOfFrame = env->GetMethodID(cls, "OuyaController_startOfFrame", "()V"); if (!g_OuyaController_startOfFrame) goto fail; g_OuyaController_selectControllerByPlayer = env->GetMethodID(cls, "OuyaController_selectControllerByPlayer", "(I)Z"); if (!g_OuyaController_selectControllerByPlayer) goto fail; g_OuyaController_selectControllerByDeviceID = env->GetMethodID(cls, "OuyaController_selectControllerByDeviceID", "(I)Z"); if (!g_OuyaController_selectControllerByDeviceID) goto fail; g_OuyaController_getAxisValue = env->GetMethodID(cls, "OuyaController_getAxisValue", "(I)I"); if (!g_OuyaController_getAxisValue) goto fail; g_OuyaController_getButton = env->GetMethodID(cls, "OuyaController_getButton", "(I)Z"); if (!g_OuyaController_getButton) goto fail; g_OuyaController_buttonPressedThisFrame = env->GetMethodID(cls, "OuyaController_buttonPressedThisFrame", "(I)Z"); if (!g_OuyaController_buttonPressedThisFrame) goto fail; g_OuyaController_buttonReleasedThisFrame = env->GetMethodID(cls, "OuyaController_buttonReleasedThisFrame", "(I)Z"); if (!g_OuyaController_buttonReleasedThisFrame) goto fail; g_OuyaController_buttonChangedThisFrame = env->GetMethodID(cls, "OuyaController_buttonChangedThisFrame", "(I)Z"); if (!g_OuyaController_buttonChangedThisFrame) goto fail; g_OuyaController_getPlayerNum = env->GetMethodID(cls, "OuyaController_getPlayerNum", "()I"); if (!g_OuyaController_getPlayerNum) goto fail; IwTrace(ODK, ("ODK init success")); g_Obj = env->NewGlobalRef(obj); env->DeleteLocalRef(obj); env->DeleteGlobalRef(cls); // cache class references g_pluginOuya.CacheClasses(env); // Add any platform-specific initialisation code here return S3E_RESULT_SUCCESS; fail: jthrowable exc = env->ExceptionOccurred(); if (exc) { env->ExceptionDescribe(); env->ExceptionClear(); IwTrace(ODK, ("One or more java methods could not be found")); } return S3E_RESULT_ERROR; }
s3eResult MATSDKInit_platform() { // Get the environment from the pointer JNIEnv* env = s3eEdkJNIGetEnv(); jobject obj = NULL; jmethodID cons = NULL; // Get the extension class jclass cls = s3eEdkAndroidFindClass("s3eMATSDK"); if (!cls) goto fail; // Get its constructor cons = env->GetMethodID(cls, "<init>", "()V"); if (!cons) goto fail; // Construct the java class obj = env->NewObject(cls, cons); if (!obj) goto fail; // Get all the extension methods g_MATStartMobileAppTracker = env->GetMethodID(cls, "MATStartMobileAppTracker", "(Ljava/lang/String;Ljava/lang/String;)V"); if (!g_MATStartMobileAppTracker) goto fail; g_MATSDKParameters = env->GetMethodID(cls, "MATSDKParameters", "()V"); if (!g_MATSDKParameters) goto fail; g_MATTrackInstall = env->GetMethodID(cls, "MATTrackInstall", "()V"); if (!g_MATTrackInstall) goto fail; g_MATTrackUpdate = env->GetMethodID(cls, "MATTrackUpdate", "()V"); if (!g_MATTrackUpdate) goto fail; g_MATTrackInstallWithReferenceId = env->GetMethodID(cls, "MATTrackInstallWithReferenceId", "(Ljava/lang/String;)V"); if (!g_MATTrackInstallWithReferenceId) goto fail; g_MATTrackActionForEventIdOrName = env->GetMethodID(cls, "MATTrackActionForEventIdOrName", "(Ljava/lang/String;ZLjava/lang/String;)V"); if (!g_MATTrackActionForEventIdOrName) goto fail; g_MATTrackActionForEventIdOrNameItems = env->GetMethodID(cls, "MATTrackActionForEventIdOrNameItems", "(Ljava/lang/String;ZLjava/util/List;Ljava/lang/String;DLjava/lang/String;ILjava/lang/String;)V"); if (!g_MATTrackActionForEventIdOrNameItems) goto fail; g_MATTrackAction = env->GetMethodID(cls, "MATTrackAction", "(Ljava/lang/String;ZDLjava/lang/String;)V"); if (!g_MATTrackAction) goto fail; g_MATSetPackageName = env->GetMethodID(cls, "MATSetPackageName", "(Ljava/lang/String;)V"); if (!g_MATSetPackageName) goto fail; g_MATStartAppToAppTracking = env->GetMethodID(cls, "MATStartAppToAppTracking", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Z)V"); if (!g_MATStartAppToAppTracking) goto fail; /////// g_MATSetCurrencyCode = env->GetMethodID(cls, "MATSetCurrencyCode", "(Ljava/lang/String;)V"); if (!g_MATSetCurrencyCode) goto fail; g_MATSetUserId = env->GetMethodID(cls, "MATSetUserId", "(Ljava/lang/String;)V"); if (!g_MATSetUserId) goto fail; g_MATSetRevenue = env->GetMethodID(cls, "MATSetRevenue", "(D)V"); if (!g_MATSetRevenue) goto fail; g_MATSetSiteId = env->GetMethodID(cls, "MATSetSiteId", "(Ljava/lang/String;)V"); if (!g_MATSetSiteId) goto fail; g_MATSetTRUSTeId = env->GetMethodID(cls, "MATSetTRUSTeId", "(Ljava/lang/String;)V"); if (!g_MATSetTRUSTeId) goto fail; g_MATSetDebugMode = env->GetMethodID(cls, "MATSetDebugMode", "(Z)V"); if (!g_MATSetDebugMode) goto fail; g_MATSetAllowDuplicates = env->GetMethodID(cls, "MATSetAllowDuplicates", "(Z)V"); if (!g_MATSetAllowDuplicates) goto fail; g_MATSetAge = env->GetMethodID(cls, "MATSetAge", "(I)V"); if (!g_MATSetAge) goto fail; g_MATSetGender = env->GetMethodID(cls, "MATSetGender", "(I)V"); if (!g_MATSetGender) goto fail; g_MATSetLocation = env->GetMethodID(cls, "MATSetLocation", "(DDD)V"); if (!g_MATSetLocation) goto fail; ////// IwTrace(MATSDK, ("MATSDK init success")); g_Obj = env->NewGlobalRef(obj); env->DeleteLocalRef(obj); env->DeleteGlobalRef(cls); // Add any platform-specific initialisation code here return S3E_RESULT_SUCCESS; fail: jthrowable exc = env->ExceptionOccurred(); if (exc) { env->ExceptionDescribe(); env->ExceptionClear(); IwTrace(s3eMATSDK, ("One or more java methods could not be found")); } return S3E_RESULT_ERROR; }
s3eResult CGPollfishInit_platform() { // Get the environment from the pointer JNIEnv* env = s3eEdkJNIGetEnv(); jobject obj = NULL; jmethodID cons = NULL; const JNINativeMethod nativeMethodDefs[] = { { "native_notifyReceived", "()V", (void *)&native_notifyReceived }, { "native_notifyNotAvailable", "()V", (void *)&native_notifyNotAvailable }, { "native_notifyCompleted", "()V", (void *)&native_notifyCompleted }, { "native_notifyOpened", "()V", (void *)&native_notifyOpened }, { "native_notifyClosed", "()V", (void *)&native_notifyClosed }, { "native_notifyNotEligible", "()V", (void *)&native_notifyNotEligible }, }; // Get the extension class jclass cls = s3eEdkAndroidFindClass("CGPollfish"); if (!cls) goto fail; // Get its constructor cons = env->GetMethodID(cls, "<init>", "()V"); if (!cons) goto fail; // Construct the java class obj = env->NewObject(cls, cons); if (!obj) goto fail; // Get all the extension methods g_PollFishInit = env->GetMethodID(cls, "PollFishInit", "(Ljava/lang/String;IILjava/lang/String;)V"); if (!g_PollFishInit) goto fail; g_PollFishHide = env->GetMethodID(cls, "PollFishHide", "()V"); if (!g_PollFishHide) goto fail; g_PollFishShow = env->GetMethodID(cls, "PollFishShow", "()V"); if (!g_PollFishShow) goto fail; if(env->RegisterNatives(cls, nativeMethodDefs, sizeof(nativeMethodDefs)/sizeof(nativeMethodDefs[0]))) goto fail; IwTrace(CGPOLLFISH, ("CGPOLLFISH init success")); g_Obj = env->NewGlobalRef(obj); env->DeleteLocalRef(obj); env->DeleteGlobalRef(cls); // Add any platform-specific initialisation code here return S3E_RESULT_SUCCESS; fail: jthrowable exc = env->ExceptionOccurred(); if (exc) { env->ExceptionDescribe(); env->ExceptionClear(); IwTrace(CGPollfish, ("One or more java methods could not be found")); } env->DeleteLocalRef(obj); env->DeleteGlobalRef(cls); return S3E_RESULT_ERROR; }
s3eResult bluetoothInit_platform() { // Get the environment from the pointer JNIEnv* env = s3eEdkJNIGetEnv(); jobject obj = NULL; jmethodID cons = NULL; // Get the extension class jclass cls = s3eEdkAndroidFindClass("bluetooth"); if (!cls) goto fail; // Get its constructor cons = env->GetMethodID(cls, "<init>", "()V"); if (!cons) goto fail; // Construct the java class obj = env->NewObject(cls, cons); if (!obj) goto fail; // Get all the extension methods g_init_bluetooth = env->GetMethodID(cls, "init_bluetooth", "()Z"); if (!g_init_bluetooth) goto fail; g_enable_bluetooth = env->GetMethodID(cls, "enable_bluetooth", "()V"); if (!g_enable_bluetooth) goto fail; g_disable_bluetooth = env->GetMethodID(cls, "disable_bluetooth", "()V"); if (!g_disable_bluetooth) goto fail; g_is_bluetooth_enabled = env->GetMethodID(cls, "is_bluetooth_enabled", "()Z"); if (!g_is_bluetooth_enabled) goto fail; g_bluetooth_close = env->GetMethodID(cls, "bluetooth_close", "()V"); if (!g_bluetooth_close) goto fail; g_bluetooth_enable_discoverability = env->GetMethodID(cls, "bluetooth_enable_discoverability", "()V"); if (!g_bluetooth_enable_discoverability) goto fail; g_bluetooth_is_discovering = env->GetMethodID(cls, "bluetooth_is_discovering", "()Z"); if (!g_bluetooth_is_discovering) goto fail; g_bluetooth_setup_client = env->GetMethodID(cls, "bluetooth_setup_client", "()V"); if (!g_bluetooth_setup_client) goto fail; g_is_bluetooth_connected = env->GetMethodID(cls, "is_bluetooth_connected", "()Z"); if (!g_is_bluetooth_connected) goto fail; g_bluetooth_message_start = env->GetMethodID(cls, "bluetooth_message_start", "()V"); if (!g_bluetooth_message_start) goto fail; g_bluetooth_message_write_float = env->GetMethodID(cls, "bluetooth_message_write_float", "(Ljava/lang/String;)V"); if (!g_bluetooth_message_write_float) goto fail; g_bluetooth_message_write_int = env->GetMethodID(cls, "bluetooth_message_write_int", "(I)V"); if (!g_bluetooth_message_write_int) goto fail; g_bluetooth_message_send_current = env->GetMethodID(cls, "bluetooth_message_send_current", "()V"); if (!g_bluetooth_message_send_current) goto fail; g_is_bluetooth_message = env->GetMethodID(cls, "is_bluetooth_message", "()Z"); if (!g_is_bluetooth_message) goto fail; g_bluetooth_message_read_int = env->GetMethodID(cls, "bluetooth_message_read_int", "()I"); if (!g_bluetooth_message_read_int) goto fail; g_bluetooth_message_read_float = env->GetMethodID(cls, "bluetooth_message_read_float", "()F"); if (!g_bluetooth_message_read_float) goto fail; g_bluetooth_message_discard_current = env->GetMethodID(cls, "bluetooth_message_discard_current", "()V"); if (!g_bluetooth_message_discard_current) goto fail; g_bluetooth_show_wrong_version_dialog = env->GetMethodID(cls, "bluetooth_show_wrong_version_dialog", "()V"); if (!g_bluetooth_show_wrong_version_dialog) goto fail; IwTrace(BLUETOOTH, ("BLUETOOTH init success")); g_Obj = env->NewGlobalRef(obj); env->DeleteLocalRef(obj); env->DeleteGlobalRef(cls); // Add any platform-specific initialisation code here return S3E_RESULT_SUCCESS; fail: jthrowable exc = env->ExceptionOccurred(); if (exc) { env->ExceptionDescribe(); env->ExceptionClear(); IwTrace(bluetooth, ("One or more java methods could not be found")); } return S3E_RESULT_ERROR; }
s3eResult s3eNOpenFeintInit_platform() { //Alloc buffer for returning strings g_RetStr = (char*)s3eEdkMallocOS(g_RetStrLen); // Get the environment from the pointer JNIEnv* env = s3eEdkJNIGetEnv(); jobject obj = NULL; jmethodID cons = NULL; const JNINativeMethod nativeMethodDefs[] = { {"NOFLoginCallback", "(Ljava/lang/String;Z)V", (void *)&s3eNOpenFeint_NOFLoginCallback}, // {"DialogCallback", "(Ljava/lang/Object;Z)V", (void *)&s3eFacebook_DialogCallback}, // {"RequestCallback", "(Ljava/lang/Object;Z)V", (void *)&s3eFacebook_RequestCallback}, }; // Get the extension class jclass cls = s3eEdkAndroidFindClass("s3eNOpenFeint"); if (!cls) goto fail; // Get its constructor cons = env->GetMethodID(cls, "<init>", "()V"); if (!cons) goto fail; // Construct the java class obj = env->NewObject(cls, cons); if (!obj) goto fail; // Get all the extension methods g_s3eNewMessageBox = env->GetMethodID(cls, "s3eNewMessageBox", "(Ljava/lang/String;Ljava/lang/String;)I"); if (!g_s3eNewMessageBox) goto fail; g_s3eNOFinitializeWithProductKey = env->GetMethodID(cls, "s3eNOFinitializeWithProductKey", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)I"); if (!g_s3eNOFinitializeWithProductKey) goto fail; g_s3eNOFlaunchDashboardWithHighscorePage = env->GetMethodID(cls, "s3eNOFlaunchDashboardWithHighscorePage", "(Ljava/lang/String;)I"); if (!g_s3eNOFlaunchDashboardWithHighscorePage) goto fail; g_s3eNOFlaunchDashboardWithAchievementsPage = env->GetMethodID(cls, "s3eNOFlaunchDashboardWithAchievementsPage", "()I"); if (!g_s3eNOFlaunchDashboardWithAchievementsPage) goto fail; g_s3eNOFlaunchDashboardWithChallengesPage = env->GetMethodID(cls, "s3eNOFlaunchDashboardWithChallengesPage", "()I"); if (!g_s3eNOFlaunchDashboardWithChallengesPage) goto fail; g_s3eNOFlaunchDashboardWithFindFriendsPage = env->GetMethodID(cls, "s3eNOFlaunchDashboardWithFindFriendsPage", "()I"); if (!g_s3eNOFlaunchDashboardWithFindFriendsPage) goto fail; g_s3eNOFlaunchDashboardWithWhosPlayingPage = env->GetMethodID(cls, "s3eNOFlaunchDashboardWithWhosPlayingPage", "()I"); if (!g_s3eNOFlaunchDashboardWithWhosPlayingPage) goto fail; g_s3eNOFlaunchDashboardWithListGlobalChatRoomsPage = env->GetMethodID(cls, "s3eNOFlaunchDashboardWithListGlobalChatRoomsPage", "()I"); if (!g_s3eNOFlaunchDashboardWithListGlobalChatRoomsPage) goto fail; g_s3eNOFlaunchDashboardWithiPurchasePage = env->GetMethodID(cls, "s3eNOFlaunchDashboardWithiPurchasePage", "(Ljava/lang/String;)I"); if (!g_s3eNOFlaunchDashboardWithiPurchasePage) goto fail; g_s3eNOFlaunchDashboardWithSwitchUserPage = env->GetMethodID(cls, "s3eNOFlaunchDashboardWithSwitchUserPage", "()I"); if (!g_s3eNOFlaunchDashboardWithSwitchUserPage) goto fail; g_s3eNOFlaunchDashboardWithForumsPage = env->GetMethodID(cls, "s3eNOFlaunchDashboardWithForumsPage", "()I"); if (!g_s3eNOFlaunchDashboardWithForumsPage) goto fail; g_s3eNOFlaunchDashboardWithInvitePage = env->GetMethodID(cls, "s3eNOFlaunchDashboardWithInvitePage", "()I"); if (!g_s3eNOFlaunchDashboardWithInvitePage) goto fail; g_s3eNOFlaunchDashboardWithSpecificInvite = env->GetMethodID(cls, "s3eNOFlaunchDashboardWithSpecificInvite", "(Ljava/lang/String;)I"); if (!g_s3eNOFlaunchDashboardWithSpecificInvite) goto fail; g_s3eNOFlaunchDashboardWithSocialNotificationWithPrepopulatedText = env->GetMethodID(cls, "s3eNOFlaunchDashboardWithSocialNotificationWithPrepopulatedText", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)I"); if (!g_s3eNOFlaunchDashboardWithSocialNotificationWithPrepopulatedText) goto fail; g_s3eNOFshutdown = env->GetMethodID(cls, "s3eNOFshutdown", "()I"); if (!g_s3eNOFshutdown) goto fail; g_s3eNOFlaunchDashboard = env->GetMethodID(cls, "s3eNOFlaunchDashboard", "()I"); if (!g_s3eNOFlaunchDashboard) goto fail; g_s3eNOFdismissDashboard = env->GetMethodID(cls, "s3eNOFdismissDashboard", "()I"); if (!g_s3eNOFdismissDashboard) goto fail; g_s3eNOFsetDashboardOrientation = env->GetMethodID(cls, "s3eNOFsetDashboardOrientation", "()I"); if (!g_s3eNOFsetDashboardOrientation) goto fail; g_s3eNOFhasUserApprovedFeint = env->GetMethodID(cls, "s3eNOFhasUserApprovedFeint", "()Z"); if (!g_s3eNOFhasUserApprovedFeint) goto fail; g_s3eNOFisOnline = env->GetMethodID(cls, "s3eNOFisOnline", "()Z"); if (!g_s3eNOFisOnline) goto fail; g_s3eNOFdisplayAndSendChallenge = env->GetMethodID(cls, "s3eNOFdisplayAndSendChallenge", "(Ljava/lang/String;)I"); if (!g_s3eNOFdisplayAndSendChallenge) goto fail; g_s3eNOFdownloadAllChallengeDefinitions = env->GetMethodID(cls, "s3eNOFdownloadAllChallengeDefinitions", "()I"); if (!g_s3eNOFdownloadAllChallengeDefinitions) goto fail; g_s3eNOFdownloadChallengeDefinitionWithId = env->GetMethodID(cls, "s3eNOFdownloadChallengeDefinitionWithId", "(Ljava/lang/String;)I"); if (!g_s3eNOFdownloadChallengeDefinitionWithId) goto fail; g_s3eNOFchallengeCompleteWithResult = env->GetMethodID(cls, "s3eNOFchallengeCompleteWithResult", "(Ljava/lang/String;)I"); if (!g_s3eNOFchallengeCompleteWithResult) goto fail; g_s3eNOFchallengeDisplayCompletionWithData = env->GetMethodID(cls, "s3eNOFchallengeDisplayCompletionWithData", "(Ljava/lang/String;Ljava/lang/String;)I"); if (!g_s3eNOFchallengeDisplayCompletionWithData) goto fail; g_s3eNOFsubmitHighScore = env->GetMethodID(cls, "s3eNOFsubmitHighScore", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)I"); if (!g_s3eNOFsubmitHighScore) goto fail; g_s3eNOFupdateAcheivementProgressionComplete = env->GetMethodID(cls, "s3eNOFupdateAcheivementProgressionComplete", "(Ljava/lang/String;Ljava/lang/String;Z)I"); if (!g_s3eNOFupdateAcheivementProgressionComplete) goto fail; g_s3eNOFachievements = env->GetMethodID(cls, "s3eNOFachievements", "()I"); if (!g_s3eNOFachievements) goto fail; g_s3eNOFachievement = env->GetMethodID(cls, "s3eNOFachievement", "(Ljava/lang/String;)I"); if (!g_s3eNOFachievement) goto fail; g_s3eNOFachievementUnlock = env->GetMethodID(cls, "s3eNOFachievementUnlock", "(Ljava/lang/String;)I"); if (!g_s3eNOFachievementUnlock) goto fail; g_s3eNOFachievementUnlockAndDefer = env->GetMethodID(cls, "s3eNOFachievementUnlockAndDefer", "(Ljava/lang/String;)I"); if (!g_s3eNOFachievementUnlockAndDefer) goto fail; g_s3eNOFsubmitDeferredAchievements = env->GetMethodID(cls, "s3eNOFsubmitDeferredAchievements", "()I"); if (!g_s3eNOFsubmitDeferredAchievements) goto fail; g_s3eNOFapplicationDidRegisterForRemoteNotificationsWithDeviceToke = env->GetMethodID(cls, "s3eNOFapplicationDidRegisterForRemoteNotificationsWithDeviceToke", "(Ljava/lang/String;)I"); if (!g_s3eNOFapplicationDidRegisterForRemoteNotificationsWithDeviceToke) goto fail; g_s3eNOFlaunchDashboardWithListLeaderboardsPage = env->GetMethodID(cls, "s3eNOFlaunchDashboardWithListLeaderboardsPage", "()I"); if (!g_s3eNOFlaunchDashboardWithListLeaderboardsPage) goto fail; env->RegisterNatives(cls, nativeMethodDefs, sizeof(nativeMethodDefs)/sizeof(nativeMethodDefs[0])); IwTrace(NOPENFEINT, ("NOPENFEINT init success")); g_Obj = env->NewGlobalRef(obj); env->DeleteLocalRef(obj); env->DeleteGlobalRef(cls); // Add any platform-specific initialisation code here return S3E_RESULT_SUCCESS; fail: jthrowable exc = env->ExceptionOccurred(); if (exc) { env->ExceptionDescribe(); env->ExceptionClear(); IwTrace(s3eNOpenFeint, ("One or more java methods could not be found")); } return S3E_RESULT_ERROR; }
s3eResult s3ePushWooshInit_platform() { // Get the environment from the pointer JNIEnv* env = s3eEdkJNIGetEnv(); jobject obj = NULL; jmethodID cons = NULL; // Get the extension class jclass cls = s3eEdkAndroidFindClass("com/arellomobile/pushwoosh/s3ePushWoosh"); if (!cls) goto fail; // Get its constructor cons = env->GetMethodID(cls, "<init>", "()V"); if (!cons) goto fail; // Construct the java class obj = env->NewObject(cls, cons); if (!obj) goto fail; // Get all the extension methods g_s3ePushWooshNotificationsAvailable = env->GetMethodID(cls, "s3ePushWooshNotificationsAvailable", "()Z"); if (!g_s3ePushWooshNotificationsAvailable) goto fail; g_s3ePushWooshNotificationRegister = env->GetMethodID(cls, "s3ePushWooshNotificationRegister", "()I"); if (!g_s3ePushWooshNotificationRegister) goto fail; g_s3ePushWooshGetToken = env->GetMethodID(cls, "s3ePushWooshGetToken", "()Ljava/lang/String;"); if (!g_s3ePushWooshGetToken) goto fail; g_s3ePushWooshNotificationUnRegister = env->GetMethodID(cls, "s3ePushWooshNotificationUnRegister", "()I"); if (!g_s3ePushWooshNotificationUnRegister) goto fail; g_s3ePushWooshNotificationSetIntTag = env->GetMethodID(cls, "s3ePushWooshNotificationSetIntTag", "(Ljava/lang/String;I)I"); if (!g_s3ePushWooshNotificationSetIntTag) goto fail; g_s3ePushWooshNotificationSetStringTag = env->GetMethodID(cls, "s3ePushWooshNotificationSetStringTag", "(Ljava/lang/String;Ljava/lang/String;)I"); if (!g_s3ePushWooshNotificationSetStringTag) goto fail; g_s3ePushWooshClearLocalNotifications = env->GetMethodID(cls, "s3ePushWooshClearLocalNotifications", "()I"); if (!g_s3ePushWooshClearLocalNotifications) goto fail; g_s3ePushWooshScheduleLocalNotification = env->GetMethodID(cls, "s3ePushWooshScheduleLocalNotification", "(Ljava/lang/String;ILjava/lang/String;)I"); if (!g_s3ePushWooshScheduleLocalNotification) goto fail; g_s3ePushWooshSetAndroidNotificationMultiMode = env->GetMethodID(cls, "s3ePushWooshSetAndroidNotificationMultiMode", "(I)I"); if (!g_s3ePushWooshSetAndroidNotificationMultiMode) goto fail; g_s3ePushWooshStartLocationTracking = env->GetMethodID(cls, "s3ePushWooshStartLocationTracking", "()I"); if (!g_s3ePushWooshStartLocationTracking) goto fail; g_s3ePushWooshStopLocationTracking = env->GetMethodID(cls, "s3ePushWooshStopLocationTracking", "()I"); if (!g_s3ePushWooshStopLocationTracking) goto fail; g_s3ePushWooshSetUserId = env->GetMethodID(cls, "s3ePushWooshSetUserId", "(Ljava/lang/String;)I"); if (!g_s3ePushWooshSetUserId) goto fail; g_s3ePushWooshPostEvent = env->GetMethodID(cls, "s3ePushWooshPostEvent", "(Ljava/lang/String;Ljava/lang/String;)I"); if (!g_s3ePushWooshPostEvent) goto fail; static const JNINativeMethod jnm[] = { {"onNotificationsRegistered", "(Ljava/lang/String;)V", (void *)&native_onNotificationsRegistered}, {"onNotificationsRegisterError", "(Ljava/lang/String;)V", (void *)&native_onNotificationsRegisterError}, {"onPushReceived", "(Ljava/lang/String;Ljava/lang/String;)V", (void *)&native_onPushReceived } }; env->RegisterNatives(cls, jnm, sizeof(jnm) / sizeof(jnm[0])); IwTrace(PUSHWOOSH, ("PUSHWOOSH init success")); g_Obj = env->NewGlobalRef(obj); env->DeleteLocalRef(obj); env->DeleteGlobalRef(cls); // Add any platform-specific initialisation code here return S3E_RESULT_SUCCESS; fail: jthrowable exc = env->ExceptionOccurred(); if (exc) { env->ExceptionDescribe(); env->ExceptionClear(); IwTrace(s3ePushWoosh, ("One or more java methods could not be found")); } return S3E_RESULT_ERROR; }
s3eResult s3eFlurryInit_platform() { // Get the environment from the pointer JNIEnv* env = s3eEdkJNIGetEnv(); jobject obj = NULL; jmethodID cons = NULL; // Get the extension class jclass cls = s3eEdkAndroidFindClass("s3eFlurry"); if (!cls) goto fail; // Get its constructor cons = env->GetMethodID(cls, "<init>", "()V"); if (!cons) goto fail; // Construct the java class obj = env->NewObject(cls, cons); if (!obj) goto fail; // Get all the extension methods g_s3eFlurryStart = env->GetMethodID(cls, "s3eFlurryStart", "(Ljava/lang/String;)V"); if (!g_s3eFlurryStart) goto fail; g_s3eFlurryEnd = env->GetMethodID(cls, "s3eFlurryEnd", "()V"); if (!g_s3eFlurryEnd) goto fail; g_s3eFlurryLogEvent = env->GetMethodID(cls, "s3eFlurryLogEvent", "(Ljava/lang/String;Z)V"); if (!g_s3eFlurryLogEvent) goto fail; g_s3eFlurryEndTimedEvent = env->GetMethodID(cls, "s3eFlurryEndTimedEvent", "(Ljava/lang/String;)V"); if (!g_s3eFlurryEndTimedEvent) goto fail; g_s3eFlurryLogError = env->GetMethodID(cls, "s3eFlurryLogError", "(Ljava/lang/String;Ljava/lang/String;)V"); if (!g_s3eFlurryLogError) goto fail; g_s3eFlurrySetUserID = env->GetMethodID(cls, "s3eFlurrySetUserID", "(Ljava/lang/String;)V"); if (!g_s3eFlurrySetUserID) goto fail; g_s3eFlurrySetUserAge = env->GetMethodID(cls, "s3eFlurrySetUserAge", "(I)V"); if (!g_s3eFlurrySetUserAge) goto fail; g_s3eFlurrySetUserGender = env->GetMethodID(cls, "s3eFlurrySetUserGender", "(Z)V"); if (!g_s3eFlurrySetUserGender) goto fail; g_s3eFlurrySetLocation = env->GetMethodID(cls, "s3eFlurrySetLocation", "()V"); if (!g_s3eFlurrySetLocation) goto fail; g_s3eFlurrySetSessionReportOnClose = env->GetMethodID(cls, "s3eFlurrySetSessionReportOnClose", "()V"); if (!g_s3eFlurrySetSessionReportOnClose) goto fail; g_s3eFlurrySetSessionReportOnPause = env->GetMethodID(cls, "s3eFlurrySetSessionReportOnPause", "()V"); if (!g_s3eFlurrySetSessionReportOnPause) goto fail; g_s3eFlurryAppCircleEnable = env->GetMethodID(cls, "s3eFlurryAppCircleEnable", "()V"); if (!g_s3eFlurryAppCircleEnable) goto fail; g_s3eFlurrySetDefaultText = env->GetMethodID(cls, "s3eFlurrySetDefaultText", "(Ljava/lang/String;)V"); if (!g_s3eFlurrySetDefaultText) goto fail; g_s3eFlurryShowAdBanner = env->GetMethodID(cls, "s3eFlurryShowAdBanner", "(Z)V"); if (!g_s3eFlurryShowAdBanner) goto fail; g_s3eFlurryShowOfferWall = env->GetMethodID(cls, "s3eFlurryShowOfferWall", "()V"); if (!g_s3eFlurryShowOfferWall) goto fail; IwTrace(FLURRY, ("FLURRY init success")); g_Obj = env->NewGlobalRef(obj); env->DeleteLocalRef(obj); env->DeleteLocalRef(cls); // Add any platform-specific initialisation code here return S3E_RESULT_SUCCESS; fail: jthrowable exc = env->ExceptionOccurred(); if (exc) { env->ExceptionDescribe(); env->ExceptionClear(); IwTrace(s3eFlurry, ("One or more java methods could not be found")); } return S3E_RESULT_ERROR; }
s3eResult HeyzapInit_platform() { // Get the environment from the pointer JNIEnv* env = s3eEdkJNIGetEnv(); jobject obj = NULL; jmethodID cons = NULL; // Get the extension class jclass cls = s3eEdkAndroidFindClass("Heyzap"); if (!cls) goto fail; // Get its constructor cons = env->GetMethodID(cls, "<init>", "()V"); if (!cons) goto fail; // Construct the java class obj = env->NewObject(cls, cons); if (!obj) goto fail; // Get all the extension methods g_HeyzapStart = env->GetMethodID(cls, "HeyzapStart", "(Ljava/lang/String;)V"); if (!g_HeyzapStart) goto fail; g_HeyzapFetchInterstitial = env->GetMethodID(cls, "HeyzapFetchInterstitial", "(Ljava/lang/String;)V"); if (!g_HeyzapFetchInterstitial) goto fail; g_HeyzapShowInterstitial = env->GetMethodID(cls, "HeyzapShowInterstitial", "(Ljava/lang/String;)V"); if (!g_HeyzapShowInterstitial) goto fail; g_HeyzapFetchVideo = env->GetMethodID(cls, "HeyzapFetchVideo", "(Ljava/lang/String;)V"); if (!g_HeyzapFetchVideo) goto fail; g_HeyzapShowVideo = env->GetMethodID(cls, "HeyzapShowVideo", "(Ljava/lang/String;)V"); if (!g_HeyzapShowVideo) goto fail; g_HeyzapFetchRewarded = env->GetMethodID(cls, "HeyzapFetchRewarded", "(Ljava/lang/String;)V"); if (!g_HeyzapFetchRewarded) goto fail; g_HeyzapShowRewarded = env->GetMethodID(cls, "HeyzapShowRewarded", "(Ljava/lang/String;)V"); if (!g_HeyzapShowRewarded) goto fail; g_HeyzapShowBanner = env->GetMethodID(cls, "HeyzapShowBanner", "(ZLjava/lang/String;)V"); if (!g_HeyzapShowBanner) goto fail; g_HeyzapHideBanner= env->GetMethodID(cls, "HeyzapHideBanner", "()V"); if (!g_HeyzapHideBanner) goto fail; g_HeyzapDestroyBanner = env->GetMethodID(cls, "HeyzapDestroyBanner", "()V"); if (!g_HeyzapDestroyBanner) goto fail; g_HeyzapStartTestActivity = env->GetMethodID(cls, "HeyzapStartTestActivity", "()V"); if (!g_HeyzapStartTestActivity) goto fail; static const JNINativeMethod methods[] = { {"nativeCallback","(ILjava/lang/String;)V",(void*)&Heyzap_nativeCallback} }; // Register the native hooks if (env->RegisterNatives(cls, methods,sizeof(methods)/sizeof(methods[0]))) goto fail; IwTrace(HEYZAP, ("HEYZAP init success")); g_Obj = env->NewGlobalRef(obj); env->DeleteLocalRef(obj); env->DeleteGlobalRef(cls); // Add any platform-specific initialisation code here return S3E_RESULT_SUCCESS; fail: jthrowable exc = env->ExceptionOccurred(); if (exc) { env->ExceptionDescribe(); env->ExceptionClear(); IwTrace(Heyzap, ("One or more java methods could not be found")); } env->DeleteLocalRef(obj); env->DeleteGlobalRef(cls); return S3E_RESULT_ERROR; }
s3eResult s3eGameCircleInit_platform() { // Get the environment from the pointer JNIEnv* env = s3eEdkJNIGetEnv(); jobject obj = NULL; jmethodID cons = NULL; // Get the extension class jclass cls = s3eEdkAndroidFindClass("s3eGameCircle"); if (!cls) goto fail; // Get its constructor cons = env->GetMethodID(cls, "<init>", "()V"); if (!cons) goto fail; // Construct the java class obj = env->NewObject(cls, cons); if (!obj) goto fail; // Get all the extension methods g_s3eGameCircleInitialize = env->GetMethodID(cls, "s3eGameCircleInitialize", "(ZZZZ)V"); if (!g_s3eGameCircleInitialize) goto fail; g_s3eGameCircleGetStatus = env->GetMethodID(cls, "s3eGameCircleGetStatus", "()I"); if (!g_s3eGameCircleGetStatus) goto fail; g_s3eGameCircleIsReady = env->GetMethodID(cls, "s3eGameCircleIsReady", "()Z"); if (!g_s3eGameCircleIsReady) goto fail; g_s3eGameCircleGetPlayerAlias = env->GetMethodID(cls, "s3eGameCircleGetPlayerAlias", "(Ljava/lang/String;)V"); if (!g_s3eGameCircleGetPlayerAlias) goto fail; g_s3eGameCircleShowAchievementsOverlay = env->GetMethodID(cls, "s3eGameCircleShowAchievementsOverlay", "()V"); if (!g_s3eGameCircleShowAchievementsOverlay) goto fail; g_s3eGameCircleUpdateAchievement = env->GetMethodID(cls, "s3eGameCircleUpdateAchievement", "(Ljava/lang/String;FLjava/lang/String;)V"); if (!g_s3eGameCircleUpdateAchievement) goto fail; g_s3eGameCircleResetAchievements = env->GetMethodID(cls, "s3eGameCircleResetAchievements", "()V"); if (!g_s3eGameCircleResetAchievements) goto fail; g_s3eGameCircleResetAchievement = env->GetMethodID(cls, "s3eGameCircleResetAchievement", "(Ljava/lang/String;Ljava/lang/String;)V"); if (!g_s3eGameCircleResetAchievement) goto fail; g_s3eGameCircleSetPopUpLocation = env->GetMethodID(cls, "s3eGameCircleSetPopUpLocation", "()V"); if (!g_s3eGameCircleSetPopUpLocation) goto fail; g_s3eGameCircleShowLeaderboardOverlay = env->GetMethodID(cls, "s3eGameCircleShowLeaderboardOverlay", "(Ljava/lang/String;)V"); if (!g_s3eGameCircleShowLeaderboardOverlay) goto fail; g_s3eGameCircleShowLeaderboardsOverlay = env->GetMethodID(cls, "s3eGameCircleShowLeaderboardsOverlay", "()V"); if (!g_s3eGameCircleShowLeaderboardsOverlay) goto fail; g_s3eGameCircleSubmitScore = env->GetMethodID(cls, "s3eGameCircleSubmitScore", "(Ljava/lang/String;JLjava/lang/String;)V"); if (!g_s3eGameCircleSubmitScore) goto fail; g_s3eGameCircleGetLeaderboards = env->GetMethodID(cls, "s3eGameCircleGetLeaderboards", "(Ljava/lang/String;)V"); if (!g_s3eGameCircleGetLeaderboards) goto fail; g_s3eGameCircleGetScores = env->GetMethodID(cls, "s3eGameCircleGetScores", "(Ljava/lang/String;IILjava/lang/String;)V"); if (!g_s3eGameCircleGetScores) goto fail; g_s3eGameCircleGetLocalPlayerScore = env->GetMethodID(cls, "s3eGameCircleGetLocalPlayerScore", "(Ljava/lang/String;Ljava/lang/String;)V"); if (!g_s3eGameCircleGetLocalPlayerScore) goto fail; g_s3eGameCircleHasNewMultiFileGameData = env->GetMethodID(cls, "s3eGameCircleHasNewMultiFileGameData", "()Z"); if (!g_s3eGameCircleHasNewMultiFileGameData) goto fail; g_s3eGameCircleUnpackNewMultiFileGameData = env->GetMethodID(cls, "s3eGameCircleUnpackNewMultiFileGameData", "()V"); if (!g_s3eGameCircleUnpackNewMultiFileGameData) goto fail; g_s3eGameCircleSynchronizeBlob = env->GetMethodID(cls, "s3eGameCircleSynchronizeBlob", "(I)V"); if (!g_s3eGameCircleSynchronizeBlob) goto fail; g_s3eGameCirclenchronizeBlobProgress = env->GetMethodID(cls, "s3eGameCirclenchronizeBlobProgress", "(Ljava/lang/String;[BI)V"); if (!g_s3eGameCirclenchronizeBlobProgress) goto fail; g_s3eGameCircleSynchronizeMultiFile = env->GetMethodID(cls, "s3eGameCircleSynchronizeMultiFile", "()V"); if (!g_s3eGameCircleSynchronizeMultiFile) goto fail; g_s3eGameCircleSynchronizeMultiFileProgress = env->GetMethodID(cls, "s3eGameCircleSynchronizeMultiFileProgress", "(Ljava/lang/String;)V"); if (!g_s3eGameCircleSynchronizeMultiFileProgress) goto fail; g_s3eGameCircleRequestRevertBlob = env->GetMethodID(cls, "s3eGameCircleRequestRevertBlob", "()V"); if (!g_s3eGameCircleRequestRevertBlob) goto fail; g_s3eGameCircleRequestRevertMultiFile = env->GetMethodID(cls, "s3eGameCircleRequestRevertMultiFile", "()V"); if (!g_s3eGameCircleRequestRevertMultiFile) goto fail; { //jclass receiver=s3eEdkAndroidFindClass("com/ideaworks3d/marmalade/s3eAndroidMarketBilling/s3eAndroidMarketBillingReceiver"); static const JNINativeMethod methods[]= { {"native_onBlobCallBack","(II[B)V",(void*)&amazonGameCircle_onBlobCallBack}, {"native_onGetPlayerAlias","(Ljava/lang/String;)V",(void*)&amazonGameCircle_onGetPlayerAlias}, {"native_onInitializeCallback","(I)V",(void*)&amazonGameCircle_onInitializeCallback}, // {"native_onPurchaseUpdateResponse","(ILjava/lang/String;Ljava/lang/String;[Ljava/lang/String;[Lcom/amazon/inapp/purchasing/Receipt;Ljava/lang/String;Z)V",(void*)&amazonBilling_onPurchaseUpdateResponse}, // {"native_onItemDataResponse","(ILjava/lang/String;[Ljava/lang/String;[Lcom/amazon/inapp/purchasing/Item;)V",(void*)&amazonBilling_onItemDataResponse}, // {"native_onInAppNotifyCallback","(Ljava/lang/String;)V",(void*)&InAppBilling_onInAppNotifyCallback}, // {"native_onPurchaseStateChangedCallback","([Lcom/ideaworks3d/marmalade/s3eAndroidMarketBilling/s3eAndroidMarketBillingReceiver$Order;I)V",(void*)&InAppBilling_onPurchaseStateChangedCallback} }; // Register the native hooks if(env->RegisterNatives(cls, methods, sizeof(methods)/sizeof(methods[0]))) goto fail; } IwTrace(GAMECIRCLE, ("GAMECIRCLE init success")); g_Obj = env->NewGlobalRef(obj); env->DeleteLocalRef(obj); env->DeleteGlobalRef(cls); // Add any platform-specific initialisation code here return S3E_RESULT_SUCCESS; fail: jthrowable exc = env->ExceptionOccurred(); if (exc) { env->ExceptionDescribe(); env->ExceptionClear(); IwTrace(s3eGameCircle, ("One or more java methods could not be found")); } return S3E_RESULT_ERROR; }
s3eResult IsChartboostInit_platform() { s3eDebugOutputString("IsChartboostInit_platform"); // Get the environment from the pointer JNIEnv* env = s3eEdkJNIGetEnv(); jobject obj = NULL; jmethodID cons = NULL; jclass cls; jfieldID field; char g_AppID[255]; char g_AppSignature[255]; const JNINativeMethod nativeMethodDefs[] = { { "IsChartboostRequestCallback", "(I)V", (void*)&IsChartboostRequestCallback }, { "IsChartboostAdClosedCallback", "(I)V", (void*)&IsChartboostAdClosedCallback }, { "IsChartboostAdDismissedRequestCallback", "(I)V", (void*)&IsChartboostAdDismissedRequestCallback }, { "IsChartboostAdClickedRequestCallback", "(I)V", (void*)&IsChartboostAdClickedRequestCallback }, }; // Get the extension class cls = s3eEdkAndroidFindClass("com/isextension/IsChartboost"); if (!cls) goto fail; // Setup and cache the Activity Field field = env->GetStaticFieldID(cls, "m_Activity", "Lcom/isextension/IsChartboost;"); if (!field) goto fail; obj = env->GetStaticObjectField(cls, field); if (!obj) goto fail; // Get all the extension methods g_IsChartboostSetAppID = env->GetMethodID(cls, "IsChartboostSetAppID", "(Ljava/lang/String;)V"); if (!g_IsChartboostSetAppID) goto fail; g_IsChartboostSetAppSignature = env->GetMethodID(cls, "IsChartboostSetAppSignature", "(Ljava/lang/String;)V"); if (!g_IsChartboostSetAppSignature) goto fail; g_IsChartboostStartSession = env->GetMethodID(cls, "IsChartboostStartSession", "()V"); if (!g_IsChartboostStartSession) goto fail; g_IsChartboostRequestAd = env->GetMethodID(cls, "IsChartboostRequestAd", "()V"); if (!g_IsChartboostRequestAd) goto fail; g_IsChartboostCacheInterstitial = env->GetMethodID(cls, "IsChartboostCacheInterstitial", "(Ljava/lang/String;)V"); if (!g_IsChartboostCacheInterstitial) goto fail; g_IsChartboostShowInterstitial = env->GetMethodID(cls, "IsChartboostShowInterstitial", "(Ljava/lang/String;)V"); if (!g_IsChartboostShowInterstitial) goto fail; g_IsChartboostCacheMoreApps = env->GetMethodID(cls, "IsChartboostCacheMoreApps", "()V"); if (!g_IsChartboostCacheMoreApps) goto fail; g_IsChartboostShowMoreApps = env->GetMethodID(cls, "IsChartboostShowMoreApps", "()V"); if (!g_IsChartboostShowMoreApps) goto fail; if(env->RegisterNatives(cls, nativeMethodDefs, sizeof(nativeMethodDefs)/sizeof(nativeMethodDefs[0]))) goto fail; IwTrace(CHARTBOOST, ("CHARTBOOST init success")); g_Obj = env->NewGlobalRef(obj); env->DeleteLocalRef(obj); env->DeleteGlobalRef(cls); // Add any platform-specific initialisation code here return S3E_RESULT_SUCCESS; fail: jthrowable exc = env->ExceptionOccurred(); if (exc) { env->ExceptionDescribe(); env->ExceptionClear(); IwTrace(IsChartboost, ("One or more java methods could not be found")); } return S3E_RESULT_ERROR; }
s3eResult FuseSDKInit_platform() { // Get the environment from the pointer JNIEnv* env = s3eEdkJNIGetEnv(); jobject obj = NULL; jmethodID cons = NULL; // callbacks const JNINativeMethod nativeMethodDefs[] = { { "FuseSDKSessionStartReceived", "()V", (void*)&FuseSDKSessionStartReceived }, { "FuseSDKLoginError", "(I)V", (void*)&FuseSDKLoginError }, { "FuseSDKAdAvailabilityResponse", "(II)V", (void*)&FuseSDKAdAvailabilityResponse }, { "FuseSDKAdWillClose", "()V", (void*)&FuseSDKAdWillClose }, { "FuseSDKAdFailedToDisplay", "()V", (void*)&FuseSDKAdFailedToDisplay }, { "FuseSDKAdDidShow", "(II)V", (void*)&FuseSDKAdDidShow }, { "FuseSDKNotificationAction", "(Ljava/lang/String;)V", (void*)&FuseSDKNotificationAction }, { "FuseSDKAccountLoginComplete","(ILjava/lang/String;)V", (void*)&FuseSDKAccountLoginComplete }, { "FuseSDKTimeUpdated", "(I)V", (void*)&FuseSDKTimeUpdated }, { "FuseGameConfigurationStart", "(I)V", (void*)&FuseGameConfigurationStart }, { "FuseGameConfigurationKeyValue", "(Ljava/lang/String;Ljava/lang/String;)V", (void*)&FuseGameConfigurationKeyValue }, { "FuseGameConfigurationReceived", "()V", (void*)&FuseGameConfigurationReceived }, { "FuseSDKPurchaseVerification", "(ILjava/lang/String;Ljava/lang/String;)V", (void*)&FuseSDKPurchaseVerification }, { "FuseSDKRewardedAdComplete", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;II)V", (void*)&FuseSDKRewardedAdComplete }, { "FuseSDKVirtualGoodsOfferAccepted", "(Ljava/lang/String;FLjava/lang/String;IIIII)V", (void*)&FuseSDKVirtualGoodsOfferAccepted }, { "FuseSDKIAPOfferAccepted", "(FILjava/lang/String;Ljava/lang/String;II)V", (void*)&FuseSDKIAPOfferAccepted }, }; // Get the extension class jclass cls = s3eEdkAndroidFindClass("com/fuseextension/FuseWrapper"); if (!cls) goto fail; // Get its constructor cons = env->GetMethodID(cls, "<init>", "()V"); if (!cons) goto fail; // Construct the java class obj = env->NewObject(cls, cons); if (!obj) goto fail; // Get all the extension methods g_FuseSDKStartSession = env->GetMethodID(cls, "FuseSDKStartSession", "(Ljava/lang/String;)V"); if (!g_FuseSDKStartSession) goto fail; g_FuseSDKPauseSession = env->GetMethodID(cls, "FuseSDKPauseSession", "()V"); if (!g_FuseSDKPauseSession) goto fail; g_FuseSDKResumeSession = env->GetMethodID(cls, "FuseSDKResumeSession", "()V"); if (!g_FuseSDKResumeSession) goto fail; g_FuseSDKTerminateSession = env->GetMethodID(cls, "FuseSDKTerminateSession", "()V"); if (!g_FuseSDKTerminateSession) goto fail; g_FuseSDKRegisterForPushNotifications = env->GetMethodID(cls, "FuseSDKRegisterForPushNotifications", "(Ljava/lang/String;)V"); if (!g_FuseSDKRegisterForPushNotifications) goto fail; g_FuseSDKRegisterInAppPurchase = env->GetMethodID(cls, "FuseSDKRegisterInAppPurchase", "(ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;JLjava/lang/String;DLjava/lang/String;)V"); if (!g_FuseSDKRegisterInAppPurchase) goto fail; g_FuseSDKIsAdAvailableForZoneID = env->GetMethodID(cls, "FuseSDKIsAdAvailableForZoneID", "(Ljava/lang/String;)Z"); if (!g_FuseSDKIsAdAvailableForZoneID) goto fail; g_FuseSDKShowAdForZoneID = env->GetMethodID(cls, "FuseSDKShowAdForZoneID", "(Ljava/lang/String;ZZLjava/lang/String;Ljava/lang/String;Ljava/lang/String;)V"); if (!g_FuseSDKShowAdForZoneID) goto fail; g_FuseSDKPreloadAdForZoneID = env->GetMethodID(cls, "FuseSDKPreloadAdForZoneID", "(Ljava/lang/String;)V"); if (!g_FuseSDKPreloadAdForZoneID) goto fail; g_FuseSDKDisplayNotifications = env->GetMethodID(cls, "FuseSDKDisplayNotifications", "()V"); if (!g_FuseSDKDisplayNotifications) goto fail; g_FuseSDKDisplayMoreGames = env->GetMethodID(cls, "FuseSDKDisplayMoreGames", "()V"); if (!g_FuseSDKDisplayMoreGames) goto fail; g_FuseSDKRegisterGender = env->GetMethodID(cls, "FuseSDKRegisterGender", "(I)V"); if (!g_FuseSDKRegisterGender) goto fail; g_FuseSDKFacebookLogin = env->GetMethodID(cls, "FuseSDKFacebookLogin", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V"); if (!g_FuseSDKFacebookLogin) goto fail; g_FuseSDKTwitterLogin = env->GetMethodID(cls, "FuseSDKTwitterLogin", "(Ljava/lang/String;)V"); if (!g_FuseSDKTwitterLogin) goto fail; g_FuseSDKDeviceLogin = env->GetMethodID(cls, "FuseSDKDeviceLogin", "(Ljava/lang/String;)V"); if (!g_FuseSDKDeviceLogin) goto fail; g_FuseSDKFuseLogin = env->GetMethodID(cls, "FuseSDKFuseLogin", "(Ljava/lang/String;Ljava/lang/String;)V"); if (!g_FuseSDKFuseLogin) goto fail; g_FuseSDKGooglePlayLogin = env->GetMethodID(cls, "FuseSDKGooglePlayLogin", "(Ljava/lang/String;Ljava/lang/String;)V"); if (!g_FuseSDKGooglePlayLogin) goto fail; g_FuseSDKGetOriginalAccountId = env->GetMethodID(cls, "FuseSDKGetOriginalAccountId", "()Ljava/lang/String;"); if (!g_FuseSDKGetOriginalAccountId) goto fail; g_FuseSDKGetOriginalAccountAlias = env->GetMethodID(cls, "FuseSDKGetOriginalAccountAlias", "()Ljava/lang/String;"); if (!g_FuseSDKGetOriginalAccountAlias) goto fail; g_FuseSDKGetOriginalAccountType = env->GetMethodID(cls, "FuseSDKGetOriginalAccountType", "()I"); if (!g_FuseSDKGetOriginalAccountType) goto fail; g_FuseSDKGetFuseID = env->GetMethodID(cls, "FuseSDKGetFuseID", "()Ljava/lang/String;"); if (!g_FuseSDKGetFuseID) goto fail; g_FuseSDKgamesPlayed = env->GetMethodID(cls, "FuseSDKgamesPlayed", "()I"); if (!g_FuseSDKgamesPlayed) goto fail; g_FuseSDKLibraryVersion = env->GetMethodID(cls, "FuseSDKLibraryVersion", "()Ljava/lang/String;"); if (!g_FuseSDKLibraryVersion) goto fail; g_FuseSDKConnected = env->GetMethodID(cls, "FuseSDKConnected", "()Z"); if (!g_FuseSDKConnected) goto fail; g_FuseSDKTimeFromServer = env->GetMethodID(cls, "FuseSDKTimeFromServer", "()V"); if (!g_FuseSDKTimeFromServer) goto fail; g_FuseSDKEnableData = env->GetMethodID(cls, "FuseSDKEnableData", "(Z)V"); if (!g_FuseSDKEnableData) goto fail; g_FuseSDKGetGameConfigurationValue = env->GetMethodID(cls, "FuseSDKGetGameConfigurationValue", "(Ljava/lang/String;)Ljava/lang/String;"); if (!g_FuseSDKGetGameConfigurationValue) goto fail; g_FuseSDKRegisterLevel = env->GetMethodID(cls, "FuseSDKRegisterLevel", "(I)V"); if (!g_FuseSDKRegisterLevel) goto fail; g_FuseSDKRegisterCurrency = env->GetMethodID(cls, "FuseSDKRegisterCurrency", "(II)V"); if (!g_FuseSDKRegisterCurrency) goto fail; g_FuseSDKRegisterVirtualGoodsPurchase = env->GetMethodID(cls, "FuseSDKRegisterVirtualGoodsPurchase", "(III)V"); if (!g_FuseSDKRegisterVirtualGoodsPurchase) goto fail; g_FuseSDKRegisterParentalConsent = env->GetMethodID(cls, "FuseSDKRegisterParentalConsent", "(Z)V"); if (!g_FuseSDKRegisterParentalConsent) goto fail; g_FuseSDKRegisterCustomEventInt = env->GetMethodID(cls, "FuseSDKRegisterCustomEventInt", "(II)Z"); if (!g_FuseSDKRegisterCustomEventInt) goto fail; g_FuseSDKRegisterCustomEventString = env->GetMethodID(cls, "FuseSDKRegisterCustomEventString", "(ILjava/lang/String;)Z"); if (!g_FuseSDKRegisterCustomEventString) goto fail; g_FuseSDKSetRewardedVideoUserID = env->GetMethodID(cls, "FuseSDKSetRewardedVideoUserID", "(Ljava/lang/String;)V"); if (!g_FuseSDKSetRewardedVideoUserID) goto fail; if(env->RegisterNatives(cls, nativeMethodDefs, sizeof(nativeMethodDefs)/sizeof(nativeMethodDefs[0]))) goto fail; IwTrace(FUSESDK, ("FUSESDK init success")); g_Obj = env->NewGlobalRef(obj); env->DeleteLocalRef(obj); env->DeleteGlobalRef(cls); // Add any platform-specific initialisation code here s3eDeviceRegister(S3E_DEVICE_PAUSE, &FusePause, 0); s3eDeviceRegister(S3E_DEVICE_UNPAUSE, &FuseResume, 0); return S3E_RESULT_SUCCESS; fail: jthrowable exc = env->ExceptionOccurred(); if (exc) { env->ExceptionDescribe(); env->ExceptionClear(); IwTrace(FuseSDK, ("One or more java methods could not be found")); } return S3E_RESULT_ERROR; }