Merge branch 'develop' into feature/DomainReloadDisabled

This commit is contained in:
Anatoly Pristensky 2022-12-27 09:26:51 +01:00 коммит произвёл GitHub
Родитель 613dec8a44 eec45dc546
Коммит 60efe0319c
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
111 изменённых файлов: 2920 добавлений и 3699 удалений

1
.github/CODEOWNERS поставляемый Normal file
Просмотреть файл

@ -0,0 +1 @@
* @microsoft/appcenter-fte

6
.gitignore поставляемый
Просмотреть файл

@ -31,8 +31,12 @@ externals/
output/
AppCenterStarter.m
AppCenterStarter.m.meta
Assets/Plugins/
Assets/Plugins/*
Assets/Plugins.meta
!Assets/Plugins/Android/
Assets/Plugins/Android/*
!Assets/Plugins/Android/mainTemplate.gradle
!Assets/Plugins/Android/mainTemplate.gradle.meta
# .NET Core
project.lock.json

Просмотреть файл

@ -0,0 +1,94 @@
// This file was added to implicitly specify the gradle version.
// Unity fails to build the project using the default gradle version,
// as it's unable to recognize the attribute "<queries>" in AndroidManifest added to support Android 11.
// Read more here: https://developers.google.com/ar/develop/unity/android-11-build
// Impacting commit: https://github.com/microsoft/appcenter-sdk-android/commit/67855dd9255e74fa75e5751226870a7466343619
buildscript {
repositories {**ARTIFACTORYREPOSITORY**
mavenCentral()
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.0.0'
**BUILD_SCRIPT_DEPS**}
}
configurations {
compileClasspath
}
allprojects {
repositories {**ARTIFACTORYREPOSITORY**
mavenCentral()
google()
jcenter()
flatDir {
dirs 'libs'
}
}
}
apply plugin: 'com.android.application'
**APPLY_PLUGINS**
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
**DEPS**}
android {
compileSdkVersion **APIVERSION**
buildToolsVersion '**BUILDTOOLS**'
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
defaultConfig {
minSdkVersion **MINSDKVERSION**
targetSdkVersion **TARGETSDKVERSION**
applicationId '**APPLICATIONID**'
ndk {
abiFilters **ABIFILTERS**
}
versionCode **VERSIONCODE**
versionName '**VERSIONNAME**'
}
lintOptions {
abortOnError false
}
aaptOptions {
noCompress = ['.unity3d', '.ress', '.resource', '.obb'**STREAMING_ASSETS**]
}**SIGN**
buildTypes {
debug {
minifyEnabled **MINIFY_DEBUG**
useProguard **PROGUARD_DEBUG**
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-unity.txt'**USER_PROGUARD**
jniDebuggable true
}
release {
minifyEnabled **MINIFY_RELEASE**
useProguard **PROGUARD_RELEASE**
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-unity.txt'**USER_PROGUARD****SIGNCONFIG**
}
}**PACKAGING_OPTIONS****SPLITS**
**BUILT_APK_LOCATION**
bundle {
language {
enableSplit = false
}
density {
enableSplit = false
}
abi {
enableSplit = true
}
}
}**SPLITS_VERSION_CODE****REPOSITORIES****SOURCE_BUILD_SETUP**

Просмотреть файл

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 5ab4bdd786d334587ac7d837c2649411
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

Просмотреть файл

@ -33,6 +33,11 @@ public class PuppetAnalytics : MonoBehaviour
StartCoroutine(SetEnabledCoroutine(enabled));
}
public void StartSession()
{
Analytics.StartSession();
}
public void SetIsCritical(bool critical)
{
_isCritical = IsCritical.isOn;

Просмотреть файл

@ -19,6 +19,7 @@ public class PuppetAppCenter : MonoBehaviour
public static int StartupTypeCached = 2;
public static readonly EventWaitHandle StorageReadyEvent = new ManualResetEvent(false);
public Toggle Enabled;
public Toggle AllowNetworkRequests;
public Text InstallIdLabel;
public Text DeviceIdLabel;
public Text SdkVersionLabel;
@ -40,7 +41,6 @@ public class PuppetAppCenter : MonoBehaviour
private const string LogUrlAndroidKey = "AppCenter.Unity.LogUrlKey";
private const string AppSecretKey = "MSAppCenterAppSecretUnityKey";
private const string AppSecretAndroidKey = "AppCenter.Unity.AppSecretKey";
public GameObject CustomProperty;
public RectTransform PropertiesList;
public Toggle DistributeEnabled;
public Toggle CustomDialog;
@ -65,32 +65,6 @@ public class PuppetAppCenter : MonoBehaviour
DistributeEnabled.isOn = isEnabled.Result;
}
public void AddProperty()
{
var property = Instantiate(CustomProperty);
property.transform.SetParent(PropertiesList, false);
}
public void Send()
{
AppCenter.SetCustomProperties(GetProperties());
}
private CustomProperties GetProperties()
{
var properties = PropertiesList.GetComponentsInChildren<PuppetCustomProperty>();
if (properties == null || properties.Length == 0)
{
return null;
}
var result = new CustomProperties();
foreach (var i in properties)
{
i.Set(result);
}
return result;
}
private void Awake()
{
var customUserId = PlayerPrefs.GetString(UserIdKey);
@ -133,6 +107,7 @@ public class PuppetAppCenter : MonoBehaviour
private IEnumerator OnEnableCoroutine()
{
AllowNetworkRequests.isOn = AppCenter.NetworkRequestsAllowed;
var isEnabled = AppCenter.IsEnabledAsync();
yield return isEnabled;
Enabled.isOn = isEnabled.Result;
@ -182,6 +157,11 @@ public class PuppetAppCenter : MonoBehaviour
StartCoroutine(SetEnabledCoroutine(enabled));
}
public void SetAllowNetworkRequests(bool isAllowed)
{
AppCenter.NetworkRequestsAllowed = isAllowed;
}
private IEnumerator SetEnabledCoroutine(bool enabled)
{
yield return AppCenter.SetEnabledAsync(enabled);

Просмотреть файл

@ -1,80 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
using System;
using System.Globalization;
using Microsoft.AppCenter.Unity;
using UnityEngine;
using UnityEngine.UI;
public class PuppetCustomProperty : MonoBehaviour
{
public InputField Key;
public Dropdown Type;
public InputField Value;
public Toggle Boolean;
public void Set(CustomProperties properties)
{
switch (Type.value)
{
case 0: // Clear
properties.Clear(Key.text);
break;
case 1: // Boolean
properties.Set(Key.text, Boolean.isOn);
break;
case 2: // Number
if (Value.text.Contains(CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator))
{
properties.Set(Key.text, float.Parse(Value.text));
}
else
{
properties.Set(Key.text, int.Parse(Value.text));
}
break;
case 3: // DateTime
properties.Set(Key.text, DateTime.Parse(Value.text));
break;
case 4: // String
properties.Set(Key.text, Value.text);
break;
}
}
public void SetType(int type)
{
switch (type)
{
case 0: // Clear
Boolean.gameObject.SetActive(false);
Value.gameObject.SetActive(false);
break;
case 1: // Boolean
Boolean.gameObject.SetActive(true);
Value.gameObject.SetActive(false);
break;
case 2: // Number
Boolean.gameObject.SetActive(false);
Value.gameObject.SetActive(true);
Value.contentType = InputField.ContentType.DecimalNumber;
break;
case 3: // DateTime
Boolean.gameObject.SetActive(false);
Value.gameObject.SetActive(true);
Value.contentType = InputField.ContentType.Standard;
break;
case 4: // String
Boolean.gameObject.SetActive(false);
Value.gameObject.SetActive(true);
Value.contentType = InputField.ContentType.Alphanumeric;
break;
}
}
public void Remove()
{
Destroy(gameObject);
}
}

Просмотреть файл

@ -1,12 +0,0 @@
fileFormatVersion: 2
guid: b1f0f25c9ed5e2243aaea3fccd646df3
timeCreated: 1501070595
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

Просмотреть файл

@ -15,6 +15,8 @@ public class PuppetReleaseHandler : MonoBehaviour
void Awake()
{
Distribute.ReleaseAvailable = OnReleaseAvailable;
Distribute.WillExitApp = OnWillExitApp;
Distribute.NoReleaseAvailable = OnNoReleaseAvailable;
IsDialogCustom = PlayerPrefs.GetInt(PuppetAppCenter.FlagCustomDialog, 0) == 1;
}
@ -31,6 +33,22 @@ public class PuppetReleaseHandler : MonoBehaviour
}
}
void OnWillExitApp()
{
lock (_releaseLock)
{
Debug.Log("WillExitApp callback invoked.");
}
}
void OnNoReleaseAvailable()
{
lock (_releaseLock)
{
Debug.Log("No release available");
}
}
void Update()
{
if (_releaseDetails == null)

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -20,10 +20,10 @@ android {
}
dependencies {
implementation fileTree(dir: '../../Assets/AppCenter/Plugins/Android', include: ['appcenter*.aar'])
compileOnly fileTree(dir: '../../Assets/AppCenter/Plugins/Android', include: 'appcenter*.aar')
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
implementation 'com.android.support:appcompat-v7:28.0.0'
testImplementation 'junit:junit:4.12'
}
}

Просмотреть файл

@ -1,7 +1,6 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.microsoft.appcenter.loader">
<application android:allowBackup="true" android:label="@string/app_name"
android:supportsRtl="true">
<application android:label="@string/app_name">
<provider
android:authorities="${applicationId}.microsoft.appcenter.loader"
android:exported="false"

Просмотреть файл

@ -28,6 +28,7 @@ public class AppCenterLoader extends ContentProvider {
private static final String CUSTOM_LOG_URL_KEY = "appcenter_custom_log_url";
private static final String USE_CUSTOM_LOG_URL_KEY = "appcenter_use_custom_log_url";
private static final String ALLOW_NETWORK_REQUESTS_KEY = "allow_network_requests";
private static final String MAX_STORAGE_SIZE = "appcenter_max_storage_size";
private static final String INITIAL_LOG_LEVEL_KEY = "appcenter_initial_log_level";
private static final String UPDATE_TRACK_KEY = "appcenter_update_track";
@ -50,18 +51,19 @@ public class AppCenterLoader extends ContentProvider {
private static final String TRUE_VALUE = "True";
private static final String TAG = "AppCenterLoader";
private static final String ENABLE_DISTRIBUTE_FOR_DEBUGGABLE_BUILD_KEY = "appcenter_enable_distribute_for_debuggable_build";
private static final String ENABLE_MANUAL_SESSION_TRACKER_KEY = "enable_manual_session_tracker";
private Context mContext;
private Application mApplication;
public static final String PREFS_NAME = "AppCenterUserPrefs";
@Override
public boolean onCreate() {
mContext = getApplicationContext();
String appSecret = mContext.getSharedPreferences(PREFS_NAME, Context.MODE_PRIVATE).getString(APP_SECRET_SHARED_PREFERENCES_KEY, getStringResource(APP_SECRET_KEY));
mApplication = getApplication();
String appSecret = mApplication.getSharedPreferences(PREFS_NAME, Context.MODE_PRIVATE).getString(APP_SECRET_SHARED_PREFERENCES_KEY, getStringResource(APP_SECRET_KEY));
String transmissionTargetToken = getStringResource(TRANSMISSION_TARGET_TOKEN_KEY);
int startupTypeInt = mContext.getSharedPreferences(PREFS_NAME, Context.MODE_PRIVATE).getInt(STARTUP_TYPE_SHARED_PREFERENCES_KEY, Integer.parseInt(getStringResource(STARTUP_TYPE_KEY)));
int startupTypeInt = mApplication.getSharedPreferences(PREFS_NAME, Context.MODE_PRIVATE).getInt(STARTUP_TYPE_SHARED_PREFERENCES_KEY, Integer.parseInt(getStringResource(STARTUP_TYPE_KEY)));
StartupType startupType = StartupType.values()[startupTypeInt];
/*
@ -107,11 +109,10 @@ public class AppCenterLoader extends ContentProvider {
if (isTrueValue(getStringResource(DISTRIBUTE_DISABLE_AUTOMATIC_CHECK_FOR_UPDATE_KEY))) {
Distribute.disableAutomaticCheckForUpdate();
}
classes.add(Distribute.class);
}
int logLevel = Integer.parseInt(getStringResource(INITIAL_LOG_LEVEL_KEY));
AppCenter.setLogLevel(logLevel);
String customLogUrl = mContext.getSharedPreferences(PREFS_NAME, Context.MODE_PRIVATE).getString(LOG_URL_SHARED_PREFERENCES_KEY, null);
String customLogUrl = mApplication.getSharedPreferences(PREFS_NAME, Context.MODE_PRIVATE).getString(LOG_URL_SHARED_PREFERENCES_KEY, null);
if (customLogUrl != null) {
AppCenter.setLogUrl(customLogUrl);
} else if (isTrueValue(getStringResource(USE_CUSTOM_LOG_URL_KEY))) {
@ -120,6 +121,12 @@ public class AppCenterLoader extends ContentProvider {
AppCenter.setLogUrl(customLogUrl);
}
}
if (!isTrueValue(getStringResource(ALLOW_NETWORK_REQUESTS_KEY))) {
AppCenter.setNetworkRequestsAllowed(false);
}
if (isTrueValue(getStringResource(ENABLE_MANUAL_SESSION_TRACKER_KEY))) {
Analytics.enableManualSessionTracker();
}
if (startupType == SKIP_START) {
return true;
}
@ -138,21 +145,21 @@ public class AppCenterLoader extends ContentProvider {
case NO_SECRET:
if (classes.size() > 0) {
Class<? extends AppCenterService>[] classesArray = GetClassesArray(classes);
AppCenter.start((Application) mContext, classesArray);
AppCenter.start(mApplication, classesArray);
}
return true;
}
if (classes.size() > 0) {
Class<? extends AppCenterService>[] classesArray = GetClassesArray(classes);
AppCenter.start((Application) mContext, appIdArg, classesArray);
AppCenter.start(mApplication, appIdArg, classesArray);
} else {
AppCenter.configure((Application) mContext, appIdArg);
AppCenter.configure(mApplication, appIdArg);
}
return true;
}
private void SetMaxStorageSize() {
String maxStorageSizeString = mContext.getSharedPreferences(PREFS_NAME, Context.MODE_PRIVATE).getString(MAX_STORAGE_SIZE_SHARED_PREFERENCES_KEY, getStringResource(MAX_STORAGE_SIZE));
String maxStorageSizeString = mApplication.getSharedPreferences(PREFS_NAME, Context.MODE_PRIVATE).getString(MAX_STORAGE_SIZE_SHARED_PREFERENCES_KEY, getStringResource(MAX_STORAGE_SIZE));
if (maxStorageSizeString != null) {
long maxStorageSize = Long.parseLong(maxStorageSizeString);
if (maxStorageSize > 0) {
@ -189,10 +196,13 @@ public class AppCenterLoader extends ContentProvider {
return 0;
}
private Context getApplicationContext() {
private Application getApplication() {
//TODO: if Unity supports instant apps, need to modify this method to account for them
return getContext();
if (getContext() instanceof Application) {
return (Application)getContext();
}
return (Application)getContext().getApplicationContext();
}
private boolean isTrueValue(String value) {
@ -200,11 +210,11 @@ public class AppCenterLoader extends ContentProvider {
}
private String getStringResource(String key) {
int identifier = mContext.getResources().getIdentifier(key, "string", mContext.getPackageName());
int identifier = mApplication.getResources().getIdentifier(key, "string", mApplication.getPackageName());
if (identifier == 0) {
return null;
}
return mContext.getResources().getString(identifier);
return mApplication.getResources().getString(identifier);
}
private boolean isModuleAvailable(String className, String moduleName) {

Просмотреть файл

@ -6,13 +6,17 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.0'
classpath 'com.android.tools.build:gradle:4.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
configurations {
compileClasspath
}
allprojects {
repositories {
google()

Двоичные данные
AppCenterLoaderApp/gradle/wrapper/gradle-wrapper.jar поставляемый

Двоичный файл не отображается.

Просмотреть файл

@ -1,6 +1,5 @@
#Tue Aug 14 14:14:35 MSK 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip

139
AppCenterLoaderApp/gradlew поставляемый
Просмотреть файл

@ -1,4 +1,20 @@
#!/usr/bin/env bash
#!/usr/bin/env sh
#
# Copyright 2015 the original author or authors.
#
# 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
#
# https://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.
#
##############################################################################
##
@ -6,42 +22,6 @@
##
##############################################################################
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
warn ( ) {
echo "$*"
}
die ( ) {
echo
echo "$*"
echo
exit 1
}
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
esac
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
@ -60,8 +40,49 @@ cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
warn () {
echo "$*"
}
die () {
echo
echo "$*"
echo
exit 1
}
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
NONSTOP* )
nonstop=true
;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
@ -85,7 +106,7 @@ location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
@ -105,10 +126,11 @@ if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
# For Cygwin or MSYS, switch paths to Windows format before running java
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
@ -134,27 +156,30 @@ if $cygwin ; then
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
i=`expr $i + 1`
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
0) set -- ;;
1) set -- "$args0" ;;
2) set -- "$args0" "$args1" ;;
3) set -- "$args0" "$args1" "$args2" ;;
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi
# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
function splitJvmOpts() {
JVM_OPTS=("$@")
# Escape application args
save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
APP_ARGS=`save "$@"`
exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
exec "$JAVACMD" "$@"

179
AppCenterLoaderApp/gradlew.bat поставляемый
Просмотреть файл

@ -1,90 +1,89 @@
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:init
@rem Get command-line arguments, handling Windowz variants
if not "%OS%" == "Windows_NT" goto win9xME_args
if "%@eval[2+2]" == "4" goto 4NT_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
goto execute
:4NT_args
@rem Get arguments from the 4NT Shell from JP Software
set CMD_LINE_ARGS=%$
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega
@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem https://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto execute
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto execute
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega

Просмотреть файл

@ -7,6 +7,7 @@ using System;
using System.Reflection;
using Microsoft.AppCenter.Unity.Internal;
using System.Linq;
using Microsoft.AppCenter.Unity.Analytics;
[HelpURL("https://docs.microsoft.com/en-us/appcenter/sdk/crashes/unity")]
public class AppCenterBehavior : MonoBehaviour
@ -86,9 +87,13 @@ public class AppCenterBehavior : MonoBehaviour
}
var appSecret = AppCenter.ParseAndSaveSecretForPlatform(Settings.AppSecret);
var advancedSettings = GetComponent<AppCenterBehaviorAdvanced>();
AppCenter.NetworkRequestsAllowed = Settings.AllowNetworkRequests;
if (IsStartFromAppCenterBehavior(advancedSettings))
{
AppCenter.LogLevel = Settings.InitialLogLevel;
if (Settings.EnableManualSessionTracker) {
Analytics.EnableManualSessionTracker();
}
if (Settings.CustomLogUrl.UseCustomUrl)
{
AppCenter.SetLogUrl(Settings.CustomLogUrl.Url);
@ -122,6 +127,11 @@ public class AppCenterBehavior : MonoBehaviour
var startCrashes = service.GetMethod("StartCrashes");
if (startCrashes != null)
startCrashes.Invoke(null, null);
// On iOS and Android we start distribute service here, to give app an opportunity to assign handlers after distribute and restart in Awake method
var startDistribute = service.GetMethod("StartDistribute");
if (startDistribute != null)
startDistribute.Invoke(null, null);
#endif
}
}

Просмотреть файл

@ -12,9 +12,9 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 07ef30b23b2586041aedf18c9486176d, type: 3}
m_Name: AppCenterSettings
m_EditorClassIdentifier:
iOSAppSecret: c7d464ba-8c6b-4e7b-a866-3d53112132eb
AndroidAppSecret: 6d4f2a96-71ea-4a6f-9fa8-27e0a6992750
UWPAppSecret: 41870fa1-1ee5-4417-ad41-499c16fa1dda
iOSAppSecret: ""
AndroidAppSecret: ""
UWPAppSecret: ""
UseAnalytics: 1
UseCrashes: 1
UseDistribute: 1

Просмотреть файл

@ -41,6 +41,12 @@ public class AppCenterSettings : ScriptableObject
public LogLevel InitialLogLevel = LogLevel.Info;
[Tooltip("By default, the network requests is allowed. Uncheck this to disallow network requests.")]
public bool AllowNetworkRequests = true;
[Tooltip("By default, the manual session tracker is disabled.")]
public bool EnableManualSessionTracker = false;
[CustomDropDownProperty("Public", 1)]
[CustomDropDownProperty("Private", 2)]
public int UpdateTrack;

Просмотреть файл

@ -12,7 +12,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 0254b6f16506aa345aa7e5b4229b8fdc, type: 3}
m_Name: AppCenterSettingsAdvanced
m_EditorClassIdentifier:
TransmissionTargetToken: a5f11422a6f74e1a8c69afa1e0f9d5bd-c10bc995-8731-4b41-8cef-dd5e4333d594-6833
TransmissionTargetToken: ""
AppCenterStartupType: 2
StartAndroidNativeSDKFromAppCenterBehavior: 0
StartIOSNativeSDKFromAppCenterBehavior: 0

Просмотреть файл

@ -27,7 +27,7 @@ public static class AndroidLibraryHelper
.ToString();
processName = "cmd";
}
else if (Application.platform == RuntimePlatform.OSXEditor)
else if (Application.platform == RuntimePlatform.OSXEditor || Application.platform == RuntimePlatform.LinuxEditor)
{
args = stringBuilder
.Append("-c \"cd ")
@ -65,7 +65,7 @@ public static class AndroidLibraryHelper
.ToString();
processName = "cmd";
}
else if (Application.platform == RuntimePlatform.OSXEditor)
else if (Application.platform == RuntimePlatform.OSXEditor || Application.platform == RuntimePlatform.LinuxEditor)
{
args = stringBuilder
.Append("-c \"unzip ")

Просмотреть файл

@ -22,7 +22,6 @@ public class AppCenterPostBuild : IPostprocessBuildWithReport
public int callbackOrder { get { return 0; } }
private const string AppManifestFileName = "Package.appxmanifest";
private const string AarFilePattern = "appcenter-{0}-release";
private const string CapabilitiesElement = "Capabilities";
private const string CapabilityElement = "Capability";
private const string CapabilityNameAttribute = "Name";
@ -72,47 +71,8 @@ public class AppCenterPostBuild : IPostprocessBuildWithReport
capabilityManager.WriteToFile();
}
}
if (target == BuildTarget.Android)
{
// No linking/unlinking in case module isn't added.
if (AppCenter.Distribute != null)
{
LinkModule(AppCenterSettingsContext.SettingsInstance.UseDistribute, "distribute");
}
if (AppCenter.Analytics != null)
{
LinkModule(AppCenterSettingsContext.SettingsInstance.UseAnalytics, "analytics");
}
if (AppCenter.Crashes != null)
{
LinkModule(AppCenterSettingsContext.SettingsInstance.UseCrashes, "crashes");
}
}
}
#region Android Methods
private static void LinkModule(bool isEnabled, string moduleName)
{
var aarName = string.Format(AarFilePattern, moduleName);
var aarFileAsset = AssetDatabase.FindAssets(aarName, new[] { AppCenterSettingsContext.AppCenterPath + "/Plugins/Android" });
if (aarFileAsset.Length == 0)
{
Debug.LogWarning("Failed to link " + moduleName + ", file `" + aarName + "` is not found");
return;
}
var assetPath = AssetDatabase.GUIDToAssetPath(aarFileAsset[0]);
var importer = AssetImporter.GetAtPath(assetPath) as PluginImporter;
if (importer != null)
{
Debug.Log (moduleName + " is " + (isEnabled ? "" : "not ") + "enabled. " +
(isEnabled ? "Linking " : "Unlinking ") + aarName);
importer.SetCompatibleWithPlatform(BuildTarget.Android, isEnabled);
importer.SaveAndReimport();
}
}
#endregion
#region UWP Methods
/// <summary>

Просмотреть файл

@ -11,6 +11,7 @@ using UnityEngine;
public class AppCenterPreBuild : IPreprocessBuildWithReport
{
private const string AarFilePattern = "appcenter-{0}-release";
public int callbackOrder { get { return 0; } }
#if UNITY_WSA
private readonly Version RequiredMinimalUWPVersion = new Version("10.0.16299.0");
@ -42,13 +43,36 @@ public class AppCenterPreBuild : IPreprocessBuildWithReport
else if (target == BuildTarget.WSAPlayer)
{
#if UNITY_WSA
var currentMinimalPlatformVersion = new Version(EditorUserBuildSettings.wsaMinUWPSDK);
if (currentMinimalPlatformVersion < RequiredMinimalUWPVersion)
try
{
Debug.LogWarning($"Minimum platform version should be set to {RequiredMinimalUWPVersion} or higher. App Center does not support lower versions but it is set to {currentMinimalPlatformVersion}");
var currentMinimalPlatformVersion = new Version(EditorUserBuildSettings.wsaMinUWPSDK);
if (currentMinimalPlatformVersion < RequiredMinimalUWPVersion)
{
Debug.LogWarning($"Minimum platform version should be set to {RequiredMinimalUWPVersion} or higher. App Center does not support lower versions but it is set to {currentMinimalPlatformVersion}");
}
}
catch (Exception ex)
{
Debug.LogError($"Could not parse min UWP versin in editor: {EditorUserBuildSettings.wsaMinUWPSDK}. ex: {ex}");
}
#endif
}
if (target == BuildTarget.Android)
{
// No linking/unlinking in case module isn't added.
if (AppCenter.Distribute != null)
{
LinkModule(AppCenterSettingsContext.SettingsInstance.UseDistribute, "distribute");
}
if (AppCenter.Analytics != null)
{
LinkModule(AppCenterSettingsContext.SettingsInstance.UseAnalytics, "analytics");
}
if (AppCenter.Crashes != null)
{
LinkModule(AppCenterSettingsContext.SettingsInstance.UseCrashes, "crashes");
}
}
}
#if UNITY_ANDROID
@ -97,6 +121,8 @@ public class AppCenterPreBuild : IPreprocessBuildWithReport
var advancedSettings = AppCenterSettingsContext.SettingsInstanceAdvanced;
settingsMaker.SetAppSecret(settings);
settingsMaker.SetLogLevel((int)settings.InitialLogLevel);
settingsMaker.IsAllowNetworkRequests((bool)settings.AllowNetworkRequests);
settingsMaker.EnableManualSessionTracker((bool)settings.EnableManualSessionTracker);
if (settings.CustomLogUrl.UseCustomUrl)
{
settingsMaker.SetLogUrl(settings.CustomLogUrl.Url);
@ -146,4 +172,27 @@ public class AppCenterPreBuild : IPreprocessBuildWithReport
}
settingsMaker.CommitSettings();
}
#region Android Methods
private static void LinkModule(bool isEnabled, string moduleName)
{
var aarName = string.Format(AarFilePattern, moduleName);
var aarFileAsset = AssetDatabase.FindAssets(aarName, new[] { AppCenterSettingsContext.AppCenterPath + "/Plugins/Android" });
if (aarFileAsset.Length == 0)
{
Debug.LogWarning("Failed to link " + moduleName + ", file `" + aarName + "` is not found");
return;
}
var assetPath = AssetDatabase.GUIDToAssetPath(aarFileAsset[0]);
var importer = AssetImporter.GetAtPath(assetPath) as PluginImporter;
if (importer != null)
{
Debug.Log (moduleName + " is " + (isEnabled ? "" : "not ") + "enabled. " +
(isEnabled ? "Linking " : "Unlinking ") + aarName);
importer.SetCompatibleWithPlatform(BuildTarget.Android, isEnabled);
importer.SaveAndReimport();
}
}
#endregion
}

Просмотреть файл

@ -24,6 +24,7 @@ public class AppCenterSettingsEditor : Editor
Header("Analytics");
EditorGUILayout.PropertyField(serializedObject.FindProperty("UseAnalytics"));
EditorGUILayout.PropertyField(serializedObject.FindProperty("MaxStorageSize"));
EditorGUILayout.PropertyField(serializedObject.FindProperty("EnableManualSessionTracker"));
}
if (AppCenter.Crashes != null)
{
@ -46,6 +47,7 @@ public class AppCenterSettingsEditor : Editor
Header("Other Setup");
EditorGUILayout.PropertyField(serializedObject.FindProperty("InitialLogLevel"));
EditorGUILayout.PropertyField(serializedObject.FindProperty("CustomLogUrl"));
EditorGUILayout.PropertyField(serializedObject.FindProperty("AllowNetworkRequests"));
serializedObject.ApplyModifiedProperties();
}

Просмотреть файл

@ -7,6 +7,7 @@ using System.IO;
public class AppCenterSettingsMakerAndroid : IAppCenterSettingsMaker
{
private const string AppSecretKey = "appcenter_app_secret";
private const string AllowNetworkRequestsKey = "allow_network_requests";
private const string TransmissionTargetTokenKey = "appcenter_transmission_target_token";
private const string CustomLogUrlKey = "appcenter_custom_log_url";
private const string UseCustomLogUrlKey = "appcenter_use_custom_log_url";
@ -23,6 +24,7 @@ public class AppCenterSettingsMakerAndroid : IAppCenterSettingsMaker
private const string MaxStorageSizeKey = "appcenter_max_storage_size";
private const string UpdateTrackKey = "appcenter_update_track";
private const string EnableDistributeForDebuggableBuildKey = "appcenter_enable_distribute_for_debuggable_build";
private const string EnableManualSessionTrackerKey = "enable_manual_session_tracker";
private readonly IDictionary<string, string> _resourceValues = new Dictionary<string, string>();
@ -31,6 +33,11 @@ public class AppCenterSettingsMakerAndroid : IAppCenterSettingsMaker
_resourceValues[InitialLogLevelKey] = logLevel.ToString();
}
public void EnableManualSessionTracker(bool isEnabled)
{
_resourceValues[EnableManualSessionTrackerKey] = isEnabled.ToString();
}
public void SetStartupType(int startupType)
{
_resourceValues[StartupTypeKey] = startupType.ToString();
@ -47,6 +54,11 @@ public class AppCenterSettingsMakerAndroid : IAppCenterSettingsMaker
_resourceValues[UseCustomLogUrlKey] = true.ToString();
}
public void IsAllowNetworkRequests(bool isAllowed)
{
_resourceValues[AllowNetworkRequestsKey] = isAllowed.ToString();
}
public void SetAppSecret(AppCenterSettings settings)
{
_resourceValues[AppSecretKey] = settings.AndroidAppSecret;

Просмотреть файл

@ -9,6 +9,7 @@ public class AppCenterSettingsMakerIos : IAppCenterSettingsMaker
private static readonly string TemplateFilePath = AppCenterSettingsContext.AppCenterPath + "/Plugins/iOS/Core/AppCenterStarter.original";
private static readonly string TargetFilePath = AppCenterSettingsContext.AppCenterPath + "/Plugins/iOS/Core/AppCenterStarter.m";
private const string AppSecretSearchText = "appcenter-app-secret";
private const string AllowNetworkRequestsText = "allow-network-requests";
private const string TransmissionTargetTokenSearchText = "appcenter-transmission-target-token";
private const string LogUrlSearchText = "custom-log-url";
private const string LogUrlToken = "APPCENTER_UNITY_USE_CUSTOM_LOG_URL";
@ -25,6 +26,7 @@ public class AppCenterSettingsMakerIos : IAppCenterSettingsMaker
private const string UseCustomMaxStorageSize = "APPCENTER_USE_CUSTOM_MAX_STORAGE_SIZE";
private const string MaxStorageSize = "APPCENTER_MAX_STORAGE_SIZE";
private const string UpdateTrackSearchText = "1 /*UPDATE_TRACK*/";
private const string EnableManualSessionTrackerText = "enable-manual-session-tracker";
private string _loaderFileText;
private bool _enableDistributeForDebuggableBuild;
@ -34,11 +36,21 @@ public class AppCenterSettingsMakerIos : IAppCenterSettingsMaker
_loaderFileText = File.ReadAllText(TemplateFilePath);
}
public void EnableManualSessionTracker(bool isEnabled)
{
_loaderFileText = _loaderFileText.Replace(EnableManualSessionTrackerText, isEnabled ? "YES" : "NO");
}
public void SetLogLevel(int logLevel)
{
_loaderFileText = _loaderFileText.Replace(LogLevelSearchText, logLevel.ToString());
}
public void IsAllowNetworkRequests(bool isAllowed)
{
_loaderFileText = _loaderFileText.Replace(AllowNetworkRequestsText, isAllowed ? "YES" : "NO");
}
public void SetStartupType(int startupType)
{
_loaderFileText = _loaderFileText.Replace(StartupTypeSearchText, startupType.ToString());

Просмотреть файл

@ -5,6 +5,7 @@ public interface IAppCenterSettingsMaker
{
bool IsAnalyticsAvailable();
bool IsCrashesAvailable();
void IsAllowNetworkRequests(bool isAllowed);
bool IsDistributeAvailable();
void StartAnalyticsClass();
void StartCrashesClass();
@ -22,4 +23,5 @@ public interface IAppCenterSettingsMaker
void SetShouldEnableDistributeForDebuggableBuild();
void SetDistributeDisableAutomaticCheckForUpdate();
void SetUpdateTrack(int updateTrack);
void EnableManualSessionTracker(bool isEnabled);
}

Просмотреть файл

@ -91,6 +91,16 @@ namespace Microsoft.AppCenter.Unity.Analytics.Internal
{
_analytics.CallStatic("resume");
}
public static void EnableManualSessionTracker()
{
_analytics.CallStatic("enableManualSessionTracker");
}
public static void StartSession()
{
_analytics.CallStatic("startSession");
}
}
}
#endif

