Repository: incubator-milagro-mfa-sdk-android
Updated Branches:
  refs/heads/master 8dc048199 -> 790730437


Apply MPinSDK API changes

        Remove GetPrerollId
        Add DeleteUserPerBackend and GetSessionDetails


Project: 
http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-android/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-android/commit/39f46eab
Tree: 
http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-android/tree/39f46eab
Diff: 
http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-android/diff/39f46eab

Branch: refs/heads/master
Commit: 39f46eab10c2dc679626c537b96125e223011040
Parents: ac9ce68
Author: Vassil Angelov <vassil.ange...@miracl.com>
Authored: Tue Apr 26 15:37:23 2016 +0300
Committer: Vladislav Mitov <vladislav.mi...@gmail.com>
Committed: Mon May 9 10:27:21 2016 +0300

----------------------------------------------------------------------
 build.gradle                                    |  2 +-
 gradle.properties                               |  4 +--
 mpin-sdk-core                                   |  2 +-
 mpinsdk/build.gradle                            |  2 +-
 .../main/java/com/miracl/mpinsdk/MPinSDK.java   | 13 +++++++--
 .../miracl/mpinsdk/model/SessionDetails.java    | 26 +++++++++++++++++
 mpinsdk/src/main/jni/JNIMPinSDK.cpp             | 30 ++++++++++++++++----
 7 files changed, 66 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-android/blob/39f46eab/build.gradle
