Skip to content

Commit

Permalink
Merge pull request #399 from adjust/v4184
Browse files Browse the repository at this point in the history
Version 4.18.4
  • Loading branch information
uerceg authored Nov 15, 2019
2 parents d96c36b + e424734 commit 4566f8a
Show file tree
Hide file tree
Showing 23 changed files with 70 additions and 35 deletions.
2 changes: 1 addition & 1 deletion Adjust/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ ext {
coreMinSdkVersion = 9
coreCompileSdkVersion = 28
coreTargetSdkVersion = 28
coreVersionName = '4.18.3' //append -SNAPSHOT for snapshot version
coreVersionName = '4.18.4' //append -SNAPSHOT for snapshot version
defaultVersionCode = 1

// POM.
Expand Down
2 changes: 1 addition & 1 deletion Adjust/example-app-java/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ dependencies {
// implementation project(':plugin-imei')
// implementation project(":plugin-play")
// Add SDK via Maven.
// implementation 'com.adjust.sdk:adjust-android:4.18.3'
// implementation 'com.adjust.sdk:adjust-android:4.18.4'

debugImplementation 'com.squareup.leakcanary:leakcanary-android:1.6.2'
releaseImplementation 'com.squareup.leakcanary:leakcanary-android-no-op:1.6.2'
Expand Down
2 changes: 1 addition & 1 deletion Adjust/sdk-core/src/main/java/com/adjust/sdk/Adjust.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ private Adjust() {
*/
public static synchronized AdjustInstance getDefaultInstance() {
@SuppressWarnings("unused")
String VERSION = "!SDK-VERSION-STRING!:com.adjust.sdk:adjust-android:4.18.3";
String VERSION = "!SDK-VERSION-STRING!:com.adjust.sdk:adjust-android:4.18.4";

if (defaultInstance == null) {
defaultInstance = new AdjustInstance();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public interface Constants {
String GDPR_URL = "https://gdpr.adjust.com";
String SCHEME = "https";
String AUTHORITY = "app.adjust.com";
String CLIENT_SDK = "android4.18.3";
String CLIENT_SDK = "android4.18.4";
String LOGTAG = "Adjust";
String REFTAG = "reftag";
String INSTALL_REFERRER = "install_referrer";
Expand Down
2 changes: 1 addition & 1 deletion Adjust/sdk-plugin-criteo/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ dependencies {
// Add SDK via module.
compileOnly project(':sdk-core')
// Add SDK via Maven.
// implementation 'com.adjust.sdk:adjust-android:4.18.3'
// implementation 'com.adjust.sdk:adjust-android:4.18.4'
}

task adjustCriteoAndroidAar (type: Copy) {
Expand Down
2 changes: 1 addition & 1 deletion Adjust/sdk-plugin-imei/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ dependencies {
// Add SDK via module.
compileOnly project(':sdk-core')
// Add SDK via Maven.
// implementation 'com.adjust.sdk:adjust-android:4.18.3'
// implementation 'com.adjust.sdk:adjust-android:4.18.4'
}

task adjustImeiAndroidAar (type: Copy) {
Expand Down
2 changes: 1 addition & 1 deletion Adjust/sdk-plugin-oaid/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ dependencies {
// Add SDK via module.
compileOnly project(':sdk-core')
// Add SDK via Maven.
// implementation 'com.adjust.sdk:adjust-android:4.18.3'
// implementation 'com.adjust.sdk:adjust-android:4.18.4'
}

task adjustOaidAndroidAar (type: Copy) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ private synchronized Info getOaidInfo()
OpenDeviceIdentifierService service =
serviceConnector.getOpenDeviceIdentifierService(maxWaitTime, TimeUnit.MILLISECONDS);
if (service == null) {
// since service bind fails due to any reason (even timeout), its reasonable to
// unbind it rather than keeping it open
serviceConnector.unbindAndReset();
return null;
}

Expand All @@ -92,11 +95,17 @@ private OpenDeviceIdentifierConnector getServiceConnector(Context context) {
boolean couldBind = false;

try {
// letting the connector know that it should unbind in all possible failure cases
// also it should attempt to unbind only once after each bind attempt
connector.shouldUnbind();

couldBind = context.bindService(intentForOaidService, connector, Context.BIND_AUTO_CREATE);

if (couldBind) {
return connector;
}
} catch(Exception e) {
logger.error("Fail to bind service %s", e.getMessage());
} finally {
if (!couldBind) {
connector.unbindAndReset();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ public class OpenDeviceIdentifierConnector implements ServiceConnection, IBinder
private BlockingQueue<IBinder> binders = null;
private Context context;
private ILogger logger;
private boolean shouldUnbind = false;

private OpenDeviceIdentifierConnector(Context context, ILogger logger) {
binders = new LinkedBlockingQueue<IBinder>(1);
Expand Down Expand Up @@ -90,21 +91,40 @@ public void binderDied() {
unbindAndReset();
}

public void unbindAndReset() {
context.unbindService(this);
reset();
public synchronized void unbindAndReset() {
if (shouldUnbind) {
try {
shouldUnbind = false;
reset();
context.unbindService(this);
} catch (Exception e) {
logger.error("Fail to unbind %s", e.getMessage());
}
}
}

public void shouldUnbind() {
shouldUnbind = true;
}

private void reset() {
synchronized (lockObject) {
binders.clear();
try {
synchronized (lockObject) {
binders.clear();
}
} catch (Exception e) {
logger.debug("Fail to reset queue %s", e.getMessage());
}
}

private void set(IBinder service) {
synchronized (lockObject) {
binders.clear();
binders.add(service);
try {
synchronized (lockObject) {
binders.clear();
binders.add(service);
}
} catch (Exception e) {
logger.debug("Fail to add in queue %s", e.getMessage());
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion Adjust/sdk-plugin-sociomantic/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ dependencies {
// Add SDK via module.
compileOnly project(':sdk-core')
// Add SDK via Maven.
// implementation 'com.adjust.sdk:adjust-android:4.18.3'
// implementation 'com.adjust.sdk:adjust-android:4.18.4'
}

task adjustSociomanticAndroidAar (type: Copy) {
Expand Down
2 changes: 1 addition & 1 deletion Adjust/sdk-plugin-trademob/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ dependencies {
// Add SDK via module.
compileOnly project(':sdk-core')
// Add SDK via Maven.
// implementation 'com.adjust.sdk:adjust-android:4.18.3'
// implementation 'com.adjust.sdk:adjust-android:4.18.4'
}

task adjustTrademobAndroidAar (type: Copy) {
Expand Down
2 changes: 1 addition & 1 deletion Adjust/sdk-plugin-webbridge/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ dependencies {
// Add SDK via module.
compileOnly project(':sdk-core')
// Add SDK via Maven.
// implementation 'com.adjust.sdk:adjust-android:4.18.3'
// implementation 'com.adjust.sdk:adjust-android:4.18.4'
}

task adjustWebBridgeAndroidAar (type: Copy) {
Expand Down
2 changes: 1 addition & 1 deletion Adjust/sdk-plugin-webbridge/src/main/assets/adjust.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ var Adjust = {
if (this.adjustConfig) {
return this.adjustConfig.getSdkPrefix();
} else {
return 'web-bridge4.18.3';
return 'web-bridge4.18.4';
}
},

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public TestActivityPackage(ActivityPackage activityPackage) {
// default values
appToken = "123456789012";
environment = "sandbox";
clientSdk = "android4.18.3";
clientSdk = "android4.18.4";
suffix = "";
attribution = new AdjustAttribution();
playServices = true;
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
### Version 4.18.4 (15th November 2019)
#### Fixed
- Fixed occasional crash when attempting to unbind from OAID service (relevant only for OAID plugin users).

---

### Version 4.18.3 (9th October 2019)
#### Fixed
- Fixed issue in v4.18.2 where released JAR in Maven was empty (thanks to @calvarez-ov).
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,14 @@ These are the minimum required steps to integrate the Adjust SDK in your Android
If you are using Maven, add the following to your `build.gradle` file:

```gradle
implementation 'com.adjust.sdk:adjust-android:4.18.3'
implementation 'com.adjust.sdk:adjust-android:4.18.4'
implementation 'com.android.installreferrer:installreferrer:1.0'
```

If you would prefer to use the Adjust SDK inside web views in your app, please include this additional dependency as well:

```gradle
implementation 'com.adjust.sdk:adjust-android-webbridge:4.18.3'
implementation 'com.adjust.sdk:adjust-android-webbridge:4.18.4'
```

You can also add the Adjust SDK and web view extension as JAR files, which can be downloaded from our [releases page][releases].
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.18.3
4.18.4
4 changes: 2 additions & 2 deletions doc/chinese/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,14 @@ Read this in other languages: [English][en-readme], [中文][zh-readme], [日本
如果您正在使用Maven,请添加下行至您的`build.gradle`文件:

```gradle
implementation 'com.adjust.sdk:adjust-android:4.18.3'
implementation 'com.adjust.sdk:adjust-android:4.18.4'
implementation 'com.android.installreferrer:installreferrer:1.0'
```

如果您希望在应用的web view中使用Adjust SDK,请同时包含以下附加依赖项:

```gradle
implementation 'com.adjust.sdk:adjust-android-webbridge:4.18.3'
implementation 'com.adjust.sdk:adjust-android-webbridge:4.18.4'
```

您还可以将Adjust SDK和web view扩展名作为JAR文件来添加,这可从我们的[发布页面][releases]中下载。
Expand Down
4 changes: 2 additions & 2 deletions doc/chinese/plugins/oaid.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ OAID 插件支持 Adjust 安卓 SDK 读取设备的 OAID 值 *以及*其默认
如果您使用的是 Maven,请将以下 OAID 插件依赖项添加到现有 Adjust SDK 依赖项旁的 `build.gradle` 文件:

```
implementation 'com.adjust.sdk:adjust-android:4.18.3'
implementation 'com.adjust.sdk:adjust-android-oaid:4.18.3'
implementation 'com.adjust.sdk:adjust-android:4.18.4'
implementation 'com.adjust.sdk:adjust-android-oaid:4.18.4'
```

您还可以将 Adjust OAID 插件作为 JAR 文件进行添加,该文件可从我们的 [版本页面][releases] 下载。
Expand Down
4 changes: 2 additions & 2 deletions doc/english/plugins/oaid.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ To enable the Adjust SDK to collect and track OAID, follow these steps.
If you are using Maven, add the following OAID plugin dependency to your `build.gradle` file next to the existing Adjust SDK dependency:

```
implementation 'com.adjust.sdk:adjust-android:4.18.3'
implementation 'com.adjust.sdk:adjust-android-oaid:4.18.3'
implementation 'com.adjust.sdk:adjust-android:4.18.4'
implementation 'com.adjust.sdk:adjust-android-oaid:4.18.4'
```

You can also add the Adjust OAID plugin as JAR file, which you can download from our [releases page][releases].
Expand Down
4 changes: 2 additions & 2 deletions doc/japanese/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,14 @@ Adjust SDKをAndroidプロジェクトに実装する手順を説明します。
Mavenを使用している場合は、以下の内容を`build.gradle`ファイルに追加します。file:

```gradle
implementation 'com.adjust.sdk:adjust-android:4.18.3'
implementation 'com.adjust.sdk:adjust-android:4.18.4'
implementation 'com.android.installreferrer:installreferrer:1.0'
```

アプリの WebView内で Adjust SDK を使用したい場合は、以下のdependencyを追加してください。

```gradle
implementation 'com.adjust.sdk:adjust-android-webbridge:4.18.3'
implementation 'com.adjust.sdk:adjust-android-webbridge:4.18.4'
```

Adjust SDK およびWebView拡張機能をJAR ファイルとして追加し、Adjust [リリースページ][releases]からダウンロードすることもできます。
Expand Down
4 changes: 2 additions & 2 deletions doc/japanese/plugins/oaid.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ Adjust SDKがOAIDを収集、および計測できるようにするために、
Mavenを使用している場合は、以下のOAIDプラグイン dependencyを、既存のAdjust SDKのdependencyの隣にあるbuild.gradle` file に追加します:

```
implementation 'com.adjust.sdk:adjust-android:4.18.3'
implementation 'com.adjust.sdk:adjust-android-oaid:4.18.3'
implementation 'com.adjust.sdk:adjust-android:4.18.4'
implementation 'com.adjust.sdk:adjust-android-oaid:4.18.4'
```

Adjust OAIDプラグインを JARファイルとして追加することもできます。JARファイルは、[releases page][releases] からダウンロードすることができます。
Expand Down
4 changes: 2 additions & 2 deletions doc/korean/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,14 @@
Maven을 사용하는 경우 `build.gradle` 파일에 다음 라인을 추가합니다.

```gradle
implementation 'com.adjust.sdk:adjust-android:4.18.3'
implementation 'com.adjust.sdk:adjust-android:4.18.4'
implementation 'com.android.installreferrer:installreferrer:1.0'
```

앱의 웹뷰 내에 있는 Adjust SDK를 사용하려면 다음과 같은 추가 종속성도 포함시키십시오.

```gradle
implementation 'com.adjust.sdk:adjust-android-webbridge:4.18.3'
implementation 'com.adjust.sdk:adjust-android-webbridge:4.18.4'
```

또한 Adjust SDK 및 웹뷰 확장자를 JAR 파일로 추가할 수 있으며, 이 파일은 [릴리스 페이지][releases]에서 다운로드할 수 있습니다.
Expand Down

0 comments on commit 4566f8a

Please sign in to comment.