Skip to content

Commit 7d3b05b

Browse files
Merge pull request #1608 from microsoft/develop
Version 4.4.3
2 parents be622be + 536c684 commit 7d3b05b

File tree

26 files changed

+222
-121
lines changed

26 files changed

+222
-121
lines changed

CHANGELOG.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,23 @@
11
# App Center SDK for Android Change Log
22

3+
## Version 4.4.3
4+
5+
### App Center Crashes
6+
7+
* **[Fix]** Add exception null check for `Crashes.trackError` API.
8+
9+
### App Center Distribute
10+
11+
* **[Fix]** Fix checking a new release if the application was already updated before.
12+
* **[Fix]** Fix superfluous register/unregister receiver for installing new release.
13+
* **[Fix]** Fix show custom in-app update dialog after opening release details.
14+
15+
### App Center Distribute Play
16+
17+
* **[Fix]** Add missing `Distribute.addStores` API.
18+
19+
___
20+
321
## Version 4.4.2
422

523
### App Center
@@ -10,6 +28,7 @@
1028
### App Center Distribute
1129

1230
* **[Fix]** Fix missing required flag on Android 31 API for `PendingIntent` which is used for starting the process of installing a new release.
31+
* **[Known issue]** After the first in-app update App Center doesn't indicate the next releases. Use a [workaround](https://github.com/microsoft/appcenter-sdk-android/issues/1594#issuecomment-1006313019) to avoid this issue.
1332

1433
___
1534

