Skip to content

Commit

Permalink
Added v11.4.4
Browse files Browse the repository at this point in the history
  • Loading branch information
sMaltsevAcuant committed Aug 14, 2020
1 parent d7eb5f3 commit 800822f
Show file tree
Hide file tree
Showing 19 changed files with 604 additions and 311 deletions.
265 changes: 141 additions & 124 deletions README.md

Large diffs are not rendered by default.

Binary file modified acuantcommon/acuantcommon.aar
Binary file not shown.
Binary file modified acuantdocumentprocessing/acuantdocumentprocessing.aar
Binary file not shown.
Binary file modified acuantechipreader/acuantechipreader.aar
Binary file not shown.
Binary file modified acuantfacematch/acuantfacematch.aar
Binary file not shown.
Binary file modified acuanthgliveness/acuanthgliveness.aar
Binary file not shown.
Binary file modified acuantimagepreparation/acuantimagepreparation.aar
Binary file not shown.
Binary file modified acuantipliveness/acuantipliveness.aar
Binary file not shown.
Binary file modified acuantpassiveliveness/acuantpassiveliveness.aar
Binary file not shown.
9 changes: 8 additions & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,14 @@ android {
}
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

kotlinOptions {
jvmTarget = "1.8"
}

project.ext.versionCodes = ['armeabi': 1, 'armeabi-v7a': 2, 'arm64-v8a': 3, 'x86': 4, 'x86_64': 5]

