JNIEXPORT jobjectArray JNICALL Java_com_mapswithme_maps_editor_OsmOAuth_nativeAuthWithWebviewToken(JNIEnv * env, jclass clazz, jstring key, jstring secret, jstring verifier) { try { TRequestToken const rt = { ToNativeString(env, key), ToNativeString(env, secret) }; OsmOAuth auth = OsmOAuth::ServerAuth(); TKeySecret const ks = auth.FinishAuthorization(rt, ToNativeString(env, verifier)); return ToStringArray(env, ks); } catch (exception const & ex) { LOG(LWARNING, ("nativeAuthWithWebviewToken error ", ex.what())); return nullptr; } }
JNIEXPORT jobjectArray JNICALL Java_com_mapswithme_maps_editor_OsmOAuth_nativeAuthWithPassword(JNIEnv * env, jclass clazz, jstring login, jstring password) { OsmOAuth auth = OsmOAuth::ServerAuth(); try { if (auth.AuthorizePassword(ToNativeString(env, login), ToNativeString(env, password))) return ToStringArray(env, auth.GetKeySecret()); LOG(LWARNING, ("nativeAuthWithPassword: invalid login or password.")); } catch (exception const & ex) { LOG(LWARNING, ("nativeAuthWithPassword error ", ex.what())); } return nullptr; }
void LogPostingInterop::Post(int postType, mono::string text) { gEnv->pLog->LogV((IMiniLog::ELogType)postType, ToNativeString(text), 0); }