Skip to content

Commit

Permalink
Merge pull request #598 from adjust/v4383
Browse files Browse the repository at this point in the history
Version 4.38.3
  • Loading branch information
shashanksu authored Mar 26, 2024
2 parents e4222a8 + 809e72e commit 65b3b8a
Show file tree
Hide file tree
Showing 28 changed files with 409 additions and 100 deletions.
3 changes: 2 additions & 1 deletion Adjust/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@ ext {
coreMinSdkVersion = 9
coreCompileSdkVersion = 34
coreTargetSdkVersion = 34
coreVersionName = '4.38.2'
coreVersionName = '4.38.3'
defaultVersionCode = 1
webbridgeMinSdkVersion = 17
samsungReferrerMinSdkVersion = 18
vivoReferrerMinSdkVersion = 23
samsungCloudDevMinSdkVersion = 23

// POM.
adjustGroupId = 'com.adjust.sdk'
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 @@ -34,7 +34,7 @@ private Adjust() {
*/
public static synchronized AdjustInstance getDefaultInstance() {
@SuppressWarnings("unused")
String VERSION = "!SDK-VERSION-STRING!:com.adjust.sdk:adjust-android:4.38.2";
String VERSION = "!SDK-VERSION-STRING!:com.adjust.sdk:adjust-android:4.38.3";

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 SCHEME = "https";
String AUTHORITY = "app.adjust.com";
String CLIENT_SDK = "android4.38.2";
String CLIENT_SDK = "android4.38.3";
String LOGTAG = "Adjust";
String REFTAG = "reftag";
String INSTALL_REFERRER = "install_referrer";
Expand Down
10 changes: 10 additions & 0 deletions Adjust/sdk-core/src/main/java/com/adjust/sdk/DeviceInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ class DeviceInfo {
int uiMode;
String appSetId;
boolean isGooglePlayGamesForPC;
Boolean isSamsungCloudEnvironment;

Map<String, String> imeiParameters;
Map<String, String> oaidParameters;
Expand Down Expand Up @@ -134,12 +135,21 @@ class DeviceInfo {
appInstallTime = getAppInstallTime(packageInfo);
appUpdateTime = getAppUpdateTime(packageInfo);
uiMode = getDeviceUiMode(configuration);
if (Reflection.isAppRunningInSamsungCloudEnvironment(context, adjustConfig.logger)) {
isSamsungCloudEnvironment = true;
playAdId = Reflection.getSamsungCloudDevGoogleAdId(context, adjustConfig.logger);
playAdIdSource = "samsung_cloud_sdk";
}
if (Util.canReadPlayIds(adjustConfig)) {
appSetId = Reflection.getAppSetId(context);
}
}

void reloadPlayIds(final AdjustConfig adjustConfig) {
if (isSamsungCloudEnvironment != null && isSamsungCloudEnvironment) {
return;
}

if (!Util.canReadPlayIds(adjustConfig)) {
return;
}
Expand Down
26 changes: 26 additions & 0 deletions Adjust/sdk-core/src/main/java/com/adjust/sdk/Reflection.java
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,32 @@ public static String getAppSetId(Context context) {
}
}

public static String getSamsungCloudDevGoogleAdId(Context context, ILogger logger) {
String googleAdId = null;
try {
googleAdId = (String) invokeStaticMethod("com.adjust.sdk.samsung.clouddev.Util",
"getGoogleAdId",
new Class[]{Context.class, ILogger.class},
context, logger);
} catch (Exception e) {
logger.info("invoke getGoogleAdId : " + e.getMessage());
}
return googleAdId;
}

public static boolean isAppRunningInSamsungCloudEnvironment(Context context, ILogger logger) {
boolean isCloudEnvironment = false;
try {
isCloudEnvironment = (boolean) invokeStaticMethod("com.adjust.sdk.samsung.clouddev.Util",
"isAppRunningInCloudEnvironment",
new Class[]{Context.class, ILogger.class},
context, logger);
} catch (Exception e) {
logger.info("invoke isAppRunningInCloudEnvironment : " + e.getMessage());
}
return isCloudEnvironment;
}

public static Class forName(String className) {
try {
Class classObject = Class.forName(className);
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 @@ -30,7 +30,7 @@ dependencies {
// Add SDK via module.
compileOnly project(':sdk-core')
// Add SDK via Maven.
// implementation 'com.adjust.sdk:adjust-android:4.38.2'
// implementation 'com.adjust.sdk:adjust-android:4.38.3'
}

// read local properties
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 @@ -30,7 +30,7 @@ dependencies {
// Add SDK via module.
compileOnly project(':sdk-core')
// Add SDK via Maven.
// implementation 'com.adjust.sdk:adjust-android:4.38.2'
// implementation 'com.adjust.sdk:adjust-android:4.38.3'
}

// read local properties
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 @@ -33,7 +33,7 @@ dependencies {
// Add SDK via module.
compileOnly project(':sdk-core')
// Add SDK via Maven.
// implementation 'com.adjust.sdk:adjust-android:4.38.2'
// implementation 'com.adjust.sdk:adjust-android:4.38.3'
implementation 'com.huawei.hms:ads-identifier:3.4.56.300'
}

Expand Down
2 changes: 2 additions & 0 deletions Adjust/sdk-plugin-samsung-clouddev/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/build
/libs
223 changes: 223 additions & 0 deletions Adjust/sdk-plugin-samsung-clouddev/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,223 @@
apply plugin: 'com.android.library'
apply plugin: 'maven-publish'
apply plugin: 'signing'

repositories {
maven {
url "https://oss.sonatype.org/content/repositories/staging/"
}
}

android {
compileSdkVersion rootProject.ext.coreCompileSdkVersion
publishing {
multipleVariants {
allVariants()
withJavadocJar()
}
}
defaultConfig {
minSdkVersion rootProject.ext.samsungCloudDevMinSdkVersion
targetSdkVersion rootProject.ext.coreTargetSdkVersion
}
namespace 'com.adjust.sdk.samsung.clouddev'
}

dependencies {
// Add SDK via module.
compileOnly project(':sdk-core')
// Add SDK via Maven.
// implementation 'com.adjust.sdk:adjust-android:4.38.3'

// Add Samsung clouddev lib.
compileOnly fileTree(include: ['*.aar'], dir: 'libs')
}

// read local properties
File localPropsFile = project.rootProject.file('local.properties')
if (localPropsFile.exists()) {
Properties p = new Properties()
new FileInputStream(localPropsFile).withCloseable { is ->
p.load(is)
}
p.each { name, value ->
ext[name] = value
}
}

task adjustSamsungCloudDevPluginAar(type: Copy) {
dependsOn 'assembleRelease'

from('build/outputs/aar/')
include 'sdk-plugin-samsung-clouddev-release.aar'
destinationDir file('build/libs/')
rename 'sdk-plugin-samsung-clouddev-release.aar', "${project.name}.aar"

}

task adjustSamsungCloudDevPluginJar(type: Jar) {
dependsOn 'packageReleaseAssets'
dependsOn 'compileReleaseJavaWithJavac'

from('build/intermediates/library_assets/release/packageReleaseAssets/out/') {
into('assets')
}
from('build/intermediates/javac/release/classes/')

archiveFileName = project.provider { "${project.name}.jar" }
}


task adjustSamsungCloudDevPluginSourcesJar(type: Jar) {
setArchiveClassifier('sources')
from android.sourceSets.main.java.srcDirs
}

artifacts {
archives adjustSamsungCloudDevPluginJar
archives adjustSamsungCloudDevPluginSourcesJar
}

afterEvaluate {
publishing {
publications {
/*
mavenAndroidSamsungCloudDevJar(MavenPublication) {
customizePomForJar(pom)
groupId rootProject.ext.adjustGroupId
artifactId 'adjust-android-samsung-clouddev'
version rootProject.ext.coreVersionName
artifact adjustSamsungCloudDevPluginJar
artifact adjustSamsungCloudDevPluginSourcesJar
}
*/
mavenAndroidSamsungCloudDevAar(MavenPublication) {
customizePomForAar(pom)
groupId rootProject.ext.adjustGroupId
artifactId 'adjust-android-samsung-clouddev'
version rootProject.ext.coreVersionName

artifact("$buildDir/outputs/aar/sdk-plugin-samsung-clouddev-release.aar") {
builtBy tasks.getByPath("adjustSamsungCloudDevPluginAar")
}
artifact adjustSamsungCloudDevPluginSourcesJar
}
}

repositories {
maven {
url "https://oss.sonatype.org/service/local/staging/deploy/maven2"
if (project.hasProperty("sonatypeUsername")) {
credentials {
username sonatypeUsername
password sonatypePassword
}
}
}
}
}
signing {
// sign publishing.publications.mavenAndroidSamsungCloudDevJar
sign publishing.publications.mavenAndroidSamsungCloudDevAar
}
}

def customizePomForJar(pom) {
pom.withXml {
def root = asNode()

// Add all items necessary for maven central publication.
root.children().last() + {
resolveStrategy = Closure.DELEGATE_FIRST
description 'The Samsung CloudDev plugin for Adjust SDK for Android'
name 'Adjust Android SDK Samsung CloudDev plugin'
url 'https://github.com/adjust/android_sdk'

organization {
name 'adjust GmbH'
url 'http://www.adjust.com'
}
licenses {
license {
name 'MIT License'
url 'http://www.opensource.org/licenses/mit-license.php'
}
}
scm {
url '[email protected]:adjust/android_sdk.git'
connection 'scm:git:[email protected]:adjust/android_sdk.git'
developerConnection 'scm:git:[email protected]:adjust/android_sdk.git'
}
developers {
developer {
name 'Pedro Silva'
email '[email protected]'
}
developer {
name 'Ugljesa Erceg'
email '[email protected]'
}
}
}
}
}

def customizePomForAar(pom) {
pom.withXml {
def root = asNode()

// Add all items necessary for maven central publication.
root.children().last() + {
resolveStrategy = Closure.DELEGATE_FIRST
description 'The Samsung CloudDev plugin for Adjust SDK for Android'
name 'Adjust Android SDK Samsung CloudDev plugin'
url 'https://github.com/adjust/android_sdk'

organization {
name 'adjust GmbH'
url 'http://www.adjust.com'
}
licenses {
license {
name 'MIT License'
url 'http://www.opensource.org/licenses/mit-license.php'
}
}
scm {
url '[email protected]:adjust/android_sdk.git'
connection 'scm:git:[email protected]:adjust/android_sdk.git'
developerConnection 'scm:git:[email protected]:adjust/android_sdk.git'
}
developers {
developer {
name 'Pedro Silva'
email '[email protected]'
}
developer {
name 'Ugljesa Erceg'
email '[email protected]'
}
}
}
}
}

model {
// tasks.generatePomFileForMavenAndroidSamsungCloudDevJarPublication {
// destination = file("${project.buildDir}/generated-pom.xml")
// }
/* TODO check if/how to replace this tasks
tasks.publishMavenAndroidSamsungCloudDevPublicationToMavenLocal {
dependsOn project.tasks.signArchives
}
tasks.publishMavenAndroidSamsungCloudDevPublicationToMavenRepository {
dependsOn project.tasks.signArchives
}
*/
tasks.generatePomFileForMavenAndroidSamsungCloudDevAarPublication {
destination = file("${project.buildDir}/generated-pom.xml")
}
}


23 changes: 23 additions & 0 deletions Adjust/sdk-plugin-samsung-clouddev/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile

-keepclassmembers, includecode class com.samsung.android.game.cloudgame.dev.sdk.* { *;}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="com.google.android.gms.permission.AD_ID" />
</manifest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package com.adjust.sdk.samsung.clouddev;

import android.content.Context;

public class AdjustSamsungCloudDev {

static boolean shouldUseSamsungCloudDevSdk = true;

public static void useSamsungCloudDevSdk(Context context) {
shouldUseSamsungCloudDevSdk = true;
}

public static void doNotUseSamsungCloudDevSdk() {
shouldUseSamsungCloudDevSdk = false;
}
}
Loading

0 comments on commit 65b3b8a

Please sign in to comment.