From 3a7faf734600c32d19d7ad203dfd4abbf2ceca09 Mon Sep 17 00:00:00 2001 From: Dmitry Yunitsky Date: Mon, 25 Jan 2016 19:17:43 +0300 Subject: [PATCH] [android] Working password and webview auth. --- .../com/mapswithme/maps/editor/OsmOAuth.cpp | 4 +- android/res/layout/fragment_auth_editor.xml | 34 ----- .../mapswithme/maps/editor/AuthFragment.java | 121 +++++++++++++++--- .../com/mapswithme/maps/editor/OsmOAuth.java | 11 ++ .../mapswithme/maps/widget/InputWebView.java | 33 +++++ .../src/com/mapswithme/util/Constants.java | 3 + 6 files changed, 148 insertions(+), 58 deletions(-) create mode 100644 android/src/com/mapswithme/maps/widget/InputWebView.java diff --git a/android/jni/com/mapswithme/maps/editor/OsmOAuth.cpp b/android/jni/com/mapswithme/maps/editor/OsmOAuth.cpp index 2f259860a0..e0428a7717 100644 --- a/android/jni/com/mapswithme/maps/editor/OsmOAuth.cpp +++ b/android/jni/com/mapswithme/maps/editor/OsmOAuth.cpp @@ -37,7 +37,6 @@ Java_com_mapswithme_maps_editor_OsmOAuth_nativeAuthWithPassword(JNIEnv * env, jc { OsmOAuth auth = OsmOAuth::ServerAuth(); auto authResult = auth.AuthorizePassword(ToNativeString(env, login), ToNativeString(env, password)); - LOG(LINFO, ("Auth result : ", authResult)); return authResult == OsmOAuth::AuthResult::OK ? ToStringArray(env, auth.GetToken()) : nullptr; } @@ -50,7 +49,6 @@ Java_com_mapswithme_maps_editor_OsmOAuth_nativeAuthWithWebviewToken(JNIEnv * env TKeySecret outKeySecret; TKeySecret inKeySecret(ToNativeString(env, secret), ToNativeString(env, token)); auto authResult = auth.FinishAuthorization(inKeySecret, ToNativeString(env, verifier), outKeySecret); - LOG(LINFO, ("Auth result : ", authResult)); if (authResult != OsmOAuth::AuthResult::OK) return nullptr; auth.FinishAuthorization(inKeySecret, ToNativeString(env, token), outKeySecret); @@ -65,7 +63,7 @@ Java_com_mapswithme_maps_editor_OsmOAuth_nativeGetFacebookAuthUrl(JNIEnv * env, } JNIEXPORT jobjectArray JNICALL -Java_com_mapswithme_maps_editor_OsmOAuth_nativeAuthGoogle(JNIEnv * env, jclass clazz) +Java_com_mapswithme_maps_editor_OsmOAuth_nativeGetGoogleAuthUrl(JNIEnv * env, jclass clazz) { OsmOAuth::TUrlKeySecret keySecret = OsmOAuth::ServerAuth().GetGoogleOAuthURL(); return ToStringArray(env, keySecret.first, keySecret.second.first, keySecret.second.second); diff --git a/android/res/layout/fragment_auth_editor.xml b/android/res/layout/fragment_auth_editor.xml index 13e997cf8f..76a3870153 100644 --- a/android/res/layout/fragment_auth_editor.xml +++ b/android/res/layout/fragment_auth_editor.xml @@ -17,7 +17,6 @@ tools:ignore="UnusedAttribute"/> - - - - - - -