Expand Down Expand Up @@ -97,7 +104,7 @@ dependencies {


//iproov
implementation('com.iproov.sdk:iproov:4.4.0@aar') {
implementation('com.iproov.sdk:iproov:5.2.1@aar') {
transitive = true
}

Expand Down
3 changes: 2 additions & 1 deletion app/src/main/java/com/acuant/sampleapp/Constants.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ package com.acuant.sampleapp
class Constants {
companion object {
const val REQUEST_CAMERA_PHOTO = 1
const val REQUEST_CAMERA_IP_SELFIE = 2
//this is the old IP liveness workflow. NOT supported any more, but left in for reference if needed.
/*const val REQUEST_CAMERA_IP_SELFIE = 2*/
const val REQUEST_CONFIRMATION = 3
const val REQUEST_RETRY = 4
const val REQUEST_CAMERA_HG_SELFIE = 5
Expand Down
228 changes: 150 additions & 78 deletions app/src/main/java/com/acuant/sampleapp/MainActivity.kt

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions app/src/main/java/com/acuant/sampleapp/NfcResultActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,12 @@ class NfcResultActivity : AppCompatActivity() {
value = data.dateOfBirth
addField(key, value)

if (data.age != null) {
key = "Age"
value = data.age.toString()
addField(key, value)
}

key = "Nationality"
value = data.nationality
addField(key, value)
Expand All @@ -99,6 +105,11 @@ class NfcResultActivity : AppCompatActivity() {
value = data.documentExpiryDate
addField(key, value)

if (data.isExpired != null) {
key = "Is expired"
addBooleanField(key, data.isExpired!!)
}

key = "Document code"
value = data.documentCode
addField(key, value)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
package com.acuant.sampleapp.backgroundtasks

import android.os.AsyncTask
import com.acuant.acuantcommon.model.Credential
import android.util.Base64
import org.json.JSONObject
import java.io.BufferedReader
import java.io.InputStreamReader
import java.io.OutputStreamWriter
import java.io.PrintWriter
import java.net.HttpURLConnection
import java.net.URL
import java.util.*
import javax.net.ssl.HttpsURLConnection

class AcuantTokenService(private val credential: Credential,
private val listener: AcuantTokenServiceListener) : AsyncTask<Any?, Any?, Any?>() {
private var responseText: String? = null
private var responseCode = -1
private var token = ""

override fun doInBackground(objects: Array<Any?>): Any? {
try {
val formatter = Formatter()
val urlEnd = "%s/oauth/token"
val urlString = formatter.format(
urlEnd, credential.endpoints.acasEndpointTrimmed).toString()
val url = URL(urlString)
val conn = url.openConnection() as HttpURLConnection
try {
conn.requestMethod = "POST"
val sub = if (credential.subscription != null && credential.subscription != "") "${credential.subscription};" else ""
val auth = Base64.encodeToString("$sub${credential.username}:${credential.password}".toByteArray(), Base64.NO_WRAP)
conn.setRequestProperty("Authorization", "Basic $auth")
conn.setRequestProperty("Accept", "application/json")
conn.addRequestProperty("Cache-Control", "no-cache")
conn.addRequestProperty("Cache-Control", "max-age=0")
conn.addRequestProperty("Content-Type", "application/json")
conn.useCaches = false
val webservicesTimeout = 60000
conn.readTimeout = webservicesTimeout
conn.connectTimeout = webservicesTimeout
val outputStream = conn.outputStream
val charset = "UTF-8"
PrintWriter(OutputStreamWriter(outputStream, charset), true)
val settingJsonObject = JSONObject()
settingJsonObject.put("grant_type", "client_credentials")
val dataBytes = settingJsonObject.toString().toByteArray()
outputStream.write(dataBytes, 0, dataBytes.size)
outputStream.flush()
responseCode = conn.responseCode
responseText = conn.responseMessage
val response: StringBuffer
if (responseCode == HttpsURLConnection.HTTP_OK) {
val `in` = BufferedReader(
InputStreamReader(conn.inputStream))
var output: String?
response = StringBuffer()
while (`in`.readLine().also { output = it } != null) {
response.append(output)
}
`in`.close()
responseText = response.toString()
val json = JSONObject(responseText)
if (json.has("access_token")) {
token = json.getString("access_token")
}
}
} catch (e: Exception) {
throw e
} finally {
conn.disconnect()
}
} catch (e: Exception) {
responseText = e.message
listener.onFail(responseCode)
}
return null
}

override fun onPostExecute(o: Any?) {
super.onPostExecute(o)
if (token != "")
listener.onSuccess(token)
else
listener.onFail(-2)
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package com.acuant.sampleapp.backgroundtasks

interface AcuantTokenServiceListener {
fun onSuccess(token: String)
fun onFail(responseCode: Int)
}
79 changes: 45 additions & 34 deletions app/src/main/res/values-es/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,49 +41,60 @@
<string name="hg_align_face_and_blink">Alinear la cara para comenzar</string>

<!-- acuantipliveness -->
<string name="iproov__ok">OK</string>
<string name="iproov__language_file">es</string>
<string name="iproov__app_name">iProov</string>
<string name="iproov__error">Error</string>
<string name="iproov__prompt_hold_still">Pon tu cara en el óvalo</string>
<string name="iproov__prompt_loading">por favor espera…</string>
<string name="iproov__prompt_loading_slow">Conectando, la red es lenta…</string>
<string name="iproov__prompt_connecting">Conectando…</string>
<string name="iproov__prompt_connecting_slow">Conectando, la red es lenta…</string>
<string name="iproov__prompt_tap_to_begin">Toca la pantalla para comenzar</string>
<string name="iproov__prompt_move_closer">Muévete mas cerca</string>
<string name="iproov__prompt_too_far">Muévete mas cerca</string>
<string name="iproov__prompt_too_bright">Ve a un lugar más sombrío</string>
<string name="iproov__prompt_too_backlit">Estás retroiluminado, gira ligeramente</string>
<string name="iproov__prompt_too_backlit_short">Estás retroiluminado, gira ligeramente</string>
<string name="iproov__prompt_beginning_in">Comenzando en…"</string>
<string name="iproov__too_many_faces">Demasiadas caras</string>
<string name="iproov__open_your_eyes">Abre tus ojos</string>
<string name="iproov__connected">Conectada</string>
<string name="iproov__empty_string"></string>
<string name="iproov__face_camera">Mira a la cámara directamente</string>
<string name="iproov__streamer_finished">Terminada</string>
<string name="iproov__hold_still">Quédate quieto</string>
<string name="iproov__progress_streaming">Transmisión…</string>
<string name="iproov__progress_streaming_slow">Streaming, la red es lenta…</string>
<string name="iproov__progress_processing">Tratamiento…</string>
<string name="iproov__dialog_instructions_title">Instrucciones iProov</string>
<string name="iproov__dialog_instructions_message">• Llena el óvalo con tu cara\n\n• Toca o espera la cuenta regresiva\n\n• Permanece quieto durante el parpadeo</string>
<string name="iproov__dialog_instructions_skip">No muestres esto otra vez</string>
<string name="iproov__agree">De acuerdo</string>
<string name="iproov__disagree">Discrepar</string>
<string name="iproov__dialog_privacy_disagree_title">Lo siento</string>
<string name="iproov__dialog_privacy_disagree_message">Debe aceptar la política de privacidad para usar iProov</string>
<string name="iproov__iproov_success">Has iProoved con éxito</string>
<string name="iproov__scanning">Exploración…</string>
<string name="iproov__network_problem_cant_connect">Problema de red, no se puede conectar</string>
<string name="iproov__lost_internet_link">Perdió la conexión a Internet, intente nuevamente</string>
<string name="iproov__cannot_stream_video">No se puede transmitir video, por favor intente nuevamente</string>
<string name="iproov__device_not_supported">Lo sentimos, tu dispositivo no es compatible actualmente</string>
<string name="iproov__username_already_enrolled">Este nombre de usuario ya ha sido inscrito</string>
<string name="iproov__unknown_identity">Este nombre de usuario no está inscrito, regístrese primero</string>
<string name="iproov__camera_permission_denied">Permiso de cámara denegado</string>
<string name="iproov__unknown_error">Error desconocido</string>
<string name="iproov__prompt_scanning">Exploración…</string>
<string name="iproov__starting_detector">Detector de arranque…</string>
<string name="iproov__ssl_exception">Excepción SSL</string>
<string name="iproov__too_close">Demasiado cerca</string>
<string name="iproov__progress_identifying_face">Cara identificativa…</string>
<string name="iproov__progress_confirming_identity">Confirmando identidad…</string>
<string name="iproov__progress_assessing_genuine_presence">Evaluar la presencia genuina…</string>
<string name="iproov__progress_loading">Loading…</string>
<string name="iproov__progress_creating_identity">Creando identidad…</string>
<string name="iproov__progress_finding_face">Encontrando cara…</string>
<string name="iproov__authenticate">Authenticate</string>
<string name="iproov__enrol">Enrol</string>
<string name="iproov__message_format">%1$s to %2$s</string>
<string name="iproov__prompt_too_close">Demasiado cerca</string>
<string name="iproov__failure_ambiguous_outcome">Lo siento, resultado ambiguo</string>
<string name="iproov__failure_network_problem">Lo sentimos, problema de red</string>
<string name="iproov__failure_motion_too_much_movement">Por favor no te muevas</string>
<string name="iproov__failure_lighting_flash_reflection_too_low">Luz ambiental demasiado fuerte o brillo de pantalla demasiado bajo</string>
<string name="iproov__failure_lighting_backlit">Fuerte fuente de luz detectada detrás de ti</string>
<string name="iproov__failure_lighting_too_dark">Tu entorno parece demasiado oscuro</string>
<string name="iproov__failure_lighting_face_too_bright">Demasiada luz detectada en tu cara</string>
<string name="iproov__failure_motion_too_much_mouth_movement">Por favor no hables</string>
<string name="iproov__failure_user_timeout">Lo sentimos, tu sesión ha expirado</string>
<string name="iproov__message_format_with_username">%1$s as %2$s to %3$s</string>
<string name="iproov__prompt_roll_too_high">Evita inclinar la cabeza</string>
<string name="iproov__prompt_roll_too_low">Evita inclinar la cabeza</string>
<string name="iproov__prompt_yaw_too_low">Gira ligeramente a la derecha</string>
<string name="iproov__prompt_yaw_too_high">Gire ligeramente a la izquierda</string>
<string name="iproov__prompt_pitch_too_high">Sostenga el dispositivo a la altura de los ojos</string>
<string name="iproov__prompt_pitch_too_low">Sostenga el dispositivo a la altura de los ojos</string>
<string name="iproov__prompt_get_ready">Prepararse…</string>
<string name="iproov__error_streaming">Streaming error</string>
<string name="iproov__error_encoder">Encoder error</string>
<string name="iproov__error_camera">Camera error</string>
<string name="iproov__error_camera_permission_denied">Camera permission denied</string>
<string name="iproov__error_server_abort">Server abort</string>
<string name="iproov__error_lighting_model">Lighting model error</string>
<string name="iproov__error_camera_permission_denied_message_android">You must allow access to your camera in order to iProov yourself</string>
<string name="iproov__error_flashmark">Malformed flashmark</string>
<string name="iproov__error_multi_screen_title">Application is in multi-window mode</string>
<string name="iproov__error_multi_screen_message">Application is in multi-window mode.\\nPlease make it full-screen and try again</string>
<string name="iproov__error_device_not_supported">Sorry, your device is currently not supported</string>
<string name="iproov__error_service_connection_lost">Connection to the Service has been lost</string>
<string name="iproov__error_face_detector">Face detector error</string>
<string name="iproov__error_capture_already_active">An existing capture is already in progress</string>

<!-- SampleApp -->
<string name="ok">OK</string>
Expand Down
Loading

0 comments on commit 800822f

Please sign in to comment.