apps/sasquatch/build.gradle

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,20 @@ android {
2626
projectDependency {
2727
dimension "dependency"
2828
applicationIdSuffix ".project"
29+
buildConfigField "String", "APP_SECRET", "\"${System.getenv("ANDROID_INT")}\""
30+
buildConfigField "String", "TARGET_TOKEN", "\"${System.getenv("ANDROID_TARGET_TOKEN_INT")}\""
31+
buildConfigField "String", "TARGET_TOKEN1", "\"${System.getenv("ANDROID_TARGET_TOKEN1_INT")}\""
32+
buildConfigField "String", "TARGET_TOKEN2", "\"${System.getenv("ANDROID_TARGET_TOKEN2_INT")}\""
33+
buildConfigField "String", "TARGET_TOKEN3", "\"${System.getenv("ANDROID_TARGET_TOKEN3_INT")}\""
2934
}
3035
mavenCentralDependency {
3136
dimension "dependency"
3237
applicationIdSuffix ".mavenCentral"
38+
buildConfigField "String", "APP_SECRET", "\"${System.getenv("ANDROID_PROD")}\""
39+
buildConfigField "String", "TARGET_TOKEN", "\"${System.getenv("ANDROID_TARGET_TOKEN_PROD")}\""
40+
buildConfigField "String", "TARGET_TOKEN1", "\"${System.getenv("ANDROID_TARGET_TOKEN1_PROD")}\""
41+
buildConfigField "String", "TARGET_TOKEN2", "\"${System.getenv("ANDROID_TARGET_TOKEN2_PROD")}\""
42+
buildConfigField "String", "TARGET_TOKEN3", "\"${System.getenv("ANDROID_TARGET_TOKEN3_PROD")}\""
3343
}
3444
appCenter {
3545
dimension "distribute"

apps/sasquatch/src/main/java/com/microsoft/appcenter/sasquatch/activities/MainActivity.java

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
import com.microsoft.appcenter.crashes.CrashesListener;
3737
import com.microsoft.appcenter.crashes.model.ErrorReport;
3838
import com.microsoft.appcenter.distribute.Distribute;
39+
import com.microsoft.appcenter.sasquatch.BuildConfig;
3940
import com.microsoft.appcenter.sasquatch.MSAAuthenticationProvider;
4041
import com.microsoft.appcenter.sasquatch.R;
4142
import com.microsoft.appcenter.sasquatch.features.TestFeatures;
@@ -55,6 +56,12 @@ public class MainActivity extends AppCompatActivity {
5556

5657
public static final String LOG_TAG = "AppCenterSasquatch";
5758

59+
public static String[] mAppSecretsArray = {BuildConfig.APP_SECRET, "Custom"};
60+
61+
public static String mTargetToken = BuildConfig.TARGET_TOKEN;
62+
63+
public static String[] mTargetTokenArray = {BuildConfig.TARGET_TOKEN1, BuildConfig.TARGET_TOKEN2, BuildConfig.TARGET_TOKEN3};
64+
5865
static final String APP_SECRET_KEY = "appSecret";
5966

6067
static final String TARGET_KEY = "target";
@@ -153,7 +160,7 @@ static void startAppCenter(Application application, String startTypeString) {
153160
return;
154161
}
155162
String appId = sSharedPreferences.getString(APP_SECRET_KEY, getDefaultAppSecret(application.getResources()));
156-
String targetId = sSharedPreferences.getString(TARGET_KEY, application.getString(R.string.target_id));
163+
String targetId = sSharedPreferences.getString(TARGET_KEY, MainActivity.mTargetToken);
157164
String appIdArg = "";
158165
switch (startType) {
159166
case APP_SECRET:
@@ -355,13 +362,11 @@ public void accept(ErrorReport data) {
355362

356363
/* Get the default app secret from the app secret array. */
357364
static String getDefaultAppSecret(Resources resources) {
358-
final String[] secretValuesArray = resources.getStringArray(R.array.appcenter_secrets);
359-
return secretValuesArray[0];
365+
return mAppSecretsArray[0];
360366
}
361367

362368
static String getCustomAppSecretString(Resources resources) {
363-
final String[] secretValuesArray = resources.getStringArray(R.array.appcenter_secrets);
364-
return secretValuesArray[secretValuesArray.length - 1];
369+
return mAppSecretsArray[mAppSecretsArray.length - 1];
365370
}
366371

367372
private void setDistributeEnabledForDebuggableBuild() {

apps/sasquatch/src/main/java/com/microsoft/appcenter/sasquatch/activities/SettingsActivity.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import android.os.Bundle;
1717
import android.os.FileObserver;
1818
import android.preference.CheckBoxPreference;
19+
import android.preference.ListPreference;
1920
import android.preference.Preference;
2021
import androidx.annotation.Nullable;
2122
import androidx.annotation.StringRes;
@@ -479,6 +480,8 @@ public boolean onPreferenceChange(Preference preference, Object newValue) {
479480
});
480481
final String defaultAppSecret = MainActivity.getDefaultAppSecret(getActivity().getResources());
481482
final String appSecret = MainActivity.sSharedPreferences.getString(APP_SECRET_KEY, defaultAppSecret);
483+
final ListPreference listOfAppSecrets = (ListPreference) findPreference(getString(R.string.app_secret_key));
484+
listOfAppSecrets.setEntryValues(MainActivity.mAppSecretsArray);
482485
initChangeableSetting(R.string.app_secret_key, appSecret, new Preference.OnPreferenceChangeListener() {
483486

484487
@Override
@@ -556,7 +559,7 @@ public boolean onPreferenceChange(Preference preference, Object newValue) {
556559
return true;
557560
}
558561
});
559-
initEditText(R.string.target_id_key, R.string.target_id_title, TARGET_KEY, getString(R.string.target_id), new EditTextListener() {
562+
initEditText(R.string.target_id_key, R.string.target_id_title, TARGET_KEY, MainActivity.mTargetToken, new EditTextListener() {
560563

561564
@Override
562565
public void onSave(String value) {
@@ -570,7 +573,7 @@ public void onSave(String value) {
570573

571574
@Override
572575
public void onReset() {
573-
String defaultTargetId = getString(R.string.target_id);
576+
String defaultTargetId = MainActivity.mTargetToken;
574577
setKeyValue(TARGET_KEY, defaultTargetId);
575578
Toast.makeText(getActivity(), String.format(getActivity().getString(R.string.target_id_changed_format), defaultTargetId), Toast.LENGTH_SHORT).show();
576579
}

apps/sasquatch/src/main/java/com/microsoft/appcenter/sasquatch/listeners/SasquatchDistributeListener.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
import android.app.Activity;
99
import android.content.DialogInterface;
10+
import android.content.Intent;
1011
import android.widget.Toast;
1112

1213
import androidx.appcompat.app.AlertDialog;
@@ -20,7 +21,7 @@
2021
public class SasquatchDistributeListener implements DistributeListener {
2122

2223
@Override
23-
public boolean onReleaseAvailable(Activity activity, ReleaseDetails releaseDetails) {
24+
public boolean onReleaseAvailable(final Activity activity, final ReleaseDetails releaseDetails) {
2425
final String releaseNotes = releaseDetails.getReleaseNotes();
2526
boolean custom = releaseNotes != null && releaseNotes.toLowerCase().contains("custom");
2627
if (custom) {
@@ -44,6 +45,12 @@ public void onClick(DialogInterface dialog, int which) {
4445
}
4546
});
4647
}
48+
dialogBuilder.setNeutralButton(R.string.appcenter_distribute_update_dialog_view_release_notes, new DialogInterface.OnClickListener() {
49+
@Override
50+
public void onClick(DialogInterface dialogInterface, int i) {
51+
activity.startActivity(new Intent(Intent.ACTION_VIEW, releaseDetails.getReleaseNotesUrl()));
52+
}
53+
});
4754
dialogBuilder.create().show();
4855
}
4956
return custom;

apps/sasquatch/src/main/java/com/microsoft/appcenter/sasquatch/util/EventActivityUtil.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import com.microsoft.appcenter.analytics.Analytics;
1111
import com.microsoft.appcenter.analytics.AnalyticsTransmissionTarget;
1212
import com.microsoft.appcenter.sasquatch.R;
13+
import com.microsoft.appcenter.sasquatch.activities.MainActivity;
1314

1415
import java.util.ArrayList;
1516
import java.util.List;
@@ -24,7 +25,7 @@ public static List<AnalyticsTransmissionTarget> getAnalyticTransmissionTargetLis
2425
* The second one is the parent transmission target, the third one is a child,
2526
* the forth is a grandchild, etc...
2627
*/
27-
String[] targetTokens = activity.getResources().getStringArray(R.array.target_id_values);
28+
String[] targetTokens = MainActivity.mTargetTokenArray;
2829
targets.add(null);
2930
targets.add(Analytics.getTransmissionTarget(targetTokens[1]));
3031
for (int i = 2; i < targetTokens.length; i++) {

apps/sasquatch/src/main/res/values/env.xml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,4 @@
88
<string name="log_url_one_collector" tools:ignore="MissingTranslation" />
99
<string name="install_url" tools:ignore="MissingTranslation" />
1010
<string name="api_url" tools:ignore="MissingTranslation" />
11-
12-
<string-array name="appcenter_secrets" tools:ignore="MissingTranslation">
13-
<item>45d1d9f6-2492-4e68-bd44-7190351eb5f3</item>
14-
<item>Custom</item>
15-
</string-array>
1611
</resources>

apps/sasquatch/src/main/res/values/targets.xml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,6 @@
55
-->
66

77
<resources xmlns:tools="http://schemas.android.com/tools" tools:ignore="TypographyDashes">
8-
<string name="target_id" tools:ignore="MissingTranslation">89e889ccbe864ad6b924246d7045d55f-2d2d17d9-184c-4749-84a2-3fd0b3856ee1-7620</string>
9-
<string-array name="target_id_values" tools:ignore="InconsistentArrays,MissingTranslation">
10-
<item />
11-
<item>c86c1b0383d149f6969b80462b250e62-e3c516ac-ae36-4776-b3eb-9c21116a756c-7045</item>
12-
<item>739fadd014d642809473cdde9d1177d1-4477e206-0087-4d70-b810-229652426c89-7219</item>
13-
<item>518cb8157cb743be9f7a921a46fda15d-5c9111b6-2c0f-417e-95f9-2241235db0b6-6776</item>
14-
</string-array>
158
<string-array name="target_id_names" tools:ignore="InconsistentArrays,MissingTranslation">
169
<item>Default transmission</item>
1710
<item>Sasquatch Android 2</item>

apps/sasquatch/src/main/res/xml/settings.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@
107107
android:title="@string/install_id_title" />
108108
<ListPreference
109109
android:entries="@array/appcenter_secret_values"
110-
android:entryValues="@array/appcenter_secrets"
111110
android:key="@string/app_secret_key"
112111
android:title="@string/app_secret_title" />
113112
</PreferenceCategory>

apps/sasquatch/src/projectDependency/res/values/env.xml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,4 @@
99
<string name="log_url_one_collector" tools:ignore="MissingTranslation">https://mobile.events.data.microsoft.com/OneCollector/1.0</string>
1010
<string name="install_url" tools:ignore="MissingTranslation">https://install.portal-server-core-integration.dev.avalanch.es</string>
1111
<string name="api_url" tools:ignore="MissingTranslation">https://api-gateway-core-integration.dev.avalanch.es/v0.1</string>
12-
13-
<string-array name="appcenter_secrets" tools:ignore="MissingTranslation">
14-
<item>9e0d97c1-7838-46d0-9dab-1a0ef66aec6e</item>
15-
<item>Custom</item>
16-
</string-array>
1712
</resources>

0 commit comments

Comments
 (0)