----------------------------------------------------------------------
diff --git a/build.gradle b/build.gradle
index e0b366a..168f129 100644
--- a/build.gradle
+++ b/build.gradle
@@ -5,7 +5,7 @@ buildscript {
         jcenter()
     }
     dependencies {
-        classpath 'com.android.tools.build:gradle:1.5.0'
+        classpath 'com.android.tools.build:gradle:2.0.0'
 
         // NOTE: Do not place your application dependencies here; they belong
         // in the individual module build.gradle files

http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-android/blob/39f46eab/gradle.properties
----------------------------------------------------------------------
diff --git a/gradle.properties b/gradle.properties
index dc51216..63a8f4b 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -16,8 +16,8 @@
 # This option should only be used with decoupled projects. More details, visit
 # 
http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
 # org.gradle.parallel=true
-VERSION_NAME=1.0-SNAPSHOT
-VERSION_CODE=1
+VERSION_NAME=1.1-SNAPSHOT
+VERSION_CODE=2
 GROUP=com.miracl
 RELEASE_REPOSITORY_URL=http://10.10.23.15:8081/content/repositories/mpinsdk/
 
SNAPSHOT_REPOSITORY_URL=http://10.10.23.15:8081/content/repositories/mpinsdk-snapshot/

http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-android/blob/39f46eab/mpin-sdk-core
----------------------------------------------------------------------
diff --git a/mpin-sdk-core b/mpin-sdk-core
index acd0530..0c9b7fa 160000
--- a/mpin-sdk-core
+++ b/mpin-sdk-core
@@ -1 +1 @@
-Subproject commit acd0530bc597f27c93ebeda3059107f553b955a0
+Subproject commit 0c9b7fa6256ad4b2b90a14ce3ce7aabfbe6c16f6

http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-android/blob/39f46eab/mpinsdk/build.gradle
----------------------------------------------------------------------
diff --git a/mpinsdk/build.gradle b/mpinsdk/build.gradle
index 30196c8..ff85523 100644
--- a/mpinsdk/build.gradle
+++ b/mpinsdk/build.gradle
@@ -4,7 +4,7 @@ import org.apache.tools.ant.taskdefs.condition.Os
 
 android {
     compileSdkVersion 23
-    buildToolsVersion "23.0.1"
+    buildToolsVersion "23.0.2"
 
     defaultConfig {
         minSdkVersion 16

http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-android/blob/39f46eab/mpinsdk/src/main/java/com/miracl/mpinsdk/MPinSDK.java
----------------------------------------------------------------------
diff --git a/mpinsdk/src/main/java/com/miracl/mpinsdk/MPinSDK.java 
b/mpinsdk/src/main/java/com/miracl/mpinsdk/MPinSDK.java
index 3077eb5..6eddc3e 100644
--- a/mpinsdk/src/main/java/com/miracl/mpinsdk/MPinSDK.java
+++ b/mpinsdk/src/main/java/com/miracl/mpinsdk/MPinSDK.java
@@ -22,6 +22,7 @@ package com.miracl.mpinsdk;
 import android.content.Context;
 
 import com.miracl.mpinsdk.model.OTP;
+import com.miracl.mpinsdk.model.SessionDetails;
 import com.miracl.mpinsdk.model.Status;
 import com.miracl.mpinsdk.model.User;
 
@@ -141,14 +142,18 @@ public class MPinSDK implements Closeable {
         return nFinishAuthenticationAN(mPtr, user, pin, accessNumber);
     }
 
-    public String GetPrerollUserId(String accessCode) {
-        return nGetPrerollUserId(mPtr, accessCode);
+    public Status GetSessionDetails(String accessCode, SessionDetails 
sessionDetails) {
+        return nGetSessionDetails(mPtr, accessCode, sessionDetails);
     }
 
     public void DeleteUser(User user) {
         nDeleteUser(mPtr, user);
     }
 
+    public void DeleteUser(User user, String backend) {
+        nDeleteUserForBackend(mPtr, user, backend);
+    }
+
     public Status ListUsers(List<User> users) {
         return nListUsers(mPtr, users);
     }
@@ -215,10 +220,12 @@ public class MPinSDK implements Closeable {
 
     private native Status nFinishAuthenticationAN(long ptr, User user, String 
pin, String accessNumber);
 
-    private native String nGetPrerollUserId(long ptr, String key);
+    private native Status nGetSessionDetails(long ptr, String accessCode, 
SessionDetails sessionDetails);
 
     private native void nDeleteUser(long ptr, User user);
 
+    private native void nDeleteUserForBackend(long ptr, User user, String 
backend);
+
     private native Status nListUsers(long ptr, List<User> users);
 
     private native Status nListUsersForBackend(long ptr, List<User> users, 
String backend);

http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-android/blob/39f46eab/mpinsdk/src/main/java/com/miracl/mpinsdk/model/SessionDetails.java
----------------------------------------------------------------------
diff --git a/mpinsdk/src/main/java/com/miracl/mpinsdk/model/SessionDetails.java 
b/mpinsdk/src/main/java/com/miracl/mpinsdk/model/SessionDetails.java
new file mode 100644
index 0000000..e85dfce
--- /dev/null
+++ b/mpinsdk/src/main/java/com/miracl/mpinsdk/model/SessionDetails.java
@@ -0,0 +1,26 @@
+/***************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ ***************************************************************/
+package com.miracl.mpinsdk.model;
+
+public class SessionDetails {
+
+    public String prerollId;
+    public String appName;
+    public String appIconUrl;
+}

http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-android/blob/39f46eab/mpinsdk/src/main/jni/JNIMPinSDK.cpp
----------------------------------------------------------------------
diff --git a/mpinsdk/src/main/jni/JNIMPinSDK.cpp 
b/mpinsdk/src/main/jni/JNIMPinSDK.cpp
index 4f684b3..3a06254 100644
--- a/mpinsdk/src/main/jni/JNIMPinSDK.cpp
+++ b/mpinsdk/src/main/jni/JNIMPinSDK.cpp
@@ -183,11 +183,25 @@ static jobject nFinishAuthenticationAN(JNIEnv* env, 
jobject jobj, jlong jptr, jo
        return MakeJavaStatus(env, 
sdk->FinishAuthenticationAN(JavaToMPinUser(env, juser), JavaToStdString(env, 
jpin), JavaToStdString(env, jaccessNumber)));
 }
 
-static jstring nGetPrerollUserId(JNIEnv* env, jobject jobj, jlong jptr, 
jstring jaccessCode)
-{
+static jobject nGetSessionDetails(JNIEnv* env, jobject jobj, jlong jptr, 
jstring jaccessCode, jobject jsessionDetails){
     MPinSDK* sdk = (MPinSDK*) jptr;
-    MPinSDK::String result = sdk->GetPrerollUserId(JavaToStdString(env, 
jaccessCode));
-    return env->NewStringUTF(result.c_str());
+    MPinSDK::SessionDetails sessionDetails;
+
+    MPinSDK::Status status = 
sdk->GetSessionDetails(JavaToStdString(env,jaccessCode), sessionDetails);
+
+    if(status == MPinSDK::Status::OK)
+       {
+               jclass clsSessionDetails = 
env->FindClass("com/miracl/mpinsdk/model/SessionDetails");
+               jfieldID fIdPrerollId = env->GetFieldID(clsSessionDetails, 
"prerollId", "Ljava/lang/String;");
+               jfieldID fIdAppName = env->GetFieldID(clsSessionDetails, 
"appName", "Ljava/lang/String;");
+               jfieldID fIdAppIconUrl = env->GetFieldID(clsSessionDetails, 
"appIconUrl", "Ljava/lang/String;");
+
+               env->SetObjectField(jsessionDetails, fIdPrerollId, 
env->NewStringUTF(sessionDetails.prerollId.c_str()));
+               env->SetObjectField(jsessionDetails, fIdAppName, 
env->NewStringUTF(sessionDetails.appName.c_str()));
+               env->SetObjectField(jsessionDetails, fIdAppIconUrl, 
env->NewStringUTF(sessionDetails.appIconUrl.c_str()));
+       }
+
+    return MakeJavaStatus(env, status);
 }
 
 static void nDeleteUser(JNIEnv* env, jobject jobj, jlong jptr, jobject juser)
@@ -196,6 +210,11 @@ static void nDeleteUser(JNIEnv* env, jobject jobj, jlong 
jptr, jobject juser)
        sdk->DeleteUser(JavaToMPinUser(env, juser));
 }
 
+static void nDeleteUserForBackend(JNIEnv* env, jobject jobj, jlong jptr, 
jobject juser, jstring jbackend){
+    MPinSDK* sdk = (MPinSDK*) jptr;
+    sdk->DeleteUser(JavaToMPinUser(env, juser), JavaToStdString(env, 
jbackend));
+}
+
 static jobject nListUsers(JNIEnv* env, jobject jobj, jlong jptr, jobject 
jusersList)
 {
        MPinSDK* sdk = (MPinSDK*) jptr;
@@ -312,7 +331,8 @@ static JNINativeMethod g_methodsMPinSDK[] =
        NATIVE_METHOD(nFinishAuthenticationOTP, 
"(JLcom/miracl/mpinsdk/model/User;Ljava/lang/String;Lcom/miracl/mpinsdk/model/OTP;)Lcom/miracl/mpinsdk/model/Status;"),
        NATIVE_METHOD(nFinishAuthenticationAN, 
"(JLcom/miracl/mpinsdk/model/User;Ljava/lang/String;Ljava/lang/String;)Lcom/miracl/mpinsdk/model/Status;"),
        NATIVE_METHOD(nDeleteUser, "(JLcom/miracl/mpinsdk/model/User;)V"),
-    NATIVE_METHOD(nGetPrerollUserId, 
"(JLjava/lang/String;)Ljava/lang/String;"),
+       NATIVE_METHOD(nDeleteUserForBackend, 
"(JLcom/miracl/mpinsdk/model/User;Ljava/lang/String;)V"),
+       NATIVE_METHOD(nGetSessionDetails, 
"(JLjava/lang/String;Lcom/miracl/mpinsdk/model/SessionDetails;)Lcom/miracl/mpinsdk/model/Status;"),
        NATIVE_METHOD(nListUsers, 
"(JLjava/util/List;)Lcom/miracl/mpinsdk/model/Status;"),
     NATIVE_METHOD(nListUsersForBackend, 
"(JLjava/util/List;Ljava/lang/String;)Lcom/miracl/mpinsdk/model/Status;"),
     NATIVE_METHOD(nListBackends, 
"(JLjava/util/List;)Lcom/miracl/mpinsdk/model/Status;"),

Reply via email to