Просмотреть файл

@ -78,6 +78,14 @@ namespace Microsoft.AppCenter.Unity.Analytics.Internal
public static void Resume()
{
}
public static void EnableManualSessionTracker()
{
}
public static void StartSession()
{
}
}
}
#endif

Просмотреть файл

@ -16,7 +16,7 @@ namespace Microsoft.AppCenter.Unity.Analytics
public class Analytics
{
// Used by App Center Unity Editor Extensions: https://github.com/Microsoft/AppCenter-SDK-Unity-Extension
public const string AnalyticsSDKVersion = "4.0.0";
public const string AnalyticsSDKVersion = "4.4.0";
public static void PrepareEventHandlers()
{
@ -116,5 +116,15 @@ namespace Microsoft.AppCenter.Unity.Analytics
{
AnalyticsInternal.Resume();
}
public static void EnableManualSessionTracker()
{
AnalyticsInternal.EnableManualSessionTracker();
}
public static void StartSession()
{
AnalyticsInternal.StartSession();
}
}
}

Просмотреть файл

@ -82,6 +82,16 @@ namespace Microsoft.AppCenter.Unity.Analytics.Internal
public static void Resume()
{
}
public static void EnableManualSessionTracker()
{
UWPAnalytics.EnableManualSessionTracker();
}
public static void StartSession()
{
UWPAnalytics.StartSession();
}
}
}
#endif

