Skip to content

Commit

Permalink
Merge pull request #349 from onewelcome/release/7.9.0
Browse files Browse the repository at this point in the history
Release/7.9.0
  • Loading branch information
PiotrKlis authored Jul 5, 2024
2 parents d46f731 + 0c5a988 commit 3cb7137
Show file tree
Hide file tree
Showing 12 changed files with 170 additions and 17 deletions.
14 changes: 7 additions & 7 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ allprojects {
Before the release please change the url below to: https://repo.onewelcome.com/artifactory/onegini-sdk
Please change it back to https://repo.onewelcome.com/artifactory/public after the release
*/
url "https://repo.onewelcome.com/artifactory/onegini-sdk"
url "https://repo.onewelcome.com/artifactory/public"
credentials {
username artifactory_user
password artifactory_password
Expand All @@ -54,7 +54,7 @@ android {
targetSdk 34
compileSdk 34
versionCode 25
versionName "7.8.0"
versionName "7.9.0"
multiDexEnabled true
}
buildTypes {
Expand All @@ -74,22 +74,22 @@ android {

dependencies {
// Onegini SDK
api('com.onegini.mobile.sdk.android:onegini-sdk:12.0.0@aar') {
api('com.onegini.mobile.sdk.android:onegini-sdk:12.1.0@aar') {
transitive = true
}
// Rest Client
implementation 'com.squareup.retrofit2:adapter-rxjava3:2.9.0'
implementation 'com.squareup.retrofit2:adapter-rxjava3:2.11.0'

// Google Support libraries for UI
implementation 'com.google.android.material:material:1.10.0'
implementation 'com.google.android.material:material:1.12.0'
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'

// QR code reader
implementation 'com.google.android.gms:play-services-vision:20.1.3'
// Google Play Services availability check
implementation 'com.google.android.gms:play-services-base:18.2.0'
implementation 'com.google.android.gms:play-services-base:18.5.0'
//Firebase Cloud Messaging (FCM)
implementation 'com.google.firebase:firebase-messaging:23.3.1'
implementation 'com.google.firebase:firebase-messaging:24.0.0'
// Support for multidex
implementation 'androidx.multidex:multidex:2.0.1'
// DI for views
Expand Down
4 changes: 4 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,10 @@
android:name=".view.activity.DevicesListActivity"
android:parentActivityName=".view.activity.DashboardActivity"
android:screenOrientation="portrait" />
<activity
android:name=".view.activity.IdTokenActivity"
android:parentActivityName=".view.activity.DashboardActivity"
android:screenOrientation="portrait" />
<activity
android:name=".view.activity.PendingPushMessagesActivity"
android:parentActivityName=".view.activity.DashboardActivity"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
package com.onegini.mobile.exampleapp;

public interface Constants {
String[] DEFAULT_SCOPES = { "read" };
String[] DEFAULT_SCOPES = { "read", "openid", "profile", "phone", "email" };
String NEW_LINE = "\n";
String FCM_SENDER_ID = "586427927998";
String EXTRA_COMMAND = "command";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ public class OneginiConfigModel implements OneginiClientConfigModel {
private final String appIdentifier = "ExampleApp";
private final String appPlatform = "android";
private final String redirectionUri = "oneginiexample://loginsuccess";
private final String appVersion = "7.8.0";
private final String appVersion = "7.9.0";
private final String baseURL = "https://mobile-security-proxy.onegini.com";
private final String resourceBaseURL = "https://mobile-security-proxy.onegini.com/resources/";
private final String keystoreHash = "2d55da375ab93ac43a12006da2e1e6dacb6afca1a5bb328294b841db08cef29d";
private final String keystoreHash = "03eca317c8d8f6987bebce7fe3da579706b011c2b06f774c0dedc926a0be502c";
private final int maxPinFailures = 3;
private final String serverPublicKey = "BA8E93F554BBBBC5ADAECB450C376FC9548A981652523B6359EEF38361553668";
private final String serverPublicKey = "8CBADF4C45B158A24C2CF1E14041C942BE2D39B7D317E07C9CB544F401DAE172";
private final String serverType = "access";
private final String serverVersion = "1.40.2";
private final String serverVersion = "1.49.0";

public String getAppIdentifier() {
return appIdentifier;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,12 @@ public void startDevicesActivity() {
startActivity(new Intent(this, DevicesListActivity.class));
}

@SuppressWarnings("unused")
@OnClick(R.id.button_id_token)
public void startIdTokenActivity() {
startActivity(new Intent(this, IdTokenActivity.class));
}

@SuppressWarnings("unused")
@OnClick(R.id.button_settings)
public void startSettingsActivity() {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
package com.onegini.mobile.exampleapp.view.activity;

import android.os.Bundle;
import android.util.Base64;
import android.widget.TextView;
import androidx.appcompat.app.ActionBar;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import butterknife.BindView;
import butterknife.ButterKnife;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonParser;
import com.onegini.mobile.exampleapp.OneginiSDK;
import com.onegini.mobile.exampleapp.R;

import java.nio.charset.StandardCharsets;

public class IdTokenActivity extends AppCompatActivity {

@SuppressWarnings({ "unused", "WeakerAccess" })
@BindView(R.id.toolbar)
Toolbar toolbar;

@SuppressWarnings({ "unused", "WeakerAccess" })
@BindView(R.id.text_id_token)
TextView idTokenTextView;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_id_token);
ButterKnife.bind(this);
setupActionBar();
showIdToken();
}

private void setupActionBar() {
setSupportActionBar(toolbar);

final ActionBar actionBar = getSupportActionBar();
if (actionBar != null) {
actionBar.setDisplayHomeAsUpEnabled(true);
actionBar.setLogo(R.mipmap.ic_launcher);
actionBar.setDisplayUseLogoEnabled(true);
actionBar.setDisplayShowTitleEnabled(false);
}
}

private void showIdToken() {
final String idToken = OneginiSDK.getOneginiClient(this).getUserClient().getIdToken();
final String content;
if (idToken != null) {
content = getFormattedUserInfo(idToken);
} else {
content = getString(R.string.id_token_null_description);
}
idTokenTextView.setText(content);
}

private String getFormattedUserInfo(final String idToken) {
final String jwtPayload = idToken.split("\\.")[1];
final String decodedJson = new String(Base64.decode(jwtPayload, Base64.DEFAULT), StandardCharsets.UTF_8);
return new GsonBuilder()
.setPrettyPrinting()
.create()
.toJson(new JsonParser().parse(decodedJson));
}
}
5 changes: 5 additions & 0 deletions app/src/main/res/layout/activity_dashboard.xml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@
android:text="@string/btn_your_devices"
android:layout_marginTop="32dp" />

<Button
android:id="@+id/button_id_token"
style="@style/ButtonStyle"
android:text="@string/btn_id_token" />

<Button
android:id="@+id/button_auth_with_otp"
style="@style/ButtonStyle"
Expand Down
67 changes: 67 additions & 0 deletions app/src/main/res/layout/activity_id_token.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<?xml version="1.0" encoding="utf-8"?><!--
Copyright (c) 2016-2018 Onegini B.V.
Licensed 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.
-->

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_height="match_parent"
android:layout_width="match_parent"
android:background="@color/background_for_activity_with_card_views"
android:orientation="vertical">

<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:contentInsetLeft="0dp"
app:contentInsetStart="0dp"
android:elevation="4dp"
android:theme="@style/ThemeOverlay.AppCompat.ActionBar"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light">

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="@style/TextAppearance.AppCompat.Widget.ActionBar.Title"
android:text="@string/id_token_title"
android:textColor="@color/white"
android:layout_gravity="center"
android:id="@+id/toolbar_title" />

</androidx.appcompat.widget.Toolbar>

<androidx.cardview.widget.CardView
android:id="@+id/card_view"
android:layout_margin="@dimen/activity_margin"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:cardCornerRadius="4dp">

<LinearLayout
android:layout_width="match_parent"
android:layout_margin="@dimen/activity_margin"
android:layout_height="wrap_content"
android:orientation="vertical">

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/text_id_token"
android:layout_margin="16dp" />
</LinearLayout>
</androidx.cardview.widget.CardView>

</LinearLayout>
Binary file modified app/src/main/res/raw/keystore.bks
Binary file not shown.
3 changes: 3 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
<string name="btn_logout_label">Logout</string>
<string name="btn_deregister_user_label">Deregister user</string>
<string name="btn_your_devices">Your devices</string>
<string name="btn_id_token">ID Token</string>
<string name="confirm">Confirm</string>
<string name="confirm_with_fingerprint">Confirm with fingerprint</string>
<string name="scan_fingerprint">Touch sensor</string>
Expand Down Expand Up @@ -107,4 +108,6 @@
<string name="biometric_authentication_subtitle">Authenticate using biometrics</string>
<string name="biometric_authentication_cancel">Cancel</string>
<string name="confirm_with_biometrics">Confirm with biometrics</string>
<string name="id_token_title">ID Token</string>
<string name="id_token_null_description">There\'s no ID token. Please make sure to use openid scope during registration.</string>
</resources>
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ buildscript {
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:8.2.0'
classpath 'com.google.gms:google-services:4.3.15'
classpath 'com.google.gms:google-services:4.4.1'
classpath 'com.android.tools.build:gradle:8.3.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
Expand Down
6 changes: 3 additions & 3 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Wed Jan 12 11:35:33 CET 2022
#Fri Jul 05 14:54:05 CEST 2024
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

0 comments on commit 3cb7137

Please sign in to comment.