Skip to content

Commit

Permalink
Merge pull request #1367 from microsoft/develop
Browse files Browse the repository at this point in the history
Version 3.0.0
  • Loading branch information
Cloudwu1 authored Feb 14, 2020
2 parents 7cd29d7 + 8b10e57 commit 0bb44ae
Show file tree
Hide file tree
Showing 161 changed files with 2,622 additions and 17,367 deletions.
28 changes: 28 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,33 @@
# App Center SDK for Android Change Log

## Version 3.0.0

### App Center Auth

App Center Auth is [retired](https://aka.ms/MBaaS-retirement-blog-post) and has been removed from the SDK.

### App Center Data

App Center Data is [retired](https://aka.ms/MBaaS-retirement-blog-post) and has been removed from the SDK.

### App Center

* **[Fix]** Fix infinite recursion when handling encryption errors.

### App Center Crashes

* **[Fix]** Fix incorrect app version when an NDK crash is sent after updating the app.
* **[Behavior change]** Change the path to the minidump directory to use a subfolder in which the current contextual data (device information, etc.) is saved along with the .dmp file.

### App Center Distribute

* **[Feature]** Add `setUpdateTrack`(and `getUpdateTrack`) method to be able to explicitly set either `UpdateTrack.PRIVATE` or `UpdateTrack.PUBLIC` update track. By default, a public distribution group is used. **Breaking change**: To allow users to access releases of private groups you now need to migrate your application to call `Distribute.setUpdateTrack(UpdateTrack.PRIVATE)` before the SDK start. Please read the documentation for more details.
* **[Fix]** Avoid opening browser to check for sign-in information after receiving an SSL error while checking for app updates (which often happens when using a public WIFI).
* **[Fix]** When in-app update permissions become invalid and need to open browser again, updates are no longer postponed after sign-in (if user previously selected the action to postpone for a day).
* **[Fix]** Fix a possible deadlock when activity resumes during background operation for some `Distribute` public APIs like `Distribute.isEnabled()`.

___

## Version 2.5.1

### App Center Crashes
Expand Down
6 changes: 1 addition & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![Coverage Status](https://coveralls.io/repos/github/microsoft/appcenter-sdk-android/badge.svg?branch=develop)](https://coveralls.io/github/microsoft/appcenter-sdk-android?branch=develop)
[![Coverage Status](https://coveralls.io/repos/github/Microsoft/AppCenter-SDK-Android/badge.svg?branch=develop)](https://coveralls.io/github/Microsoft/AppCenter-SDK-Android?branch=develop)
[![GitHub Release](https://img.shields.io/github/release/microsoft/appcenter-sdk-android.svg)](https://github.com/microsoft/appcenter-sdk-android/releases/latest)
[![Bintray](https://api.bintray.com/packages/vsappcenter/appcenter/appcenter/images/download.svg)](https://bintray.com/vsappcenter/appcenter)
[![license](https://img.shields.io/badge/license-MIT%20License-00AAAA.svg)](https://github.com/microsoft/appcenter-sdk-android/blob/master/license.txt)
Expand All @@ -18,10 +18,6 @@ The App Center SDK uses a modular architecture so you can use any or all of the

4. **App Center Push**: App Center Push enables you to send push notifications to users of your app from the App Center portal. To do that, the App Center SDK and portal integrate with [Firebase Cloud Messaging](https://firebase.google.com/docs/cloud-messaging/). You can also segment your user base based on a set of properties and send them targeted notifications.

5. **App Center Auth**: App Center Auth is a cloud-based identity management service that enables developers to authenticate application users and manage user identities. The service integrates with other parts of App Center, enabling developers to leverage the user identity to view user data in other services and even send push notifications to users instead of individual devices.

6. **App Center Data**: The App Center Data service provides functionality enabling developers to persist app data in the cloud in both online and offline scenarios. This enables you to store and manage both user-specific data as well as data shared between users and across platforms.

## 1. Get started
It is super easy to use App Center. Have a look at our [get started documentation](https://docs.microsoft.com/en-us/appcenter/sdk/getting-started/android) and onboard your app within minutes. Our [detailed documentation](https://docs.microsoft.com/en-us/appcenter/sdk/) is available as well.

Expand Down
5 changes: 0 additions & 5 deletions apps/sasquatch/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -70,17 +70,12 @@ dependencies {
projectDependencyImplementation project(':sdk:appcenter-crashes')
projectDependencyImplementation project(':sdk:appcenter-distribute')
projectDependencyImplementation project(':sdk:appcenter-push')
projectDependencyImplementation project(':sdk:appcenter-rum')
projectDependencyImplementation project(':sdk:appcenter-auth')
projectDependencyImplementation project(':sdk:appcenter-data')

def appCenterSdkVersion = "2.5.1"
jcenterDependencyImplementation "com.microsoft.appcenter:appcenter-analytics:${appCenterSdkVersion}"
jcenterDependencyImplementation "com.microsoft.appcenter:appcenter-crashes:${appCenterSdkVersion}"
jcenterDependencyImplementation "com.microsoft.appcenter:appcenter-distribute:${appCenterSdkVersion}"
jcenterDependencyImplementation "com.microsoft.appcenter:appcenter-push:${appCenterSdkVersion}"
jcenterDependencyImplementation "com.microsoft.appcenter:appcenter-auth:${appCenterSdkVersion}"
jcenterDependencyImplementation "com.microsoft.appcenter:appcenter-data:${appCenterSdkVersion}"

androidTestImplementation 'com.android.support.test:rules:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@
import static com.microsoft.appcenter.http.HttpUtils.createHttpClient;
import static com.microsoft.appcenter.sasquatch.activities.MainActivity.LOG_TAG;

/**
* TODO during release, delete this version of this file and move projectDependency one to main source folder.
*/
public class MSALoginActivity extends AppCompatActivity {

private static final String URL_PREFIX = "https://login.live.com/oauth20_";
Expand Down Expand Up @@ -318,7 +321,7 @@ public void onBeforeCalling(URL url, Map<String, String> headers) {
new ServiceCallback() {

@Override
public void onCallSucceeded(String payload, @SuppressWarnings("unused") Map<String, String> headers) {
public void onCallSucceeded(String payload, Map<String, String> responseHeaders) {
try {
JSONObject response = new JSONObject(payload);
String userId = response.getString(USER_ID);
Expand Down Expand Up @@ -362,7 +365,7 @@ public void onBeforeCalling(URL url, Map<String, String> headers) {
new ServiceCallback() {

@Override
public void onCallSucceeded(String payload, @SuppressWarnings("unused") Map<String, String> headers) {
public void onCallSucceeded(String payload, Map<String, String> responseHeaders) {
try {
JSONObject response = new JSONObject(payload);
String accessToken = response.getString("access_token");
Expand Down
32 changes: 0 additions & 32 deletions apps/sasquatch/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
android:theme="@style/AppTheme"
tools:ignore="AllowBackup,GoogleAppIndexingWarning,UnpackedNativeCode"
tools:targetApi="n">
<activity android:name=".activities.UserInformationActivity" />
<activity
android:name=".activities.MainActivity"
android:launchMode="singleTop">
Expand Down Expand Up @@ -66,40 +65,9 @@
<activity
android:name=".activities.AuthenticationProviderActivity"
android:label="@string/title_auth" />
<activity
android:name=".activities.DataActivity"
android:label="@string/title_data" />
<activity
android:name=".activities.NewUserDocumentActivity"
android:label="@string/new_user_document_title" />
<activity
android:name=".activities.DocumentDetailActivity"
android:label="@string/app_document_detail_title" />
<activity
android:name=".activities.MSALoginActivity"
android:label="@string/msa_title" />
<activity android:name="com.microsoft.identity.client.BrowserTabActivity">
<intent-filter>
<action android:name="android.intent.action.VIEW" />

<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />

<data
android:host="auth"
android:scheme="@string/msal_redirect_scheme" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />

<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />

<data
android:host="auth"
android:scheme="@string/msal_redirect_scheme_aad" />
</intent-filter>
</activity>

<!-- Set default notification icon and color. -->
<meta-data
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,41 +5,25 @@

package com.microsoft.appcenter.sasquatch.activities;

import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.View;
import android.widget.ListView;

import com.microsoft.appcenter.analytics.AuthenticationProvider;
import com.microsoft.appcenter.auth.Auth;
import com.microsoft.appcenter.auth.SignInResult;
import com.microsoft.appcenter.auth.UserInformation;
import com.microsoft.appcenter.sasquatch.R;
import com.microsoft.appcenter.sasquatch.features.TestFeatures;
import com.microsoft.appcenter.sasquatch.features.TestFeaturesListAdapter;
import com.microsoft.appcenter.utils.async.AppCenterConsumer;

import java.util.ArrayList;
import java.util.List;

import static com.microsoft.appcenter.sasquatch.SasquatchConstants.ACCOUNT_ID;
import static com.microsoft.appcenter.sasquatch.SasquatchConstants.USER_INFORMATION_ACCESS_TOKEN;
import static com.microsoft.appcenter.sasquatch.SasquatchConstants.USER_INFORMATION_ID;
import static com.microsoft.appcenter.sasquatch.SasquatchConstants.USER_INFORMATION_ID_TOKEN;
import static com.microsoft.appcenter.sasquatch.activities.MainActivity.LOG_TAG;

public class AuthenticationProviderActivity extends AppCompatActivity {

private boolean mUserLeaving;

private static UserInformation sUserInformation;

private TestFeatures.TestFeature mAuthInfoTestFeature;

private List<TestFeatures.TestFeatureModel> mFeatureList;
Expand Down Expand Up @@ -68,110 +52,9 @@ public void onClick(View v) {
startMSALoginActivity(AuthenticationProvider.Type.MSA_DELEGATE);
}
}));
mFeatureList.add(new TestFeatures.TestFeatureTitle(R.string.auth_title));
mFeatureList.add(new TestFeatures.TestFeature(R.string.sign_in_title, R.string.sign_in_description, new View.OnClickListener() {

@Override
public void onClick(View v) {
Auth.signIn().thenAccept(new AppCenterConsumer<SignInResult>() {

@Override
public void accept(SignInResult signInResult) {
try {
Exception exception = signInResult.getException();
if (exception != null) {
throw exception;
}
sUserInformation = signInResult.getUserInformation();
loadAuthStatus(false);
String accountId = sUserInformation.getAccountId();
SharedPreferences.Editor edit = MainActivity.sSharedPreferences.edit();
edit.putString("accountId", accountId);
edit.apply();
Log.i(LOG_TAG, "Auth.signIn succeeded, accountId=" + accountId);
} catch (Exception e) {
sUserInformation = null;
loadAuthStatus(false);
Log.e(LOG_TAG, "Auth.signIn failed", e);
}
}
});
}
}));
mFeatureList.add(new TestFeatures.TestFeature(R.string.sign_out_title, R.string.sign_out_description, new View.OnClickListener() {

@Override
public void onClick(View v) {
try {
Auth.signOut();
sUserInformation = null;
loadAuthStatus(false);
SharedPreferences.Editor edit = MainActivity.sSharedPreferences.edit();
edit.putString(ACCOUNT_ID, null);
edit.apply();
} catch (Exception e) {
Log.e(LOG_TAG, "Auth.signOut failed", e);
}
}
}));
mListView = findViewById(R.id.list);
loadAuthStatus(sUserInformation == null);
mListView.setOnItemClickListener(TestFeatures.getOnItemClickListener());
}

private static boolean isAuthenticated() {
if (sUserInformation == null) {
return false;
}
return sUserInformation.getAccessToken() != null;
}

private void loadAuthStatus(boolean loadDefaultStatus) {
if (mAuthInfoTestFeature != null) {
mFeatureList.remove(mAuthInfoTestFeature);
}
mAuthInfoTestFeature = getAuthenticationDefaultTestFeature();
if (!loadDefaultStatus) {
mAuthInfoTestFeature = isAuthenticated() ? getAuthenticatedTestFeature() : getNotAuthenticatedTestFeature();
}
mFeatureList.add(mAuthInfoTestFeature);
mListView.setAdapter(new TestFeaturesListAdapter(mFeatureList));
}

private TestFeatures.TestFeature getAuthenticationDefaultTestFeature() {
return getAuthenticationTestFeature(R.string.authentication_status_description);
}

private TestFeatures.TestFeature getAuthenticatedTestFeature() {
return getAuthenticationTestFeature(R.string.authentication_status_authenticated);
}

private TestFeatures.TestFeature getNotAuthenticatedTestFeature() {
return getAuthenticationTestFeature(R.string.authentication_status_not_authenticated);
}

private TestFeatures.TestFeature getAuthenticationTestFeature(int valueStringId) {
return new TestFeatures.TestFeature(R.string.authentication_status_title, valueStringId, new View.OnClickListener() {

@Override
public void onClick(View v) {
if (isAuthenticated()) {
startUserInfoActivity(sUserInformation);
} else {
AlertDialog.Builder builder = new AlertDialog.Builder(AuthenticationProviderActivity.this);
builder.setTitle(R.string.authentication_status_dialog_unavailable_title)
.setMessage(R.string.authentication_status_dialog_unavailable_description)
.setPositiveButton(R.string.alert_ok, new DialogInterface.OnClickListener() {

@Override
public void onClick(DialogInterface dialogInterface, int i) {
dialogInterface.dismiss();
}
});
builder.create().show();
}
}
});
mListView.setOnItemClickListener(TestFeatures.getOnItemClickListener());
}

private void startMSALoginActivity(AuthenticationProvider.Type type) {
Expand All @@ -180,14 +63,6 @@ private void startMSALoginActivity(AuthenticationProvider.Type type) {
startActivity(intent);
}

private void startUserInfoActivity(UserInformation userInformation) {
Intent intent = new Intent(getApplication(), UserInformationActivity.class);
intent.putExtra(USER_INFORMATION_ID, userInformation.getAccountId());
intent.putExtra(USER_INFORMATION_ID_TOKEN, userInformation.getIdToken());
intent.putExtra(USER_INFORMATION_ACCESS_TOKEN, userInformation.getAccessToken());
startActivity(intent);
}

@Override
protected void onUserLeaveHint() {
mUserLeaving = true;
Expand Down
Loading

0 comments on commit 0bb44ae

Please sign in to comment.