Просмотреть файл

@ -79,6 +79,16 @@ namespace Microsoft.AppCenter.Unity.Analytics.Internal
appcenter_unity_analytics_resume();
}
public static void EnableManualSessionTracker()
{
appcenter_unity_analytics_enable_manual_session_tracker();
}
public static void StartSession()
{
appcenter_unity_analytics_start_session();
}
#region External
[DllImport("__Internal")]
@ -108,6 +118,12 @@ namespace Microsoft.AppCenter.Unity.Analytics.Internal
[DllImport("__Internal")]
private static extern void appcenter_unity_analytics_resume();
[DllImport("__Internal")]
private static extern void appcenter_unity_analytics_enable_manual_session_tracker();
[DllImport("__Internal")]
private static extern void appcenter_unity_analytics_start_session();
#endregion
}
}

Просмотреть файл

@ -42,6 +42,16 @@ namespace Microsoft.AppCenter.Unity.Internal
{
return _appCenter.CallStatic<string>("getSdkVersion");
}
public static void SetNetworkRequestsAllowed(bool isAllowed)
{
_appCenter.CallStatic("setNetworkRequestsAllowed", isAllowed);
}
public static bool IsNetworkRequestsAllowed()
{
return _appCenter.CallStatic<bool>("isNetworkRequestsAllowed");
}
public static AppCenterTask SetEnabledAsync(bool enabled)
{
@ -68,11 +78,6 @@ namespace Microsoft.AppCenter.Unity.Internal
return stringTask;
}
public static void SetCustomProperties(AndroidJavaObject properties)
{
_appCenter.CallStatic("setCustomProperties", properties);
}
private static AndroidJavaObject GetAndroidApplication()
{
AndroidJavaClass unityPlayer = new AndroidJavaClass("com.unity3d.player.UnityPlayer");

Просмотреть файл

@ -1,59 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
#if UNITY_ANDROID && !UNITY_EDITOR
using System;
using UnityEngine;
using Microsoft.AppCenter.Unity.Internal.Utility;
namespace Microsoft.AppCenter.Unity.Internal
{
class CustomPropertiesInternal
{
public static AndroidJavaObject Create()
{
return new AndroidJavaObject("com.microsoft.appcenter.CustomProperties");
}
public static void SetString(AndroidJavaObject properties, string key, string val)
{
properties.Call<AndroidJavaObject>("set", key, val);
}
public static void SetNumber(AndroidJavaObject properties, string key, int val)
{
properties.Call<AndroidJavaObject>("set", key, JavaNumberHelper.Convert(val));
}
public static void SetNumber(AndroidJavaObject properties, string key, long val)
{
properties.Call<AndroidJavaObject>("set", key, JavaNumberHelper.Convert(val));
}
public static void SetNumber(AndroidJavaObject properties, string key, float val)
{
properties.Call<AndroidJavaObject>("set", key, JavaNumberHelper.Convert(val));
}
public static void SetNumber(AndroidJavaObject properties, string key, double val)
{
properties.Call<AndroidJavaObject>("set", key, JavaNumberHelper.Convert(val));
}
public static void SetBool(AndroidJavaObject properties, string key, bool val)
{
properties.Call<AndroidJavaObject>("set", key, val);
}
public static void SetDate(AndroidJavaObject properties, string key, DateTime val)
{
properties.Call<AndroidJavaObject>("set", key, JavaDateHelper.DateTimeConvert(val));
}
public static void Clear(AndroidJavaObject properties, string key)
{
properties.Call<AndroidJavaObject>("clear", key);
}
}
}
#endif

Просмотреть файл

@ -1,12 +0,0 @@
fileFormatVersion: 2
guid: 01d13d2a6a4d8490f96dacdc75d302e6
timeCreated: 1498588175
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

Просмотреть файл

@ -75,6 +75,15 @@ namespace Microsoft.AppCenter.Unity.Internal
{
}
public static bool IsNetworkRequestsAllowed()
{
return true;
}
public static void SetNetworkRequestsAllowed(bool isAllowed)
{
}
public static AppCenterTask SetEnabledAsync(bool enabled)
{
return AppCenterTask.FromCompleted();
@ -90,10 +99,6 @@ namespace Microsoft.AppCenter.Unity.Internal
return AppCenterTask<string>.FromCompleted("");
}
public static void SetCustomProperties(RawType properties)
{
}
public static void SetWrapperSdk(string wrapperSdkVersion,
string wrapperSdkName,
string wrapperRuntimeVersion,

Просмотреть файл

@ -1,45 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
#if (!UNITY_IOS && !UNITY_ANDROID && !UNITY_WSA_10_0) || UNITY_EDITOR
using System;
namespace Microsoft.AppCenter.Unity.Internal
{
#if UNITY_IOS
using RawType = System.IntPtr;
#elif UNITY_ANDROID
using RawType = UnityEngine.AndroidJavaObject;
#else
using RawType = System.Object;
#endif
class CustomPropertiesInternal
{
public static RawType Create()
{
return default(RawType);
}
public static void SetString(RawType properties, string key, string val)
{
}
public static void SetNumber(RawType properties, string key, object val)
{
}
public static void SetBool(RawType properties, string key, bool val)
{
}
public static void SetDate(RawType properties, string key, DateTime val)
{
}
public static void Clear(RawType properties, string key)
{
}
}
}
#endif

Просмотреть файл

@ -1,12 +0,0 @@
fileFormatVersion: 2
guid: 74599edfdf514453db93e40271b07655
timeCreated: 1498578955
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

Просмотреть файл

@ -105,6 +105,18 @@ namespace Microsoft.AppCenter.Unity
AppCenterInternal.SetLogUrl(logUrl);
}
public static bool NetworkRequestsAllowed
{
get
{
return AppCenterInternal.IsNetworkRequestsAllowed();
}
set
{
AppCenterInternal.SetNetworkRequestsAllowed(value);
}
}
public static void CacheStorageSize(long storageSize)
{
if (_storageSizeTask != null)
@ -129,16 +141,6 @@ namespace Microsoft.AppCenter.Unity
get { return AppCenterInternal.IsConfigured(); }
}
/// <summary>
/// Set the custom properties.
/// </summary>
/// <param name="customProperties">Custom properties object.</param>
public static void SetCustomProperties(Unity.CustomProperties customProperties)
{
var rawCustomProperties = customProperties.GetRawObject();
AppCenterInternal.SetCustomProperties(rawCustomProperties);
}
public static void SetWrapperSdk()
{
AppCenterInternal.SetWrapperSdk(WrapperSdk.WrapperSdkVersion, WrapperSdk.Name, WrapperSdk.WrapperRuntimeVersion, null, null, null);

Просмотреть файл

@ -1,133 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
using System;
using Microsoft.AppCenter.Unity.Internal;
namespace Microsoft.AppCenter.Unity
{
#if UNITY_IOS
using RawType = System.IntPtr;
#elif UNITY_ANDROID
using RawType = UnityEngine.AndroidJavaObject;
#else
using RawType = System.Object;
#endif
public class CustomProperties
{
private readonly RawType _rawObject;
internal RawType GetRawObject()
{
return _rawObject;
}
public CustomProperties()
{
_rawObject = CustomPropertiesInternal.Create();
}
/// <summary>
/// Set the specified property value with the specified key.
/// If the properties previously contained a property for the key, the old value is replaced.
/// </summary>
/// <param name="key">Key with which the specified value is to be set.</param>
/// <param name="val">Value to be set with the specified key.</param>
/// <returns>This instance.</returns>
public CustomProperties Set(string key, string val)
{
CustomPropertiesInternal.SetString(_rawObject, key, val);
return this;
}
/// <summary>
/// Set the specified property value with the specified key.
/// If the properties previously contained a property for the key, the old value is replaced.
/// </summary>
/// <param name="key">Key with which the specified value is to be set.</param>
/// <param name="val">Value to be set with the specified key.</param>
/// <returns>This instance.</returns>
public CustomProperties Set(string key, DateTime val)
{
CustomPropertiesInternal.SetDate(_rawObject, key, val);
return this;
}
/// <summary>
/// Set the specified property value with the specified key.
/// If the properties previously contained a property for the key, the old value is replaced.
/// </summary>
/// <param name="key">Key with which the specified value is to be set.</param>
/// <param name="val">Value to be set with the specified key.</param>
/// <returns>This instance.</returns>
public CustomProperties Set(string key, int val)
{
CustomPropertiesInternal.SetNumber(_rawObject, key, val);
return this;
}
/// <summary>
/// Set the specified property value with the specified key.
/// If the properties previously contained a property for the key, the old value is replaced.
/// </summary>
/// <param name="key">Key with which the specified value is to be set.</param>
/// <param name="val">Value to be set with the specified key.</param>
/// <returns>This instance.</returns>
public CustomProperties Set(string key, long val)
{
CustomPropertiesInternal.SetNumber(_rawObject, key, val);
return this;
}
/// <summary>
/// Set the specified property value with the specified key.
/// If the properties previously contained a property for the key, the old value is replaced.
/// </summary>
/// <param name="key">Key with which the specified value is to be set.</param>
/// <param name="val">Value to be set with the specified key.</param>
/// <returns>This instance.</returns>
public CustomProperties Set(string key, float val)
{
CustomPropertiesInternal.SetNumber(_rawObject, key, val);
return this;
}
/// <summary>
/// Set the specified property value with the specified key.
/// If the properties previously contained a property for the key, the old value is replaced.
/// </summary>
/// <param name="key">Key with which the specified value is to be set.</param>
/// <param name="val">Value to be set with the specified key.</param>
/// <returns>This instance.</returns>
public CustomProperties Set(string key, double val)
{
CustomPropertiesInternal.SetNumber(_rawObject, key, val);
return this;
}
/// <summary>
/// Set the specified property value with the specified key.
/// If the properties previously contained a property for the key, the old value is replaced.
/// </summary>
/// <param name="key">Key with which the specified value is to be set.</param>
/// <param name="val">Value to be set with the specified key.</param>
/// <returns>This instance.</returns>
public CustomProperties Set(string key, bool val)
{
CustomPropertiesInternal.SetBool(_rawObject, key, val);
return this;
}
/// <summary>
/// Clear the property for the specified key.
/// </summary>
/// <param name="key">Key whose mapping is to be cleared.</param>
/// <returns>This instance.</returns>
public CustomProperties Clear(string key)
{
CustomPropertiesInternal.Clear(_rawObject, key);
return this;
}
}
}

Просмотреть файл

@ -1,12 +0,0 @@
fileFormatVersion: 2
guid: b5bc08888e1954d1586b49469659b087
timeCreated: 1498516072
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

Просмотреть файл

@ -12,7 +12,7 @@ namespace Microsoft.AppCenter.Unity
private static bool _hasAttemptedToGetRuntimeVersion;
public const string Name = "appcenter.unity";
public const string WrapperSdkVersion = "4.0.0";
public const string WrapperSdkVersion = "4.4.0";
internal static string WrapperRuntimeVersion
{

Просмотреть файл

@ -87,6 +87,18 @@ namespace Microsoft.AppCenter.Unity.Internal
Prepare();
UWPAppCenter.SetLogUrl(logUrl);
}
public static void SetNetworkRequestsAllowed(bool isAllowed)
{
Prepare();
UWPAppCenter.IsNetworkRequestsAllowed = isAllowed;
}
public static bool IsNetworkRequestsAllowed()
{
Prepare();
return UWPAppCenter.IsNetworkRequestsAllowed;
}
public static AppCenterTask SetEnabledAsync(bool isEnabled)
{
@ -113,13 +125,6 @@ namespace Microsoft.AppCenter.Unity.Internal
return stringTask;
}
public static void SetCustomProperties(object properties)
{
Prepare();
var uwpProperties = properties as Microsoft.AppCenter.CustomProperties;
UWPAppCenter.SetCustomProperties(uwpProperties);
}
public static void SetWrapperSdk(string wrapperSdkVersion,
string wrapperSdkName,
string wrapperRuntimeVersion,
@ -194,6 +199,8 @@ namespace Microsoft.AppCenter.Unity.Internal
public static void SetMaxStorageSize(long size)
{
Prepare();
UWPAppCenter.SetMaxStorageSizeAsync(size);
}
private static void Prepare()

Просмотреть файл

@ -1,67 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
#if UNITY_WSA_10_0 && !UNITY_EDITOR
using System;
namespace Microsoft.AppCenter.Unity.Internal
{
using UWPCustomProperties = Microsoft.AppCenter.CustomProperties;
class CustomPropertiesInternal
{
public static object Create()
{
return new UWPCustomProperties();
}
public static void SetString(object properties, string key, string val)
{
var uwpProperties = properties as UWPCustomProperties;
uwpProperties.Set(key, val);
}
public static void SetNumber(object properties, string key, int val)
{
var uwpProperties = properties as UWPCustomProperties;
uwpProperties.Set(key, val);
}
public static void SetNumber(object properties, string key, long val)
{
var uwpProperties = properties as UWPCustomProperties;
uwpProperties.Set(key, val);
}
public static void SetNumber(object properties, string key, float val)
{
var uwpProperties = properties as UWPCustomProperties;
uwpProperties.Set(key, val);
}
public static void SetNumber(object properties, string key, double val)
{
var uwpProperties = properties as UWPCustomProperties;
uwpProperties.Set(key, val);
}
public static void SetBool(object properties, string key, bool val)
{
var uwpProperties = properties as UWPCustomProperties;
uwpProperties.Set(key, val);
}
public static void SetDate(object properties, string key, DateTime val)
{
var uwpProperties = properties as UWPCustomProperties;
uwpProperties.Set(key, val);
}
public static void Clear(object properties, string key)
{
var uwpProperties = properties as UWPCustomProperties;
uwpProperties.Clear(key);
}
}
}
#endif

Просмотреть файл

@ -1,12 +0,0 @@
fileFormatVersion: 2
guid: e4a40f8a8c4ac5b4e80acd82f5bb940e
timeCreated: 1498670691
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

Просмотреть файл

@ -43,6 +43,16 @@ namespace Microsoft.AppCenter.Unity.Internal
appcenter_unity_set_log_url(logUrl);
}
public static void SetNetworkRequestsAllowed(bool isAllowed)
{
appcenter_unity_set_network_requests_allowed(isAllowed);
}
public static bool IsNetworkRequestsAllowed()
{
return appcenter_unity_is_network_requests_allowed();
}
public static AppCenterTask SetEnabledAsync(bool isEnabled)
{
appcenter_unity_set_enabled(isEnabled);
@ -61,11 +71,6 @@ namespace Microsoft.AppCenter.Unity.Internal
return AppCenterTask<string>.FromCompleted(installId);
}
public static void SetCustomProperties(IntPtr properties)
{
appcenter_unity_set_custom_properties(properties);
}
public static void SetWrapperSdk(string wrapperSdkVersion,
string wrapperSdkName,
string wrapperRuntimeVersion,
@ -149,6 +154,12 @@ namespace Microsoft.AppCenter.Unity.Internal
[DllImport("__Internal")]
private static extern void appcenter_unity_set_enabled(bool isEnabled);
[DllImport("__Internal")]
private static extern void appcenter_unity_set_network_requests_allowed(bool isAllowed);
[DllImport("__Internal")]
private static extern bool appcenter_unity_is_network_requests_allowed();
[DllImport("__Internal")]
private static extern bool appcenter_unity_is_enabled();
@ -164,9 +175,6 @@ namespace Microsoft.AppCenter.Unity.Internal
[DllImport("__Internal")]
private static extern void appcenter_unity_start_from_library(IntPtr[] classes, int count);
[DllImport("__Internal")]
private static extern void appcenter_unity_set_custom_properties(IntPtr properties);
[DllImport("__Internal")]
private static extern void appcenter_unity_set_wrapper_sdk(string wrapperSdkVersion,
string wrapperSdkName,

Просмотреть файл

@ -1,81 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
#if UNITY_IOS && !UNITY_EDITOR
using System;
using System.Runtime.InteropServices;
using Microsoft.AppCenter.Unity.Internal.Utility;
namespace Microsoft.AppCenter.Unity.Internal
{
class CustomPropertiesInternal
{
public static IntPtr Create()
{
return appcenter_unity_custom_properties_create();
}
public static void SetString(IntPtr properties, string key, string val)
{
appcenter_unity_custom_properties_set_string(properties, key, val);
}
public static void SetNumber(IntPtr properties, string key, int val)
{
appcenter_unity_custom_properties_set_number(properties, key, NSNumberHelper.Convert(val));
}
public static void SetNumber(IntPtr properties, string key, long val)
{
appcenter_unity_custom_properties_set_number(properties, key, NSNumberHelper.Convert(val));
}
public static void SetNumber(IntPtr properties, string key, float val)
{
appcenter_unity_custom_properties_set_number(properties, key, NSNumberHelper.Convert(val));
}
public static void SetNumber(IntPtr properties, string key, double val)
{
appcenter_unity_custom_properties_set_number(properties, key, NSNumberHelper.Convert(val));
}
public static void SetBool(IntPtr properties, string key, bool val)
{
appcenter_unity_custom_properties_set_bool(properties, key, val);
}
public static void SetDate(IntPtr properties, string key, DateTime val)
{
appcenter_unity_custom_properties_set_date(properties, key, NSDateHelper.DateTimeConvert(val));
}
public static void Clear(IntPtr properties, string key)
{
appcenter_unity_custom_properties_clear(properties, key);
}
#region External
[DllImport("__Internal")]
private static extern IntPtr appcenter_unity_custom_properties_create();
[DllImport("__Internal")]
private static extern void appcenter_unity_custom_properties_set_string(IntPtr properties, string key, string val);
[DllImport("__Internal")]
private static extern void appcenter_unity_custom_properties_set_number(IntPtr properties, string key, IntPtr val);
[DllImport("__Internal")]
private static extern void appcenter_unity_custom_properties_set_bool(IntPtr properties, string key, bool val);
[DllImport("__Internal")]
private static extern void appcenter_unity_custom_properties_set_date(IntPtr properties, string key, IntPtr val);
[DllImport("__Internal")]
private static extern void appcenter_unity_custom_properties_clear(IntPtr properties, string key);
#endregion
}
}
#endif

Просмотреть файл

@ -1,12 +0,0 @@
fileFormatVersion: 2
guid: dd933e7104204430682354c11c40d2f2
timeCreated: 1498515938
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

Просмотреть файл

@ -20,7 +20,7 @@ namespace Microsoft.AppCenter.Unity.Crashes
public class Crashes
{
// Used by App Center Unity Editor Extensions: https://github.com/Microsoft/AppCenter-SDK-Unity-Extension
public const string CrashesSDKVersion = "4.0.0";
public const string CrashesSDKVersion = "4.4.0";
private static bool _reportUnhandledExceptions = false;
private static bool _enableErrorAttachmentsCallbacks = false;
private static readonly object _objectLock = new object();

Просмотреть файл

@ -23,7 +23,7 @@ namespace Microsoft.AppCenter.Unity.Crashes.Internal
var values = properties == null ? null : properties.Values.ToArray();
var propertyCount = properties == null ? 0 : properties.Count;
var nativeAttachments = NativeObjectsConverter.ToNativeAttachments(attachments);
return appcenter_unity_crashes_track_model_exception_with_properties_with_attachments(exception, keys, values, propertyCount, nativeAttachments);
return appcenter_unity_crashes_track_exception_with_properties_with_attachments(exception, keys, values, propertyCount, nativeAttachments);
}
public static AppCenterTask SetEnabledAsync(bool isEnabled)
@ -144,7 +144,7 @@ namespace Microsoft.AppCenter.Unity.Crashes.Internal
private static extern bool appcenter_unity_crashes_has_received_memory_warning_in_last_session();
[DllImport("__Internal")]
private static extern string appcenter_unity_crashes_track_model_exception_with_properties_with_attachments(IntPtr exception, string[] propertyKeys, string[] propertyValues, int propertyCount, IntPtr attachments);
private static extern string appcenter_unity_crashes_track_exception_with_properties_with_attachments(IntPtr exception, string[] propertyKeys, string[] propertyValues, int propertyCount, IntPtr attachments);
[DllImport("__Internal")]
private static extern void appcenter_unity_crashes_set_enabled(bool isEnabled);

Просмотреть файл

@ -27,6 +27,15 @@ namespace Microsoft.AppCenter.Unity.Distribute.Internal
var releaseDetails = ReleaseDetailsHelper.ReleaseDetailsConvert(details);
return Distribute.ReleaseAvailable.Invoke(releaseDetails);
}
void onNoReleaseAvailable(AndroidJavaObject activity)
{
if (Distribute.NoReleaseAvailable == null)
{
return;
}
Distribute.NoReleaseAvailable.Invoke();
}
}
}
#endif

Просмотреть файл

@ -4,6 +4,7 @@
#if UNITY_ANDROID && !UNITY_EDITOR
using System;
using System.Collections.Generic;
using Microsoft.AppCenter.Unity.Internal;
using UnityEngine;
namespace Microsoft.AppCenter.Unity.Distribute.Internal
@ -72,9 +73,14 @@ namespace Microsoft.AppCenter.Unity.Distribute.Internal
_distribute.CallStatic("notifyUpdateAction", nativeAction);
}
public static void CheckForUpdate()
{
_distribute.CallStatic("checkForUpdate");
public static void CheckForUpdate()
{
_distribute.CallStatic("checkForUpdate");
}
public static void StartDistribute()
{
AppCenterInternal.Start(AppCenter.Distribute);
}
}
}

Просмотреть файл

@ -44,6 +44,10 @@ namespace Microsoft.AppCenter.Unity.Distribute.Internal
{
}
public static void StartDistribute()
{
}
public static void CheckForUpdate()
{
}

Просмотреть файл

@ -16,7 +16,7 @@ namespace Microsoft.AppCenter.Unity.Distribute
public class Distribute
{
// Used by App Center Unity Editor Extensions: https://github.com/Microsoft/AppCenter-SDK-Unity-Extension
public const string DistributeSDKVersion = "4.0.0";
public const string DistributeSDKVersion = "4.4.0";
public static void PrepareEventHandlers()
{
@ -70,6 +70,29 @@ namespace Microsoft.AppCenter.Unity.Distribute
get; set;
}
/// <summary>
/// Sets the app will exit callback.
/// </summary>
/// <value>The app will exit callback.</value>
public static WillExitAppCallback WillExitApp
{
get; set;
}
/// <summary>
/// Sets the no release available callback.
/// </summary>
/// <value>The no release available callback.</value>
public static NoReleaseAvailableCallback NoReleaseAvailable
{
get; set;
}
public static void StartDistribute()
{
DistributeInternal.StartDistribute();
}
/// <summary>
/// If update dialog is customized by returning <c>true</c> in <see cref="ReleaseAvailableCallback"/>,
/// You need to tell the distribute SDK using this function what is the user action.

Просмотреть файл

@ -7,4 +7,14 @@ namespace Microsoft.AppCenter.Unity.Distribute
/// Release available callback.
/// </summary>
public delegate bool ReleaseAvailableCallback(ReleaseDetails releaseDetails);
/// <summary>
/// App will exit callback.
/// </summary>
public delegate void WillExitAppCallback();
/// <summary>
/// No Release available callback.
/// </summary>
public delegate void NoReleaseAvailableCallback();
}

Просмотреть файл

@ -41,6 +41,10 @@ namespace Microsoft.AppCenter.Unity.Distribute.Internal
{
}
public static void StartDistribute()
{
}
public static void CheckForUpdate()
{
}

Просмотреть файл

@ -15,10 +15,15 @@ namespace Microsoft.AppCenter.Unity.Distribute.Internal
#if ENABLE_IL2CPP
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
#endif
delegate void WillExitAppDelegate();
delegate void NoReleaseAvailableDelegate();
delegate bool ReleaseAvailableDelegate(IntPtr details);
static WillExitAppDelegate willExitAppDel;
static NoReleaseAvailableDelegate noReleaseDel;
static ReleaseAvailableDelegate del;
static IntPtr ptr;
[MonoPInvokeCallback(typeof(ReleaseAvailableDelegate))]
static bool ReleaseAvailableFunc(IntPtr details)
{
@ -29,6 +34,18 @@ namespace Microsoft.AppCenter.Unity.Distribute.Internal
var releaseDetails = ReleaseDetailsHelper.ReleaseDetailsConvert(details);
return Distribute.ReleaseAvailable.Invoke(releaseDetails);
}
[MonoPInvokeCallback(typeof(NoReleaseAvailableDelegate))]
static void NoReleaseAvailableFunc()
{
Distribute.NoReleaseAvailable?.Invoke();
}
[MonoPInvokeCallback(typeof(WillExitAppDelegate))]
static void WillExitAppFunc()
{
Distribute.WillExitApp?.Invoke();
}
#endregion
public static void PrepareEventHandlers()
@ -46,7 +63,16 @@ namespace Microsoft.AppCenter.Unity.Distribute.Internal
{
appcenter_unity_distribute_set_delegate();
del = ReleaseAvailableFunc;
willExitAppDel = WillExitAppFunc;
noReleaseDel = NoReleaseAvailableFunc;
appcenter_unity_distribute_set_release_available_impl(del);
appcenter_unity_distribute_set_no_release_available_impl(noReleaseDel);
appcenter_unity_distribute_set_will_exit_app_impl(willExitAppDel);
}
public static void StartDistribute()
{
appcenter_unity_start_distribute();
}
public static void AddNativeType(List<IntPtr> nativeTypes)
@ -109,6 +135,12 @@ namespace Microsoft.AppCenter.Unity.Distribute.Internal
[DllImport("__Internal")]
private static extern void appcenter_unity_distribute_set_release_available_impl(ReleaseAvailableDelegate functionPtr);
[DllImport("__Internal")]
private static extern void appcenter_unity_distribute_set_will_exit_app_impl(WillExitAppDelegate functionPtr);
[DllImport("__Internal")]
private static extern void appcenter_unity_distribute_set_no_release_available_impl(NoReleaseAvailableDelegate functionPtr);
[DllImport("__Internal")]
private static extern void appcenter_unity_distribute_replay_release_available();
@ -118,6 +150,9 @@ namespace Microsoft.AppCenter.Unity.Distribute.Internal
[DllImport("__Internal")]
private static extern void appcenter_unity_distribute_check_for_update();
[DllImport("__Internal")]
private static extern void appcenter_unity_start_distribute();
#endregion
}
}

Просмотреть файл

@ -12,3 +12,5 @@ extern "C" bool appcenter_unity_analytics_is_enabled();
extern "C" MSACAnalyticsTransmissionTarget *appcenter_unity_analytics_transmission_target_for_token(char* transmissionTargetToken);
extern "C" void appcenter_unity_analytics_pause();
extern "C" void appcenter_unity_analytics_resume();
extern "C" void appcenter_unity_analytics_enable_manual_session_tracker();
extern "C" void appcenter_unity_analytics_start_session();

Просмотреть файл

@ -51,3 +51,13 @@ void appcenter_unity_analytics_resume()
{
[MSACAnalytics resume];
}
void appcenter_unity_analytics_enable_manual_session_tracker()
{
[MSACAnalytics enableManualSessionTracker];
}
void appcenter_unity_analytics_start_session()
{
[MSACAnalytics startSession];
}

Просмотреть файл

@ -33,6 +33,7 @@ enum StartupMode {
static NSString *const kMSAppSecret = @"appcenter-app-secret";
static NSString *const kMSTargetToken = @"appcenter-transmission-target-token";
static NSString *const kMSCustomLogUrl = @"custom-log-url";
static NSString *const kMSCustomAllowNetworkRequests = @"allow-network-requests";
static NSString *const kMSCustomApiUrl = @"custom-api-url";
static NSString *const kMSCustomInstallUrl = @"custom-install-url";
static NSString *const kMSStartTargetKey = @"MSAppCenterStartTargetUnityKey";
@ -40,6 +41,7 @@ static NSString *const kMSStorageSizeKey = @"MSAppCenterMaxStorageSizeUnityKey";
static NSString *const kMSLogUrlKey = @"MSAppCenterLogUrlUnityKey";
static NSString *const kMSAppSecretKey = @"MSAppCenterAppSecretUnityKey";
static NSString *const kMSUpdateTrackKey = @"MSAppCenterUpdateTrackUnityKey";
static NSString *const kMSEnableManualSessionTrackerKey = @"enable-manual-session-tracker";
static const int kMSLogLevel = 0 /*LOG_LEVEL*/;
static const int kMSStartupType = 0 /*STARTUP_TYPE*/;
@ -96,7 +98,6 @@ static const int kMSUpdateTrack = 1 /*UPDATE_TRACK*/;
#ifdef APPCENTER_UNITY_USE_CUSTOM_INSTALL_URL
[MSACDistribute setInstallUrl:kMSCustomInstallUrl];
#endif // APPCENTER_UNITY_USE_CUSTOM_INSTALL_URL
[classes addObject:MSACDistribute.class];
#ifdef APPCENTER_DISTRIBUTE_DISABLE_AUTOMATIC_CHECK_FOR_UPDATE
[MSACDistribute disableAutomaticCheckForUpdate];
@ -112,6 +113,10 @@ static const int kMSUpdateTrack = 1 /*UPDATE_TRACK*/;
[MSACAppCenter setLogUrl:kMSCustomLogUrl];
#endif
}
[MSACAppCenter setNetworkRequestsAllowed:[kMSCustomAllowNetworkRequests boolValue]];
if ([kMSEnableManualSessionTrackerKey boolValue]) {
[MSACAnalytics enableManualSessionTracker];
}
NSString *customAppSecret = [[NSUserDefaults standardUserDefaults] objectForKey:kMSAppSecretKey];
NSString *customAppSecretValue = customAppSecret == nil ? kMSAppSecret : customAppSecret;
switch (startTargetValue) {

Просмотреть файл

@ -9,13 +9,14 @@ extern "C" bool appcenter_unity_is_configured();
extern "C" void appcenter_unity_set_log_url(const char* logUrl);
extern "C" void appcenter_unity_set_user_id(char* userId);
extern "C" void appcenter_unity_set_enabled(bool isEnabled);
extern "C" void appcenter_unity_set_network_requests_allowed(bool isAllowed);
extern "C" bool appcenter_unity_is_network_requests_allowed();
extern "C" bool appcenter_unity_is_enabled();
extern "C" const char* appcenter_unity_get_sdk_version();
extern "C" const char* appcenter_unity_get_install_id();
extern "C" void appcenter_unity_start(const char* appSecret, void** services, int count);
extern "C" void appcenter_unity_start_no_secret(void** services, int count);
extern "C" void appcenter_unity_start_from_library(void** services, int count);
extern "C" void appcenter_unity_set_custom_properties(MSACCustomProperties* properties);
extern "C" void appcenter_unity_set_wrapper_sdk(const char* wrapperSdkVersion,
const char* wrapperSdkName,
const char* wrapperRuntimeVersion,

Просмотреть файл

@ -44,6 +44,16 @@ void appcenter_unity_set_enabled(bool isEnabled)
[MSACAppCenter setEnabled:isEnabled];
}
void appcenter_unity_set_network_requests_allowed(bool isAllowed)
{
[MSACAppCenter setNetworkRequestsAllowed:isAllowed];
}
bool appcenter_unity_is_network_requests_allowed()
{
return [MSACAppCenter isNetworkRequestsAllowed];
}
void appcenter_unity_start(const char* appSecret, void** services, int count) {
NSMutableArray<Class>* servicesArray = get_services_array(services, count);
[MSACAppCenter start:appcenter_unity_cstr_to_ns_string(appSecret) withServices:servicesArray];
@ -75,11 +85,6 @@ const char* appcenter_unity_get_sdk_version()
return appcenter_unity_ns_string_to_cstr([MSACAppCenter sdkVersion]);
}
void appcenter_unity_set_custom_properties(MSACCustomProperties* properties)
{
[MSACAppCenter setCustomProperties:properties];
}
void appcenter_unity_set_wrapper_sdk(const char* wrapperSdkVersion,
const char* wrapperSdkName,
const char* wrapperRuntimeVersion,

Просмотреть файл

@ -1,13 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
#import <AppCenter/AppCenter.h>
#import <Foundation/Foundation.h>
// Don't need to return value because reference is kept by wrapper
extern "C" MSACCustomProperties* appcenter_unity_custom_properties_create();
extern "C" void appcenter_unity_custom_properties_set_string(MSACCustomProperties* properties, char* key, char* val);
extern "C" void appcenter_unity_custom_properties_set_number(MSACCustomProperties* properties, char* key, NSNumber* val);
extern "C" void appcenter_unity_custom_properties_set_bool(MSACCustomProperties* properties, char* key, bool val);
extern "C" void appcenter_unity_custom_properties_set_date(MSACCustomProperties* properties, char* key, NSDate* val);
extern "C" void appcenter_unity_custom_properties_clear(MSACCustomProperties* properties, char* key);

Просмотреть файл

@ -1,33 +0,0 @@
fileFormatVersion: 2
guid: 3b9806201870a40199602233a9b5a765
timeCreated: 1498515104
licenseType: Pro
PluginImporter:
serializedVersion: 2
iconMap: {}
executionOrder: {}
isPreloaded: 0
isOverridable: 0
platformData:
data:
first:
Any:
second:
enabled: 0
settings: {}
data:
first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
data:
first:
iPhone: iOS
second:
enabled: 1
settings: {}
userData:
assetBundleName:
assetBundleVariant:

Просмотреть файл

@ -1,36 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
#import "CustomProperties.h"
#import <AppCenter/AppCenter.h>
#import <Foundation/Foundation.h>
MSACCustomProperties* appcenter_unity_custom_properties_create()
{
return [[MSACCustomProperties alloc] init];
}
void appcenter_unity_custom_properties_set_string(MSACCustomProperties* properties, char* key, char* val)
{
[properties setString:[NSString stringWithUTF8String:val] forKey:[NSString stringWithUTF8String:key]];
}
void appcenter_unity_custom_properties_set_number(MSACCustomProperties* properties, char* key, NSNumber* val)
{
[properties setNumber:val forKey:[NSString stringWithUTF8String:key]];
}
void appcenter_unity_custom_properties_set_bool(MSACCustomProperties* properties, char* key, bool val)
{
[properties setBool:val forKey:[NSString stringWithUTF8String:key]];
}
void appcenter_unity_custom_properties_set_date(MSACCustomProperties* properties, char* key, NSDate* val)
{
[properties setDate:val forKey:[NSString stringWithUTF8String:key]];
}
void appcenter_unity_custom_properties_clear(MSACCustomProperties* properties, char* key)
{
[properties clearPropertyForKey:[NSString stringWithUTF8String:key]];
}

Просмотреть файл

@ -1,33 +0,0 @@
fileFormatVersion: 2
guid: 6cee2815ee4e04655909ecaba350282c
timeCreated: 1498515094
licenseType: Pro
PluginImporter:
serializedVersion: 2
iconMap: {}
executionOrder: {}
isPreloaded: 0
isOverridable: 0
platformData:
data:
first:
Any:
second:
enabled: 0
settings: {}
data:
first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
data:
first:
iPhone: iOS
second:
enabled: 1
settings: {}
userData:
assetBundleName:
assetBundleVariant:

Просмотреть файл

@ -7,10 +7,10 @@
#import <Foundation/Foundation.h>
#import <AppCenterCrashes/AppCenterCrashes.h>
@class MSACException;
@class MSACExceptionModel;
extern "C" void* appcenter_unity_crashes_get_type();
extern "C" void* appcenter_unity_crashes_track_model_exception_with_properties_with_attachments(MSACException* exception, char** propertyKeys, char** propertyValues, int propertyCount, NSArray<MSACErrorAttachmentLog*>* attachments);
extern "C" void* appcenter_unity_crashes_track_exception_with_properties_with_attachments(MSACExceptionModel* exception, char** propertyKeys, char** propertyValues, int propertyCount, NSArray<MSACErrorAttachmentLog*>* attachments);
extern "C" void appcenter_unity_crashes_set_enabled(bool isEnabled);
extern "C" bool appcenter_unity_crashes_has_received_memory_warning_in_last_session();
extern "C" bool appcenter_unity_crashes_is_enabled();

Просмотреть файл

@ -9,7 +9,6 @@
#import "../Core/Utility/NSStringHelper.h"
#import "CrashesUnity.h"
#import "CrashesDelegate.h"
#import "MSACException.h"
#import "NSStringHelper.h"
void* appcenter_unity_crashes_get_type()
@ -17,10 +16,10 @@ void* appcenter_unity_crashes_get_type()
return (void *)CFBridgingRetain([MSACCrashes class]);
}
void* appcenter_unity_crashes_track_model_exception_with_properties_with_attachments(MSACException* exception, char** propertyKeys, char** propertyValues, int propertyCount, NSArray<MSACErrorAttachmentLog*>* attachments)
void* appcenter_unity_crashes_track_exception_with_properties_with_attachments(MSACExceptionModel* exception, char** propertyKeys, char** propertyValues, int propertyCount, NSArray<MSACErrorAttachmentLog*>* attachments)
{
NSDictionary<NSString*, NSString*> *properties = appcenter_unity_create_ns_string_dictionary(propertyKeys, propertyValues, propertyCount);
NSString *errorId = [MSACWrapperCrashesHelper trackModelException:exception withProperties:properties withAttachments:attachments];
NSString *errorId = [MSACCrashes trackException:exception withProperties:properties attachments:attachments];
return (void *)appcenter_unity_ns_string_to_cstr(errorId);
}

Просмотреть файл

@ -1,11 +1,9 @@
#import <Foundation/Foundation.h>
@interface MSACException : NSObject
@interface MSACExceptionModel : NSObject
@property(nonatomic, copy) NSString *type;
@property(nonatomic, copy) NSString *message;
@property(nonatomic, copy) NSString *stackTrace;
@property(nonatomic) NSArray<MSACException *> *innerExceptions;
@property(nonatomic, copy) NSString *wrapperSdkName;
@end

Просмотреть файл

@ -1,14 +1,15 @@
fileFormatVersion: 2
guid: 244f3fabf24b448638f5f50eb7a3c4af
timeCreated: 1512660421
licenseType: Free
guid: a753e0df757854ab8a71dafb0331b58a
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
Any:

Просмотреть файл

@ -0,0 +1,9 @@
#import <Foundation/Foundation.h>
#import "MSACExceptionModel.h"
@interface MSACWrapperExceptionModel : MSACExceptionModel
@property(nonatomic) NSArray<MSACWrapperExceptionModel *> *innerExceptions;
@property(nonatomic, copy) NSString *wrapperSdkName;
@end

Просмотреть файл

@ -0,0 +1,27 @@
fileFormatVersion: 2
guid: 47ae337184a0642259853aaf18b811be
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
Any:
second:
enabled: 1
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
userData:
assetBundleName:
assetBundleVariant:

Просмотреть файл

@ -1,13 +1,13 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
#import "MSACException.h"
#import "MSACWrapperExceptionModel.h"
#import <Foundation/Foundation.h>
// Don't need to return value because reference is kept by wrapper
extern "C" MSACException* appcenter_unity_exception_create();
extern "C" void appcenter_unity_exception_set_type(MSACException* exception, char* type);
extern "C" void appcenter_unity_exception_set_message(MSACException* exception, char* message);
extern "C" void appcenter_unity_exception_set_stacktrace(MSACException* exception, char* stacktrace);
extern "C" void appcenter_unity_exception_set_inner_exception(MSACException* exception, MSACException* innerException);
extern "C" void appcenter_unity_exception_set_wrapper_sdk_name(MSACException* exception, char* sdkName);
extern "C" MSACWrapperExceptionModel* appcenter_unity_exception_create();
extern "C" void appcenter_unity_exception_set_type(MSACWrapperExceptionModel* exception, char* type);
extern "C" void appcenter_unity_exception_set_message(MSACWrapperExceptionModel* exception, char* message);
extern "C" void appcenter_unity_exception_set_stacktrace(MSACWrapperExceptionModel* exception, char* stacktrace);
extern "C" void appcenter_unity_exception_set_inner_exception(MSACWrapperExceptionModel* exception, MSACWrapperExceptionModel* innerException);
extern "C" void appcenter_unity_exception_set_wrapper_sdk_name(MSACWrapperExceptionModel* exception, char* sdkName);

Просмотреть файл

@ -5,33 +5,33 @@
#import "WrapperException.h"
#import <Foundation/Foundation.h>
MSACException* appcenter_unity_exception_create()
MSACWrapperExceptionModel* appcenter_unity_exception_create()
{
return [[MSACException alloc] init];
return [[MSACWrapperExceptionModel alloc] init];
}
void appcenter_unity_exception_set_type(MSACException* exception, char* type)
void appcenter_unity_exception_set_type(MSACWrapperExceptionModel* exception, char* type)
{
[exception setType:[NSString stringWithUTF8String:type]];
}
void appcenter_unity_exception_set_message(MSACException* exception, char* message)
void appcenter_unity_exception_set_message(MSACWrapperExceptionModel* exception, char* message)
{
[exception setMessage:[NSString stringWithUTF8String:message]];
}
void appcenter_unity_exception_set_stacktrace(MSACException* exception, char* stacktrace)
void appcenter_unity_exception_set_stacktrace(MSACWrapperExceptionModel* exception, char* stacktrace)
{
[exception setStackTrace:appcenter_unity_cstr_to_ns_string(stacktrace)];
}
void appcenter_unity_exception_set_inner_exception(MSACException* exception, MSACException* innerException)
void appcenter_unity_exception_set_inner_exception(MSACWrapperExceptionModel* exception, MSACWrapperExceptionModel* innerException)
{
NSArray* innerExceptions = @[innerException];
[exception setInnerExceptions:innerExceptions];
}
void appcenter_unity_exception_set_wrapper_sdk_name(MSACException* exception, char* sdkName)
void appcenter_unity_exception_set_wrapper_sdk_name(MSACWrapperExceptionModel* exception, char* sdkName)
{
[exception setWrapperSdkName:[NSString stringWithUTF8String:sdkName]];
}

Просмотреть файл

@ -7,11 +7,17 @@
#import <AppCenterDistribute/AppCenterDistribute.h>
typedef bool (__cdecl *ReleaseAvailableFunction)(MSACReleaseDetails*);
typedef void (__cdecl *WillExitAppFunction)();
typedef void (__cdecl *NoReleaseAvailableFunction)();
@interface UnityDistributeDelegate : NSObject<MSACDistributeDelegate>
- (BOOL)distribute:(MSACDistribute *)distribute releaseAvailableWithDetails:(MSACReleaseDetails *)details;
- (void)distributeNoReleaseAvailable:(MSACDistribute *)distribute;
- (void)distributeWillExitApp:(MSACDistribute *)distribute;
- (void)setReleaseAvailableImplementation:(ReleaseAvailableFunction)implementation;
- (void)setNoReleaseAvailableImplementation:(NoReleaseAvailableFunction)implementation;
- (void)setWillExitAppImplementation:(WillExitAppFunction)implementation;
- (void)replayReleaseAvailable;
+ (instancetype) sharedInstance;

Просмотреть файл

@ -9,6 +9,8 @@
@property MSACReleaseDetails *unprocessedDetails;
@property NSObject *lockObject;
@property ReleaseAvailableFunction releaseAvailableHandler;
@property WillExitAppFunction willExitAppHandler;
@property NoReleaseAvailableFunction noReleaseAvailableHandler;
@end
@ -39,6 +41,18 @@
}
}
- (void)setWillExitAppImplementation:(WillExitAppFunction)implementation {
@synchronized (_lockObject) {
_willExitAppHandler = implementation;
}
}
- (void)setNoReleaseAvailableImplementation:(NoReleaseAvailableFunction)implementation {
@synchronized (_lockObject) {
_noReleaseAvailableHandler = implementation;
}
}
- (BOOL)distribute:(MSACDistribute *)distribute releaseAvailableWithDetails:(MSACReleaseDetails *)details {
ReleaseAvailableFunction handlerCopy = nil;
@synchronized (_lockObject) {
@ -50,7 +64,17 @@
}
}
- (void) replayReleaseAvailable {
- (void) distributeWillExitApp:(MSACDistribute *)distribute {
WillExitAppFunction handlerCopy = nil;
@synchronized (_lockObject) {
handlerCopy = _willExitAppHandler;
}
if (handlerCopy) {
handlerCopy();
}
}
- (void)replayReleaseAvailable {
ReleaseAvailableFunction handlerCopy = nil;
MSACReleaseDetails *unprocessedCopy = _unprocessedDetails;
@synchronized (_lockObject) {
@ -62,4 +86,15 @@
}
}
- (void)distributeNoReleaseAvailable:(MSACDistribute *)distribute {
NoReleaseAvailableFunction handlerCopy = nil;
@synchronized (_lockObject) {
handlerCopy = _noReleaseAvailableHandler;
if (handlerCopy) {
handlerCopy();
}
return;
}
}
@end

Просмотреть файл

@ -15,7 +15,10 @@ extern "C" void appcenter_unity_distribute_set_api_url(char* apiUrl);
extern "C" void appcenter_unity_distribute_notify_update_action(int updateAction);
extern "C" void appcenter_unity_distribute_replay_release_available();
extern "C" void appcenter_unity_distribute_set_release_available_impl(ReleaseAvailableFunction handler);
extern "C" void appcenter_unity_distribute_set_will_exit_app_impl(WillExitAppFunction handler);
extern "C" void appcenter_unity_distribute_set_no_release_available_impl(NoReleaseAvailableFunction handler);
extern "C" void appcenter_unity_distribute_set_delegate();
extern "C" void appcenter_unity_distribute_check_for_update();
extern "C" void appcenter_unity_start_distribute();
#endif

Просмотреть файл

@ -2,6 +2,7 @@
// Licensed under the MIT license.
#import "DistributeUnity.h"
#import <AppCenter/MSACAppCenter.h>
#import "DistributeDelegate.h"
#import <Foundation/Foundation.h>
@ -45,6 +46,21 @@ void appcenter_unity_distribute_set_release_available_impl(ReleaseAvailableFunct
[[UnityDistributeDelegate sharedInstance] setReleaseAvailableImplementation:function];
}
void appcenter_unity_distribute_set_will_exit_app_impl(WillExitAppFunction function)
{
[[UnityDistributeDelegate sharedInstance] setWillExitAppImplementation:function];
}
void appcenter_unity_distribute_set_no_release_available_impl(NoReleaseAvailableFunction function)
{
[[UnityDistributeDelegate sharedInstance] setNoReleaseAvailableImplementation:function];
}
void appcenter_unity_start_distribute()
{
[MSACAppCenter startService:MSACDistribute.class];
}
void appcenter_unity_distribute_replay_release_available()
{
[[UnityDistributeDelegate sharedInstance] replayReleaseAvailable];

Просмотреть файл

@ -15,5 +15,8 @@
<type fullname="Microsoft.AppCenter.Unity.Crashes.Crashes">
<method name="StartCrashes"/>
</type>
<type fullname="Microsoft.AppCenter.Unity.Distribute.Distribute">
<method name="StartDistribute"/>
</type>
</assembly>
</linker>

Просмотреть файл

@ -0,0 +1,85 @@
// This file was added to implicitly specify the gradle version.
// Unity fails to build the project using the default gradle version,
// as it's unable to recognize the attribute "<queries>" in AndroidManifest added to support Android 11.
// Read more here: https://developers.google.com/ar/develop/unity/android-11-build
// Impacting commit: https://github.com/microsoft/appcenter-sdk-android/commit/67855dd9255e74fa75e5751226870a7466343619
buildscript {
repositories {**ARTIFACTORYREPOSITORY**
mavenCentral()
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.0.0'
**BUILD_SCRIPT_DEPS**}
}
configurations {
compileClasspath
}
allprojects {
repositories {**ARTIFACTORYREPOSITORY**
mavenCentral()
google()
jcenter()
flatDir {
dirs 'libs'
}
}
}
apply plugin: 'com.android.library'
**APPLY_PLUGINS**
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
**DEPS**}
android {
compileSdkVersion **APIVERSION**
buildToolsVersion '**BUILDTOOLS**'
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
defaultConfig {
consumerProguardFiles 'proguard-unity.txt'**USER_PROGUARD**
minSdkVersion **MINSDKVERSION**
targetSdkVersion **TARGETSDKVERSION**
ndk {
abiFilters **ABIFILTERS**
}
versionCode **VERSIONCODE**
versionName '**VERSIONNAME**'
}
lintOptions {
abortOnError false
}
aaptOptions {
noCompress = ['.ress', '.resource', '.obb'] + unityStreamingAssets.tokenize(', ')
}**SIGN**
buildTypes {
debug {
minifyEnabled **MINIFY_DEBUG**
useProguard **PROGUARD_DEBUG**
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-unity.txt'**USER_PROGUARD**
jniDebuggable true
}
release {
minifyEnabled **MINIFY_RELEASE**
useProguard **PROGUARD_RELEASE**
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-unity.txt'**USER_PROGUARD****SIGNCONFIG**
}
}**PACKAGING_OPTIONS**
**BUILT_APK_LOCATION**
}**REPOSITORIES****SOURCE_BUILD_SETUP**

Просмотреть файл

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: c87764456db564d5b81b3e366247bd8f
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

Просмотреть файл

@ -37,10 +37,15 @@ public class BuildPuppet
{
var ndkLocation = arg;
var subdir = System.IO.Directory.GetDirectories(ndkLocation).Single();
Debug.Log("Setting NDK location to " + subdir);
#if UNITY_2021_3_OR_NEWER
Debug.Log($"Setting NDK location to {subdir}, via AndroidExternalToolsSettings");
UnityEditor.Android.AndroidExternalToolsSettings.ndkRootPath = subdir;
#else
Debug.Log($"Setting NDK location to {subdir}, via EditorPrefs");
EditorPrefs.SetString("AndroidNdkRoot", subdir);
EditorPrefs.SetString("AndroidNdkRootR16b", subdir);
Debug.Log("NDK Location is now '" + EditorPrefs.GetString("AndroidNdkRoot") + "'");
#endif
break;
}
if (arg == "-NdkLocation")

Просмотреть файл

@ -33,6 +33,11 @@ public class PuppetAnalytics : MonoBehaviour
StartCoroutine(SetEnabledCoroutine(enabled));
}
public void StartSession()
{
Analytics.StartSession();
}
public void SetIsCritical(bool critical)
{
_isCritical = IsCritical.isOn;

Просмотреть файл

@ -19,6 +19,7 @@ public class PuppetAppCenter : MonoBehaviour
public static int StartupTypeCached = 2;
public static readonly EventWaitHandle StorageReadyEvent = new ManualResetEvent(false);
public Toggle Enabled;
public Toggle AllowNetworkRequests;
public Text InstallIdLabel;
public Text DeviceIdLabel;
public Text SdkVersionLabel;
@ -40,7 +41,6 @@ public class PuppetAppCenter : MonoBehaviour
private const string LogUrlAndroidKey = "AppCenter.Unity.LogUrlKey";
private const string AppSecretKey = "MSAppCenterAppSecretUnityKey";
private const string AppSecretAndroidKey = "AppCenter.Unity.AppSecretKey";
public GameObject CustomProperty;
public RectTransform PropertiesList;
public Toggle DistributeEnabled;
public Toggle CustomDialog;
@ -65,32 +65,6 @@ public class PuppetAppCenter : MonoBehaviour
DistributeEnabled.isOn = isEnabled.Result;
}
public void AddProperty()
{
var property = Instantiate(CustomProperty);
property.transform.SetParent(PropertiesList, false);
}
public void Send()
{
AppCenter.SetCustomProperties(GetProperties());
}
private CustomProperties GetProperties()
{
var properties = PropertiesList.GetComponentsInChildren<PuppetCustomProperty>();
if (properties == null || properties.Length == 0)
{
return null;
}
var result = new CustomProperties();
foreach (var i in properties)
{
i.Set(result);
}
return result;
}
private void Awake()
{
var customUserId = PlayerPrefs.GetString(UserIdKey);
@ -133,6 +107,7 @@ public class PuppetAppCenter : MonoBehaviour
private IEnumerator OnEnableCoroutine()
{
AllowNetworkRequests.isOn = AppCenter.NetworkRequestsAllowed;
var isEnabled = AppCenter.IsEnabledAsync();
yield return isEnabled;
Enabled.isOn = isEnabled.Result;
@ -182,6 +157,11 @@ public class PuppetAppCenter : MonoBehaviour
StartCoroutine(SetEnabledCoroutine(enabled));
}
public void SetAllowNetworkRequests(bool isAllowed)
{
AppCenter.NetworkRequestsAllowed = isAllowed;
}
private IEnumerator SetEnabledCoroutine(bool enabled)
{
yield return AppCenter.SetEnabledAsync(enabled);

Просмотреть файл

@ -1,80 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
using System;
using System.Globalization;
using Microsoft.AppCenter.Unity;
using UnityEngine;
using UnityEngine.UI;
public class PuppetCustomProperty : MonoBehaviour
{
public InputField Key;
public Dropdown Type;
public InputField Value;
public Toggle Boolean;
public void Set(CustomProperties properties)
{
switch (Type.value)
{
case 0: // Clear
properties.Clear(Key.text);
break;
case 1: // Boolean
properties.Set(Key.text, Boolean.isOn);
break;
case 2: // Number
if (Value.text.Contains(CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator))
{
properties.Set(Key.text, float.Parse(Value.text));
}
else
{
properties.Set(Key.text, int.Parse(Value.text));
}
break;
case 3: // DateTime
properties.Set(Key.text, DateTime.Parse(Value.text));
break;
case 4: // String
properties.Set(Key.text, Value.text);
break;
}
}
public void SetType(int type)
{
switch (type)
{
case 0: // Clear
Boolean.gameObject.SetActive(false);
Value.gameObject.SetActive(false);
break;
case 1: // Boolean
Boolean.gameObject.SetActive(true);
Value.gameObject.SetActive(false);
break;
case 2: // Number
Boolean.gameObject.SetActive(false);
Value.gameObject.SetActive(true);
Value.contentType = InputField.ContentType.DecimalNumber;
break;
case 3: // DateTime
Boolean.gameObject.SetActive(false);
Value.gameObject.SetActive(true);
Value.contentType = InputField.ContentType.Standard;
break;
case 4: // String
Boolean.gameObject.SetActive(false);
Value.gameObject.SetActive(true);
Value.contentType = InputField.ContentType.Alphanumeric;
break;
}
}
public void Remove()
{
Destroy(gameObject);
}
}

Просмотреть файл

@ -1,12 +0,0 @@
fileFormatVersion: 2
guid: b1f0f25c9ed5e2243aaea3fccd646df3
timeCreated: 1501070595
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

Просмотреть файл

@ -15,6 +15,8 @@ public class PuppetReleaseHandler : MonoBehaviour
void Awake()
{
Distribute.ReleaseAvailable = OnReleaseAvailable;
Distribute.WillExitApp = OnWillExitApp;
Distribute.NoReleaseAvailable = OnNoReleaseAvailable;
IsDialogCustom = PlayerPrefs.GetInt(PuppetAppCenter.FlagCustomDialog, 0) == 1;
}
@ -31,6 +33,22 @@ public class PuppetReleaseHandler : MonoBehaviour
}
}
void OnWillExitApp()
{
lock (_releaseLock)
{
Debug.Log("WillExitApp callback invoked.");
}
}
void OnNoReleaseAvailable()
{
lock (_releaseLock)
{
Debug.Log("No release available");
}
}
void Update()
{
if (_releaseDetails == null)

Разница между файлами не показана из-за своего большого размера Загрузить разницу

1
BreakpadSupport/.gitignore поставляемый
Просмотреть файл

@ -9,6 +9,7 @@ gen/
out/
# Gradle files
.cxx/
.gradle/
build/
/*/build/

Просмотреть файл

@ -8,10 +8,9 @@ include $(CLEAR_VARS)
LOCAL_MODULE := PuppetBreakpad
LOCAL_SRC_FILES := main.cpp
LOCAL_CPPFLAGS := -D__NDK_R16B__
LOCAL_LDFLAGS := -latomic
LOCAL_LALIBS += -llog
LOCAL_STATIC_LIBRARIES += breakpad_client
TARGET_OUT = ../../Assets/Plugins/Android/
TARGET_OUT = $(LOCAL_PATH)/../../../../../Assets/Plugins/Android/$(TARGET_ARCH_ABI)
include $(BUILD_SHARED_LIBRARY)

Просмотреть файл

@ -1,5 +1,5 @@
APP_STL := c++_static
APP_OPTIM := release
APP_ABI := armeabi-v7a
APP_PLATFORM := android-27
APP_ABI := all
APP_PLATFORM := android-30
APP_BUILD_SCRIPT := Android.mk

Просмотреть файл

@ -1,17 +1,16 @@
apply plugin: 'com.android.library'
android {
compileSdkVersion 28
compileSdkVersion 30
defaultConfig {
minSdkVersion 16
targetSdkVersion 28
targetSdkVersion 30
versionCode 1
versionName "1.0"
externalNativeBuild {
ndkBuild {
arguments "NDK_APPLICATION_MK=Application.mk", "V=1"
abiFilters "armeabi-v7a"
arguments "NDK_APPLICATION_MK=Application.mk", "V=1", "NDK_LOG=1"
}
}
}

Просмотреть файл

@ -3,20 +3,24 @@
buildscript {
repositories {
google()
jcenter()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.0'
classpath 'com.android.tools.build:gradle:4.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
configurations {
compileClasspath
}
allprojects {
repositories {
google()
jcenter()
mavenCentral()
}
}

Двоичные данные
BreakpadSupport/gradle/wrapper/gradle-wrapper.jar поставляемый

Двоичный файл не отображается.

Просмотреть файл

@ -1,6 +1,5 @@
#Tue Aug 14 14:14:35 MSK 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip

139
BreakpadSupport/gradlew поставляемый
Просмотреть файл

@ -1,4 +1,20 @@
#!/usr/bin/env bash
#!/usr/bin/env sh
#
# Copyright 2015 the original author or authors.
#
# 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
#
# https://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.
#
##############################################################################
##
@ -6,42 +22,6 @@
##
##############################################################################
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
warn ( ) {
echo "$*"
}
die ( ) {
echo
echo "$*"
echo
exit 1
}
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
esac
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
@ -60,8 +40,49 @@ cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
warn () {
echo "$*"
}
die () {
echo
echo "$*"
echo
exit 1
}
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
NONSTOP* )
nonstop=true
;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
@ -85,7 +106,7 @@ location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
@ -105,10 +126,11 @@ if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
# For Cygwin or MSYS, switch paths to Windows format before running java
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
@ -134,27 +156,30 @@ if $cygwin ; then
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
i=`expr $i + 1`
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
0) set -- ;;
1) set -- "$args0" ;;
2) set -- "$args0" "$args1" ;;
3) set -- "$args0" "$args1" "$args2" ;;
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi
# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
function splitJvmOpts() {
JVM_OPTS=("$@")
# Escape application args
save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
APP_ARGS=`save "$@"`
exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
exec "$JAVACMD" "$@"

179
BreakpadSupport/gradlew.bat поставляемый
Просмотреть файл

@ -1,90 +1,89 @@
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:init
@rem Get command-line arguments, handling Windowz variants
if not "%OS%" == "Windows_NT" goto win9xME_args
if "%@eval[2+2]" == "4" goto 4NT_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
goto execute
:4NT_args
@rem Get arguments from the 4NT Shell from JP Software
set CMD_LINE_ARGS=%$
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega
@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem https://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto execute
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto execute
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega

Просмотреть файл

@ -1,5 +1,170 @@
# App Center SDK for Unity Change Log
## Version 4.4.1 (Under active development)
#### Android
* **[Fix]** Fix building the Unity Player Android client from a Linux OS.
___
## Version 4.4.0
### App Center
#### iOS/Android/UWP
* **[Breaking change]** Remove `AppCenter.SetCustomProperties` API.
#### iOS
* **[Fix]** Fix throw an exception when checking to authenticate MAC value during decryption.
#### Android
* **[Fix]** Fix crash in `AppCenterLoader` during call `getContext()` API when an application uses a custom context for initializing SDK. Such context should contain `getApplicationContext()` API which must return default Android application context.
### App Center Analytics
#### iOS/Android/UWP
* **[Feature]** Add `Analytics.EnableManualSessionTracker` and `Analytics.StartSession` APIs for tracking session manually.
* **[Feature]** Increase the interval between sending logs from 3 to 6 seconds for the backend load optimization.
### App Center Distribute
#### Android
* **[Feature]** Replace installing a new release using the deprecated intent action `ACTION_INSTALL_PACKAGE` with the `PackageInstaller` API.
* **[Feature]** Remove the download manager task if the download doesn't start within 10 seconds.
* **[Feature]** Add sumcheck on the downloaded file before starting the install process.
* **[Fix]** Fix a crash after discarding the installation if the download of a new release was interrupted in the previous application start and resumed in the current one.
#### iOS
* **[Fix]** Cancel authorization process if application is not active, otherwise `ASWebAuthenticationSession` will fail opening browser and update flow will end up being in a broken state. This only affects updating from a private distribution group.
___
## Version 4.3.0
### AppCenter
#### UWP
* **[Fix]** Fix sending pending logs after the first application start.
#### iOS/Android
* **[Feature]** Improved `AES` token encryption algorithm using `Encrypt-then-MAC` data authentication approach.
### App Center Crashes
#### iOS
* **[Improvement]** Update PLCrashReporter to 1.10.
### App Center Distribute
#### Android
* **[Fix]** Fix a rare deadlock case when a new version starts downloading and at the same moment the download status is checked.
* **[Fix]** Fix passing pending intent flag for a completed download notification on Android lower then 23 API.
___
## Version 4.2.0
### AppCenter
* **[Feature]** Add a `AppCenter.IsNetworkRequestsAllowed` API to block any network requests without disabling the SDK.
* **[Fix]** Remove `android:allowBackup` and `android:supportsRtl` from `AndroidManifest.xml` in `appcenter-loader`, to prevent these attributes from merging into the final `AndroidManifest.xml` in a client app.
#### UWP
* **[Fix]** Fix infinite loop when old logs cannot be purged by a new one with a different channel name in a case when the storage is full.
### App Center Crashes
#### iOS
* **[Fix]** Merge the device information from the crash report with the SDK's device information in order to fix some time sensitive cases where the reported application information was incorrect.
* **[Improvement]** Update PLCrashReporter to 1.9.0.
### App Center Distribute
#### Android
* **[Fix]** Fix crash during downloading a new release when `minifyEnabled` settings is true.
* **[Fix]** Add a missing tag `android:exported` to the manifest required for Android 12.
* **[Fix]** Fix ARR modules unlinking which worked correctly only if the project is built twice due to link/unlink logic stored in PostBuild. Logic has been moved to the PreBuild.
___
## Version 4.1.1
### AppCenter
#### iOS
* **[Improvement]** Use ASWebAuthenticationSession for authentication on iOS 12 or later.
### App Center Crashes
#### Android
* **[Fix]** Fix formatting of stack trace in the `ErrorReport`.
### App Center Distribute
#### Android
* **[Fix]** Fix `NullPointerException` occurring when settings dialog was intended to be shown, but there is no foreground activity at that moment.
* **[Fix]** Fix a crash when download manager application was disabled.
* **[Fix]** Fix showing the title in the push notification while downloading a new release.
#### iOS
* **[Fix]** Fix `kMSACUpdateTokenRequestIdKey` never gets removed.
___
## Release 4.1.0
### AppCenter
#### UWP
* **[Feature]** Add a `SetMaxStorageSizeAsync` API which allows setting a maximum size limit on the local SQLite storage. The default value is 10MiB.
#### iOS
* **[Fix]** Fix a crash when SQLite returns zero for `page_size`.
### App Center Distribute
#### iOS/Android
* **[Feature]** Add `NoReleaseAvailable` callback to distribute listener.
* **[Fix]** Fix show the custom dialog update after the application start.
#### iOS
* **[Feature]** Add `WillExitApp` callback to distribute listener.
#### Android
* **[Fix]** Fix a crash when the app is trying to open the system settings screen from the background.
* **[Fix]** Fix browser opening when using a private distribution group on Android 11.
### App Center Crashes
#### Android
* **[Fix]** Fix removing throwable files after rewriting error logs due to small database size.
___
## Release 4.0.0
### App Center

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше