Skip to content
This repository has been archived by the owner on Feb 19, 2020. It is now read-only.

Commit

Permalink
Merge pull request #40 from bitstadium/develop
Browse files Browse the repository at this point in the history
Develop to master
  • Loading branch information
Anna Kocheshkova authored May 23, 2019
2 parents 87eb6bd + 63d127a commit eabf07d
Show file tree
Hide file tree
Showing 17 changed files with 53 additions and 17 deletions.
12 changes: 12 additions & 0 deletions Documentation/Changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
## Changelog

### Version 5.2.0

This release wraps HockeySDK-Android 5.2.0.

* **[Improvement]** Replaced obsolete `WWW` request calls with the new `UnityWebRequest` version.

#### Changelog for HockeySDK-Android 5.2.0

* **[Bugfix]** Leaking HTTP connection.
* **[Bugfix]** Fix HTTPS connection creation.
* **[Security]** To enforce TLS 1.2 on all HTTPS connections the SDK makes, we are dropping support for API level 15 (which supports only TLS 1.0), the minimum SDK version thus becomes 16. Previous versions of the SDK were already using TLS 1.2 on API level 16+.

### Version 5.1.1

This release wraps HockeySDK-Android 5.1.0.
Expand Down
6 changes: 3 additions & 3 deletions ExampleGame/Assets/HockeyAppUnityAndroid/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="net.hockeyapp.unity"
android:versionCode="19"
android:versionName="5.1.1" >
android:versionCode="20"
android:versionName="5.2.0" >

<uses-sdk
android:minSdkVersion="15"
android:minSdkVersion="16"
android:targetSdkVersion="27" />

<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Version: 5.1.1
* Version: 5.2.0
*/

using UnityEngine;
Expand Down
Binary file not shown.
Binary file not shown.
Binary file modified ExampleGame/Assets/HockeyAppUnityAndroid/README.pdf
Binary file not shown.
Binary file not shown.
4 changes: 2 additions & 2 deletions HockeyAppUnityPlugin/hockeysdk-unity/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ android {
compileSdkVersion 27

defaultConfig {
minSdkVersion 15
minSdkVersion 16
targetSdkVersion 27
}

Expand All @@ -24,5 +24,5 @@ repositories {
}

dependencies {
compile(name:'HockeySDK-5.1.0', ext:'aar')
compile(name:'HockeySDK-5.2.0', ext:'aar')
}
Binary file not shown.
Binary file not shown.
6 changes: 3 additions & 3 deletions Plugins/HockeyAppUnityAndroid/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="net.hockeyapp.unity"
android:versionCode="19"
android:versionName="5.1.1" >
android:versionCode="20"
android:versionName="5.2.0" >

<uses-sdk
android:minSdkVersion="15"
android:minSdkVersion="16"
android:targetSdkVersion="27" />

<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Version: 5.1.1
* Version: 5.2.0
*/

using UnityEngine;
Expand All @@ -8,6 +8,9 @@
using System;
using System.IO;
using System.Runtime.InteropServices;
#if UNITY_2017_1_OR_NEWER
using UnityEngine.Networking;
#endif

public class HockeyAppAndroid : MonoBehaviour
{
Expand Down Expand Up @@ -412,7 +415,12 @@ protected virtual IEnumerator SendLogs (List<string> logs)
{
var sdkName = pluginClass.CallStatic<string>("getSdkName");
if (sdkName != null) {
#if UNITY_2017_1_OR_NEWER
url += "?sdk=" + UnityWebRequest.EscapeURL(sdkName);
#else
url += "?sdk=" + WWW.EscapeURL(sdkName);
#endif

}
}
#endif
Expand All @@ -421,12 +429,24 @@ protected virtual IEnumerator SendLogs (List<string> logs)
WWWForm postForm = CreateForm (log);
string lContent = postForm.headers ["Content-Type"].ToString ();
lContent = lContent.Replace ("\"", "");
Dictionary<string,string> headers = new Dictionary<string,string> ();
headers.Add ("Content-Type", lContent);
WWW www = new WWW (url, postForm.data, headers);

#if UNITY_2017_1_OR_NEWER
UnityWebRequest postRequest = new UnityWebRequest(url, "POST");
postRequest.SetRequestHeader("Content-Type", lContent);
postRequest.downloadHandler = (DownloadHandler)new DownloadHandlerBuffer();
postRequest.uploadHandler = (UploadHandler)new UploadHandlerRaw(postForm.data);

yield return postRequest.SendWebRequest();

if (!postRequest.isNetworkError) {
#else
Dictionary<string, string> headers = new Dictionary<string, string>();
headers.Add("Content-Type", lContent);
WWW www = new WWW(url, postForm.data, headers);
yield return www;

if (String.IsNullOrEmpty (www.error)) {
if (String.IsNullOrEmpty(www.error)) {
#endif
try {
File.Delete (log);
} catch (Exception e) {
Expand All @@ -435,7 +455,11 @@ protected virtual IEnumerator SendLogs (List<string> logs)
}
} else {
if (Debug.isDebugBuild)
Debug.Log ("Crash sending error: " + www.error);
#if UNITY_2017_1_OR_NEWER
Debug.Log ("Crash sending error: " + postRequest.error);
#else
Debug.Log("Crash sending error: " + www.error);
#endif
}
}
}
Expand Down
Binary file removed Plugins/HockeyAppUnityAndroid/HockeySDK-5.1.0.aar
Binary file not shown.
Binary file not shown.
Binary file modified Plugins/HockeyAppUnityAndroid/README.pdf
Binary file not shown.
Binary file not shown.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Version 5.1.1
# Version 5.2.0

## Introduction

Expand Down Expand Up @@ -32,7 +32,7 @@ This document contains the following sections:

* [Changelog](Documentation/Changelog.md)
* Unity 5.0 or newer (SDK versions with Unity 4 support can be found at the [Unity Asset Store](https://www.assetstore.unity3d.com/en/?gclid=CO) or by switching to the 1.0.3 tag on GitHub).
* Android API level 15 or later.
* Android API level 16 or later.

## <a name="2"></a>Installation & Setup

Expand Down

0 comments on commit eabf07d

Please sign in to comment.