diff --git a/.idea/compiler.xml b/.idea/compiler.xml index 61a9130c..fb7f4a8a 100644 --- a/.idea/compiler.xml +++ b/.idea/compiler.xml @@ -1,6 +1,6 @@ - + \ No newline at end of file diff --git a/app/build.gradle b/app/build.gradle index 7618cc10..bf777dad 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -8,12 +8,12 @@ apply plugin: 'com.google.firebase.crashlytics' android { - compileSdkVersion 30 + compileSdkVersion 31 defaultConfig { applicationId "com.remit.jmecustomer" - minSdkVersion 19 - targetSdkVersion 30 - versionCode 9 + minSdkVersion 24 + targetSdkVersion 31 + versionCode 10 versionName "0.8" multiDexEnabled true vectorDrawables.useSupportLibrary = true @@ -25,6 +25,24 @@ android { } packagingOptions { exclude 'META-INF/rxjava.properties' + exclude 'lib/x86_64/libopencv_java4.so' + exclude 'lib/x86_64/libtess.so' + exclude 'lib/x86_64/libc++_shared.so' + exclude 'lib/x86_64/libface_detector_v2_jni.so' + exclude 'lib/x86/libopencv_java4.so' + exclude 'lib/x86/libface_detector_v2_jni.so' + exclude 'lib/x86/libtess.so' + exclude 'lib/x86/libc++_shared.so' + exclude 'lib/arm64-v8a/libopencv_java4.so' + exclude 'lib/arm64-v8a/libface_detector_v2_jni.so' + exclude 'lib/arm64-v8a/libtess.so' + exclude 'lib/arm64-v8a/libc++_shared.so' + exclude 'lib/armeabi-v7a/libopencv_java4.so' + exclude 'lib/armeabi-v7a/libface_detector_v2_jni.so' + exclude 'lib/armeabi-v7a/libtess.so' + exclude 'lib/armeabi-v7a/libc++_shared.so' +// exclude 'assets/models/fssd_100_8bit_gray_v1.tflite' +// exclude 'assets/models/fssd_100_8bit_v1.tflite' } buildFeatures { @@ -57,7 +75,7 @@ android { debuggable false minifyEnabled true shrinkResources true - useProguard true // obfuscate + // obfuscate proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' //proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' signingConfig signingConfigs.release @@ -110,6 +128,7 @@ android { debuggable true minifyEnabled false shrinkResources false + //proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.txt' } } compileOptions { @@ -125,6 +144,9 @@ android { enableSplit = false } } + dataBinding { + enabled = true + } } @@ -146,6 +168,7 @@ dependencies { implementation 'com.github.bumptech.glide:glide:4.9.0' implementation 'de.hdodenhof:circleimageview:2.2.0' implementation 'com.jakewharton:butterknife:10.2.3' + implementation 'com.android.volley:volley:1.2.1' annotationProcessor 'com.jakewharton:butterknife-compiler:10.2.3' implementation 'id.zelory:compressor:2.1.0' @@ -194,6 +217,8 @@ dependencies { implementation 'androidx.biometric:biometric:1.1.0' + implementation 'io.trustdock.sdk:verification-sandbox:2.6.7' + @@ -202,3 +227,16 @@ dependencies { debugImplementation 'com.ashokvarma.android:gander-imdb:3.1.0' releaseImplementation 'com.ashokvarma.android:gander-no-op:3.1.0' } + +allprojects { + repositories { + maven { + url "https://native-app-sdk-repository.test.trustdock.io/android/release/content/repositories" + credentials { + username = "japanremit-1039" + password = "sHRf5Sf7S3r5Q4Hz" + } + } + maven { url 'https://raw.githubusercontent.com/iProov/android/master/maven/' } + } +} \ No newline at end of file diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 770087c8..050e36e1 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -13,6 +13,7 @@ + + tools:replace="android:allowBackup,android:supportsRtl" + > + android:windowSoftInputMode="stateAlwaysHidden" + android:exported="false"> @@ -73,11 +76,17 @@ android:screenOrientation="portrait" android:theme="@style/AppTheme.NoActionBar" android:windowSoftInputMode="stateAlwaysHidden" /> + + android:windowSoftInputMode="stateAlwaysHidden" + android:exported="false"> @@ -179,7 +188,8 @@ android:name="com.remit.jmecustomer.features.splashscreen.view.SplashScreen" android:screenOrientation="portrait" android:theme="@style/AppTheme.Launcher" - android:windowSoftInputMode="adjustResize|stateAlwaysHidden"> + android:windowSoftInputMode="adjustResize|stateAlwaysHidden" + android:exported="true"> @@ -216,7 +226,8 @@ android:name="com.remit.jmecustomer.features.sendmoney.view.SendMoneyV2Activity" android:screenOrientation="portrait" android:theme="@style/AppTheme.NoActionBar" - android:windowSoftInputMode="stateAlwaysHidden"> + android:windowSoftInputMode="stateAlwaysHidden" + android:exported="false"> @@ -255,7 +266,8 @@ android:name="com.remit.jmecustomer.features.home.view.HomeActivityV2" android:screenOrientation="portrait" android:theme="@style/AppTheme.NoActionBar" - android:windowSoftInputMode="stateAlwaysHidden"> + android:windowSoftInputMode="stateAlwaysHidden" + android:exported="false"> @@ -298,7 +310,8 @@ android:name="com.remit.jmecustomer.features.registerv2.newcustomer.view.NewRegisterV2Activity" android:screenOrientation="portrait" android:theme="@style/AppTheme.NoActionBar" - android:windowSoftInputMode="stateAlwaysHidden"> + android:windowSoftInputMode="stateAlwaysHidden" + android:exported="true"> @@ -325,7 +338,8 @@ android:name="com.remit.jmecustomer.features.depositinfo.view.DepositInfo" android:screenOrientation="portrait" android:theme="@style/AppTheme.NoActionBar" - android:windowSoftInputMode="stateAlwaysHidden"> + android:windowSoftInputMode="stateAlwaysHidden" + android:exported="false"> @@ -335,7 +349,8 @@ android:name="com.remit.jmecustomer.features.mynotifications.view.MyNotificationActivity" android:screenOrientation="portrait" android:theme="@style/AppTheme.NoActionBar" - android:windowSoftInputMode="stateAlwaysHidden"> + android:windowSoftInputMode="stateAlwaysHidden" + android:exported="false"> diff --git a/app/src/main/java/com/remit/jmecustomer/features/home/HomeParentViewContractV2.java b/app/src/main/java/com/remit/jmecustomer/features/home/HomeParentViewContractV2.java index 861c0eb2..0c9b0cdc 100644 --- a/app/src/main/java/com/remit/jmecustomer/features/home/HomeParentViewContractV2.java +++ b/app/src/main/java/com/remit/jmecustomer/features/home/HomeParentViewContractV2.java @@ -38,4 +38,6 @@ public interface HomeParentViewContractV2 { void showBankDeposit(); void showCashPickupRedeem(); + + void showTrustDock(); } diff --git a/app/src/main/java/com/remit/jmecustomer/features/home/view/HomeActivityV2.java b/app/src/main/java/com/remit/jmecustomer/features/home/view/HomeActivityV2.java index 433fb73f..54e4a5b4 100644 --- a/app/src/main/java/com/remit/jmecustomer/features/home/view/HomeActivityV2.java +++ b/app/src/main/java/com/remit/jmecustomer/features/home/view/HomeActivityV2.java @@ -55,6 +55,7 @@ import com.remit.jmecustomer.features.sendmoney.view.verification.TermsAndCondit import com.remit.jmecustomer.features.settings.view.FingerprintEnablePromptActivity; import com.remit.jmecustomer.features.settings.view.SettingsView; import com.remit.jmecustomer.features.transactionhistory.view.RemitTransactionHistoryActivity; +import com.remit.jmecustomer.features.trustdock.view.TrustDockActivity; import com.remit.jmecustomer.features.userprofile.view.ProfileActivity; import com.remit.jmecustomer.features.walletstatement.view.WalletStatementV2Activity; import com.remit.jmecustomer.features.webbrowser.WebBrowserV2Activity; @@ -467,6 +468,17 @@ public class HomeActivityV2 extends BaseActivity implements HomeParentViewContra showPopUpMessage(unverifiedMessage, CustomAlertDialog.AlertType.ALERT, null); } + @Override + public void showTrustDock() { + if (isNotificaitonViewActive()) + return; + String unverifiedMessage = viewModel.checkIfUserVerified(); + if (unverifiedMessage == null) + startActivity(new Intent(getApplicationContext(), TrustDockActivity.class)); + else + showPopUpMessage(unverifiedMessage, CustomAlertDialog.AlertType.ALERT, null); + } + @Override public void showAutoDebitListingView() { } diff --git a/app/src/main/java/com/remit/jmecustomer/features/home/view/HomeFragmentV2.java b/app/src/main/java/com/remit/jmecustomer/features/home/view/HomeFragmentV2.java index fd4351f9..d4e8159a 100644 --- a/app/src/main/java/com/remit/jmecustomer/features/home/view/HomeFragmentV2.java +++ b/app/src/main/java/com/remit/jmecustomer/features/home/view/HomeFragmentV2.java @@ -173,6 +173,7 @@ public class HomeFragmentV2 extends BaseFragment implements menuList.add(new MenuItem(getString(R.string.notice_text), R.drawable.icv_notice, 7)); // menuList.add(new MenuItem(getString(R.string.recipient_text), R.drawable.icv_receipient, 8)); menuList.add(new MenuItem(getString(R.string.renewId_text), R.drawable.icv_renew_id, 9)); + menuList.add(new MenuItem("TrustDock", R.drawable.icv_renew_id, 10)); return menuList; } @@ -221,6 +222,10 @@ public class HomeFragmentV2 extends BaseFragment implements parentViewContractV2.showRenewIdScreen(); break; + case 10: + parentViewContractV2.showTrustDock(); + break; + } } diff --git a/app/src/main/java/com/remit/jmecustomer/features/sendmoney/model/RewardsPointDTO.java b/app/src/main/java/com/remit/jmecustomer/features/sendmoney/model/RewardsPointDTO.java index 45cc0954..f801fc60 100644 --- a/app/src/main/java/com/remit/jmecustomer/features/sendmoney/model/RewardsPointDTO.java +++ b/app/src/main/java/com/remit/jmecustomer/features/sendmoney/model/RewardsPointDTO.java @@ -12,6 +12,10 @@ public class RewardsPointDTO { @Expose private String Point; + @SerializedName("RewardMessage") + @Expose + private String RewardMessage; + public String getShowRewardPoint() { return ShowRewardPoint; } @@ -27,4 +31,12 @@ public class RewardsPointDTO { public void setPoint(String point) { this.Point = point; } + + public String getRewardMessage() { + return RewardMessage; + } + + public void setRewardMessage(String rewardMessage) { + this.RewardMessage = rewardMessage; + } } diff --git a/app/src/main/java/com/remit/jmecustomer/features/sendmoney/view/amountdetail/AmountDetailSendMoneyFragment.java b/app/src/main/java/com/remit/jmecustomer/features/sendmoney/view/amountdetail/AmountDetailSendMoneyFragment.java index 84ef6d5a..d1040f32 100644 --- a/app/src/main/java/com/remit/jmecustomer/features/sendmoney/view/amountdetail/AmountDetailSendMoneyFragment.java +++ b/app/src/main/java/com/remit/jmecustomer/features/sendmoney/view/amountdetail/AmountDetailSendMoneyFragment.java @@ -590,7 +590,7 @@ public class AmountDetailSendMoneyFragment extends BaseFragment implements View. if (rewardsPointDTO.getShowRewardPoint().equalsIgnoreCase("y")) { rewardsPointsContainer.setVisibility(View.VISIBLE); //pointsAvailableText.setText("You have " + rewardsPointDTO.getPoint() + " reward points available"); - pointsAvailableText.setText(rewardsPointDTO.getPoint()); + pointsAvailableText.setText(rewardsPointDTO.getRewardMessage()); this.rewardPoint = rewardsPointDTO.getPoint(); } } diff --git a/app/src/main/java/com/remit/jmecustomer/features/trustdock/view/TrustDockActivity.java b/app/src/main/java/com/remit/jmecustomer/features/trustdock/view/TrustDockActivity.java new file mode 100644 index 00000000..0a9c9220 --- /dev/null +++ b/app/src/main/java/com/remit/jmecustomer/features/trustdock/view/TrustDockActivity.java @@ -0,0 +1,177 @@ +package com.remit.jmecustomer.features.trustdock.view; + +import android.content.Context; +import android.os.Bundle; +import android.util.Log; +import android.view.View; +import android.widget.Button; + +import com.android.volley.AuthFailureError; +import com.android.volley.RequestQueue; +import com.android.volley.Request; +import com.android.volley.Response; +import com.android.volley.VolleyError; +import com.android.volley.toolbox.JsonObjectRequest; +import com.android.volley.toolbox.StringRequest; +import com.android.volley.toolbox.Volley; +import com.remit.jmecustomer.R; +import com.remit.jmecustomer.base.BaseActivity; + +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import org.json.JSONArray; +import org.json.JSONObject; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import io.trustdock.sdk.TrustdockPlan; +import io.trustdock.sdk.TrustdockVerificationException; +import io.trustdock.sdk.TrustdockVerificationParams; +import io.trustdock.sdk.TrustdockVerificationSDK; +import kotlin.collections.CollectionsKt; +import kotlin.jvm.internal.DefaultConstructorMarker; +import kotlin.jvm.internal.Intrinsics; + +public class TrustDockActivity extends BaseActivity { + + protected void onCreate(@Nullable Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + this.setContentView(R.layout.activity_trustdock); + TrustdockVerificationSDK.Companion.init(); + TrustdockVerificationSDK.Listener listener = new TrustdockVerificationSDK.Listener() { + public void onDocumentSubmitted() { + } + + public void onCompleted() { + } + + public void onCanceled(@NotNull TrustdockVerificationException e) { + Intrinsics.checkNotNullParameter(e, "e"); + } + }; + TrustdockVerificationSDK.Companion.registerListener((TrustdockVerificationSDK.Listener) listener); + String publicId = "c471d877-c4e4-4805-9332-7f6c3a1881d8"; + String nativeAppSdkToken = "rbTme8F4whfAZBuSQcN5gUXr"; + +// List planPPA = CollectionsKt.listOf(new TrustdockPlan("5ba5a065-dac1-4509-a574-0d4deef19720", null, null)); +// final TrustdockVerificationParams paramsPPA = new TrustdockVerificationParams(publicId, nativeAppSdkToken, planPPA); +// +// Button startButtonPPA = (Button) this.findViewById(R.id.startButtonPPA); +// startButtonPPA.setOnClickListener((View.OnClickListener) (new View.OnClickListener() { +// public final void onClick(View it) { +// TrustdockVerificationSDK.Companion.start((Context) getContext(), paramsPPA); +// } +// })); +// List planRC = CollectionsKt.listOf(new TrustdockPlan("b1da18ee-bean-42f0-b7f6-0d375e1f505d", (String) null, (List) null)); +// final TrustdockVerificationParams paramsRC = new TrustdockVerificationParams(publicId, nativeAppSdkToken, planRC); +// +// Button startButtonRC = (Button) this.findViewById(R.id.startButtonRC); +// ; +// startButtonRC.setOnClickListener((View.OnClickListener) (new View.OnClickListener() { +// public final void onClick(View it) { +// TrustdockVerificationSDK.Companion.start((Context) getContext(), paramsRC); +// } +// })); +// List planDL = CollectionsKt.listOf(new TrustdockPlan[]{new TrustdockPlan("e103a0db-ae3c-4eda-8dcb-6fff06cdfcc9", (String) null, (List) null), new TrustdockPlan("ee46f7fd-3988-49cd-a972-1056e498302f", "e103a0db-ae3c-4eda-8dcb-6fff06cdfcc9", (List) null)}); +// final TrustdockVerificationParams paramsDL = new TrustdockVerificationParams(publicId, nativeAppSdkToken, planDL); +// +// Button startButtonDL = (Button) this.findViewById(R.id.startButtonDL); +// startButtonDL.setOnClickListener((View.OnClickListener) (new View.OnClickListener() { +// public final void onClick(View it) { +// TrustdockVerificationSDK.Companion.start((Context) getContext(), paramsDL); +// } +// })); +// List planeKYC = CollectionsKt.listOf(new TrustdockPlan("ee46f7fd-3988-49cd-a972-1056e498302f", (String) null, (List) null)); +// final TrustdockVerificationParams paramsKYC = new TrustdockVerificationParams(publicId, nativeAppSdkToken, planeKYC); +// +// Button startButtonEKYC = (Button) this.findViewById(R.id.startButtonEKYC); +// startButtonEKYC.setOnClickListener((View.OnClickListener) (new View.OnClickListener() { +// public final void onClick(View it) { +// TrustdockVerificationSDK.Companion.start((Context) getContext(), paramsKYC); +// } +// })); +// List planSelfie = CollectionsKt.listOf(new TrustdockPlan[]{new TrustdockPlan("e103a0db-ae3c-4eda-8dcb-6fff06cdfcc9", (String) null, (List) null), new TrustdockPlan("ee46f7fd-3988-49cd-a972-1056e498302f", "e103a0db-ae3c-4eda-8dcb-6fff06cdfcc9", (List) null)}); +// final TrustdockVerificationParams paramsSelfie = new TrustdockVerificationParams(publicId, nativeAppSdkToken, planSelfie); +// +// Button startButtonSelfie = (Button) this.findViewById(R.id.startButtonSelfie); +// startButtonSelfie.setOnClickListener((View.OnClickListener) (new View.OnClickListener() { +// public final void onClick(View it) { +// TrustdockVerificationSDK.Companion.start((Context) getContext(), paramsSelfie); +// } +// })); + List planSelfie2 = CollectionsKt.listOf(new TrustdockPlan[]{new TrustdockPlan("b1da18ee-fabe-42f0-b7f6-0d375e1f505d", (String) null, (List) null), new TrustdockPlan("ee46f7fd-3988-49cd-a972-1056e498302f", "b1da18ee-fabe-42f0-b7f6-0d375e1f505d", (List) null)}); + final TrustdockVerificationParams paramsSelfie2 = new TrustdockVerificationParams(publicId, nativeAppSdkToken, planSelfie2); + + Button startButtonSelfie2 = (Button) this.findViewById(R.id.startButtonSelfie2); + startButtonSelfie2.setOnClickListener((View.OnClickListener) (new View.OnClickListener() { + public final void onClick(View it) { + //TrustdockVerificationSDK.Companion.start((Context) getContext(), paramsSelfie2); + requestWithSomeHttpHeaders(planSelfie2); + } + })); + List planE = CollectionsKt.listOf(new TrustdockPlan("f8d1f271-7c95-43bf-bdf8-f84ebe96671d", (String) null, (List) null)); + final TrustdockVerificationParams paramsE = new TrustdockVerificationParams(publicId, nativeAppSdkToken, planE); + + Button startButtonE = (Button) this.findViewById(R.id.startButtonE); + startButtonE.setOnClickListener((View.OnClickListener) (new View.OnClickListener() { + public final void onClick(View it) { + //TrustdockVerificationSDK.Companion.start((Context) getContext(), paramsE); + requestWithSomeHttpHeaders(planE); + } + })); + } + + + protected void onDestroy() { + TrustdockVerificationSDK.Companion.unregisterListener(); + super.onDestroy(); + } + + + + + public void requestWithSomeHttpHeaders(List plan) { + RequestQueue queue = Volley.newRequestQueue(this); + String url = "https://api.test.trustdock.io/v2/verifications?Authorization=rbTme8F4whfAZBuSQcN5gUXr"; + JsonObjectRequest getRequest = new JsonObjectRequest(Request.Method.POST, url,null, + new Response.Listener() + { + @Override + public void onResponse(JSONObject response) { + try { + String publicKey = response.getString("public_id"); + //setupPlans() + String nativeAppSdkToken = "rbTme8F4whfAZBuSQcN5gUXr"; + TrustdockVerificationParams param = new TrustdockVerificationParams( + publicKey, + nativeAppSdkToken, + plan + ); + TrustdockVerificationSDK.Companion.start((Context) getContext(), param); + } catch (Exception ex) { + Log.d("ERROR","error => "+ex.toString()); + } + } + }, + new Response.ErrorListener() + { + @Override + public void onErrorResponse(VolleyError error) { + // TODO Auto-generated method stub + Log.d("ERROR","error => "+error.toString()); + } + } + ) { + @Override + public Map getHeaders() throws AuthFailureError { + Map params = new HashMap(); + params.put("Authorization", "Bearer SC5ra2f1GDqMaAVZX289bpuH"); + return params; + } + }; + queue.add(getRequest); + + } +} diff --git a/app/src/main/java/com/remit/jmecustomer/utils/https/HttpClientV2.java b/app/src/main/java/com/remit/jmecustomer/utils/https/HttpClientV2.java index 85d6f9eb..93a875aa 100644 --- a/app/src/main/java/com/remit/jmecustomer/utils/https/HttpClientV2.java +++ b/app/src/main/java/com/remit/jmecustomer/utils/https/HttpClientV2.java @@ -54,7 +54,7 @@ public class HttpClientV2 { if (BuildConfig.DEBUG) { HttpLoggingInterceptor.Logger fileLogger = s -> { - Platform.get().log(INFO, s, null); + //Platform.get().log(INFO, s, null); }; HttpLoggingInterceptor logging = new HttpLoggingInterceptor(fileLogger); logging.setLevel(HttpLoggingInterceptor.Level.BODY); diff --git a/app/src/main/res/drawable/circular_blue_border.xml b/app/src/main/res/drawable/circular_blue_border.xml new file mode 100644 index 00000000..a5502935 --- /dev/null +++ b/app/src/main/res/drawable/circular_blue_border.xml @@ -0,0 +1,6 @@ + + + + + diff --git a/app/src/main/res/drawable/circular_red_border.xml b/app/src/main/res/drawable/circular_red_border.xml new file mode 100644 index 00000000..8b9d6e4b --- /dev/null +++ b/app/src/main/res/drawable/circular_red_border.xml @@ -0,0 +1,6 @@ + + + + + diff --git a/app/src/main/res/layout/activity_home_v2.xml b/app/src/main/res/layout/activity_home_v2.xml index 11e804ff..a74412da 100644 --- a/app/src/main/res/layout/activity_home_v2.xml +++ b/app/src/main/res/layout/activity_home_v2.xml @@ -59,13 +59,14 @@ android:layout_width="@dimen/_15sdp" android:layout_height="@dimen/_15sdp" android:layout_gravity="center" - android:layout_marginLeft="@dimen/_15sdp" - android:layout_marginTop="3dp" - android:background="@drawable/circular_white_bg" + android:layout_marginLeft="@dimen/_13sdp" + android:layout_marginTop="4dp" + android:background="@drawable/circular_blue_border" android:gravity="center" android:textColor="@color/colorAccent" android:textSize="@dimen/_10ssp" - android:visibility="visible" /> + android:visibility="visible" + app:txtfontName="@string/semibold" /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +