Skip to content

Commit

Permalink
Merge pull request #14 from adjust/v4130
Browse files Browse the repository at this point in the history
Version 4.13.0
  • Loading branch information
uerceg authored May 29, 2018
2 parents 77117c4 + 0f1cc94 commit 38becfa
Show file tree
Hide file tree
Showing 31 changed files with 1,016 additions and 437 deletions.
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
### Version 4.13.0 (29th May 2018)
#### Added
- Added `set_app_secret` method to `adjust_config` structure.
- Added `adjust_GdprForgetMe()` method to enable possibility for user to be forgotten in accordance with GDPR law.

#### Fixed
- Fixed issue of creating and destroying lots of threads on certain Android API levels (https://github.com/adjust/android_sdk/issues/265).

#### Changed
- Updated native iOS SDK to version **4.13.0**.
- Updated native Android SDK to version **4.13.0**.

---

### Version 4.11.0 (10th February 2017)
#### Added
- Added `adid` property to the attribution callback response.
Expand Down
185 changes: 118 additions & 67 deletions README.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.11.0
4.13.0
29 changes: 29 additions & 0 deletions adjust/AdjustMarmalade.s4e
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,11 @@ struct adjust_event {

struct adjust_config {
double* delay_start;
double* secret_id;
double* info_1;
double* info_2;
double* info_3;
double* info_4;
const char* app_token;
const char* environment;
const char* log_level;
Expand Down Expand Up @@ -151,6 +156,11 @@ struct adjust_config {

adjust_config() {
delay_start = NULL;
secret_id = NULL;
info_1 = NULL;
info_2 = NULL;
info_3 = NULL;
info_4 = NULL;
app_token = NULL;
environment = NULL;
log_level = NULL;
Expand All @@ -174,6 +184,11 @@ struct adjust_config {

adjust_config(const char* p_app_token, const char* p_environment) {
delay_start = NULL;
secret_id = NULL;
info_1 = NULL;
info_2 = NULL;
info_3 = NULL;
info_4 = NULL;
app_token = p_app_token;
environment = p_environment;
log_level = NULL;
Expand All @@ -200,6 +215,19 @@ struct adjust_config {
*delay_start = p_delay_start;
}

void set_app_secret(double p_secret_id, double p_info_1, double p_info_2, double p_info_3, double p_info_4) {
secret_id = new double();
*secret_id = p_secret_id;
info_1 = new double();
*info_1 = p_info_1;
info_2 = new double();
*info_2 = p_info_2;
info_3 = new double();
*info_3 = p_info_3;
info_4 = new double();
*info_4 = p_info_4;
}

void set_log_level(const char* p_log_level) {
log_level = p_log_level;
}
Expand Down Expand Up @@ -305,6 +333,7 @@ s3eResult adjust_RemoveSessionCallbackParameter(const char* key) S3E_RESULT_ERRO
s3eResult adjust_RemoveSessionPartnerParameter(const char* key) S3E_RESULT_ERROR
s3eResult adjust_ResetSessionCallbackParameters() S3E_RESULT_ERROR
s3eResult adjust_ResetSessionPartnerParameters() S3E_RESULT_ERROR
s3eResult adjust_GdprForgetMe() S3E_RESULT_ERROR
s3eResult adjust_GetGoogleAdId() S3E_RESULT_ERROR
s3eResult adjust_GetIdfa() S3E_RESULT_ERROR
s3eResult adjust_GetAdid(char** adid) S3E_RESULT_ERROR
Expand Down
2 changes: 1 addition & 1 deletion doc/migrate.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Migrate your adjust SDK for Marmalade to 4.11.0 from 3.4.0
## Migrate your adjust SDK for Marmalade to 4.13.0 from 3.4.0

### SDK initialization

Expand Down
2 changes: 1 addition & 1 deletion ext/Android/sdk
Submodule sdk updated 125 files
2 changes: 1 addition & 1 deletion ext/iOS/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ SRCDIR=./sdk
LIBOUTDIR=../../source/sdk/iOS/
SCRIPTDIR=../../scripts/

(cd $SRCDIR/Scripts; sh adjust_build.sh)
(cd $SRCDIR/Scripts; sh build.sh)

rm -v -rf $LIBOUTDIR/AdjustSdk.framework
cp -v -R $SRCDIR/Frameworks/Static/AdjustSdk.framework $LIBOUTDIR
Expand Down
2 changes: 1 addition & 1 deletion ext/iOS/sdk
Submodule sdk updated 276 files
22 changes: 16 additions & 6 deletions scripts/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def main():
build_android()
if not parsed_args.build_android:
compile_android()
post_compile()
# post_compile()

def LogInput(writeObject):
def Log(message, *args):
Expand Down Expand Up @@ -100,21 +100,25 @@ def build_iphone():
#edit_build_iphone_mkf()

def compile_android():
mkb_android_java = Popen(["mkb", "../adjust/AdjustMarmalade_android_java.mkb"], stdout=PIPE, stderr=PIPE)
mkb_android_java = Popen(["mkb", "../adjust/AdjustMarmalade_android_java.mkb", "--verbose=10"], stdout=PIPE, stderr=PIPE)
out, err = mkb_android_java.communicate()

Log("----------")
Log("mkb android java out: {0}".format(out))
if (mkb_android_java.returncode not in [0]):
print("mkb android java code: {0}, err: {1}".format(
mkb_android_java.returncode, err))
Log("----------")

mkb_android = Popen(["mkb", "../adjust/AdjustMarmalade_android.mkb"], stdout=PIPE, stderr=PIPE)
mkb_android = Popen(["mkb", "../adjust/AdjustMarmalade_android.mkb", "--verbose=10"], stdout=PIPE, stderr=PIPE)
out, err = mkb_android.communicate()

Log("----------")
Log("mkb android out: {0}".format(out))
if (mkb_android.returncode not in [0]):
print("mkb android code: {0}, err: {1}".format(
mkb_android.returncode, err))
Log("----------")

def compile_iphone():
#mkb_iphone = Popen(["mkb", "adjust/AdjustMarmalade_iphone.mkb", "--buildenv=scons"],
Expand Down Expand Up @@ -218,13 +222,15 @@ def move_iphone_source():
Log("Copied iPhone source files!")

def post_compile():
Log("Doing post_compile()!")
shutil.copy("../source/interface/AdjustMarmalade_interface.cpp", "../adjust/interface/AdjustMarmalade_interface.cpp")

def edit_android_mkb():
mkb_filename = "../adjust/AdjustMarmalade_android.mkb"

with open(mkb_filename, "a") as f:
f.write("subproject rapidjson")
Log("Added rapidjson subproject to android mkb")

def edit_android_java_mkb():
mkb_file_lines = []
Expand All @@ -236,7 +242,7 @@ def edit_android_java_mkb():
mkb_file_lines.append(line)
if librarypath_re.search(line):
mkb_file_lines.append("librarypath \"sdk/Android/adjust-android.jar\"\n")
Log("Pppend native SDK jar to android java mkb")
Log("Append native SDK jar to android java mkb")
with open(mkb_filename, "w+") as f:
f.writelines(mkb_file_lines)

Expand All @@ -250,7 +256,7 @@ def edit_mkf(platform):
for line in f:
mkf_file_lines.append(line)
if platform == "iphone" and iphone_links_opts.search(line):
mkf_file_lines.append(" iphone-link-opts=\"-weak_framework iAd\" -weak_framework AdSupport\"\n")
mkf_file_lines.append(" iphone-link-opts=\"-weak_framework iAd\" -weak_framework AdSupport\" -weak_framework CoreTelephony\"\n")
Log("append iphone weak frameworks to mkf")
if platform == "android" and external_jar_re.search(line):
mkf_file_lines.append(" android-external-jars=\"incoming/adjust.jar\"\n")
Expand Down Expand Up @@ -288,14 +294,18 @@ def edit_xcode_project(xcode_project_path):
# Load iOS pbxproj project file.
ios_XcodeProject = XcodeProject.Load(xcode_project_path)

# Add adSupport framework.
# Add AdSupport framework.
ios_XcodeProject.add_file_if_doesnt_exist(framework_path + "AdSupport.framework", tree="SDKROOT", create_build_files=True, weak=True)
Log("Added adSupport framework")

# Add iAd framework.
ios_XcodeProject.add_file_if_doesnt_exist(framework_path + "iAd.framework", tree="SDKROOT", create_build_files=True, weak=True)
Log("Added iAd framework")

# Add CoreTelephony framework.
ios_XcodeProject.add_file_if_doesnt_exist(framework_path + "CoreTelephony.framework", tree="SDKROOT", create_build_files=True, weak=True)
Log("Added CoreTelephony framework")

# Add Adjust framework.
adjust_framework_path = os.path.dirname(os.path.abspath(__file__)) + "../adjust/sdk/ios/"
ios_XcodeProject.add_file_if_doesnt_exist(adjust_framework_path + "AdjustSdk.framework", tree="SDKROOT", create_build_files=True, weak=True)
Expand Down
2 changes: 1 addition & 1 deletion source/AdjustMarmalade.mkf
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ deployments
#iphone-link-opts="-framework X" #Use this to bring in any additional link options needed
iphone-link-lib="AdjustMarmalade"
iphone-link-libdir="lib/iphone"
iphone-link-opts="-weak_framework AdSupport -weak_framework iAd"
iphone-link-opts="-weak_framework AdSupport -weak_framework iAd -weak_framework CoreTelephony"
iphone-link-opts="-F$CWD/sdk/iOS -framework AdjustSdk -ObjC"
}

Expand Down
3 changes: 2 additions & 1 deletion source/adjust_broadcast_receiver.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<receiver android:name="com.adjust.sdk.AdjustReferrerReceiver"
<receiver android:name="com.adjust.sdk.AdjustReferrerReceiver"
android:permission="android.permission.INSTALL_PACKAGES"
android:exported="true" >
<intent-filter>
<action android:name="com.android.vending.INSTALL_REFERRER" />
Expand Down
1 change: 1 addition & 0 deletions source/adjust_permissions.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<uses-permission android:name="android.permission.INTERNET"/>
<!-- ACCESS_WIFI_STATE is not needed if your app is using Google Play Services library -->
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
18 changes: 16 additions & 2 deletions source/android/AdjustMarmalade.java
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@ public void adjust_Start(String appToken,
String logLevel,
String sdkPrefix,
double delayStart,
double secretId,
double info1,
double info2,
double info3,
double info4,
boolean isEventBufferingEnabled,
boolean isSendingInBackgroundEnabled,
boolean shouldDeferredDeeplinkBeOpened,
Expand Down Expand Up @@ -140,6 +145,10 @@ public void adjust_Start(String appToken,
adjustConfig.setDelayStart(delayStart);
}

if (secretId != -1 && info1 != -1 && info2 != -1 && info3 != -1 && info4 != -1) {
adjustConfig.setAppSecret((long)secretId, (long)info1, (long)info2, (long)info3, (long)info4);
}

if (isAttributionCallbackSet) {
adjustConfig.setOnAttributionChangedListener(this);
}
Expand Down Expand Up @@ -221,11 +230,11 @@ public void adjust_SetOfflineMode(boolean isEnabled) {
}

public void adjust_SetReferrer(String referrer) {
Adjust.setReferrer(referrer);
Adjust.setReferrer(referrer, LoaderAPI.getActivity());
}

public void adjust_SetDeviceToken(String deviceToken) {
Adjust.setPushToken(deviceToken);
Adjust.setPushToken(deviceToken, LoaderAPI.getActivity());
}

public void adjust_SendFirstPackages() {
Expand All @@ -251,10 +260,15 @@ public void adjust_RemoveSessionPartnerParameter(String key) {
public void adjust_ResetSessionCallbackParameters() {
Adjust.resetSessionCallbackParameters();
}

public void adjust_ResetSessionPartnerParameters() {
Adjust.resetSessionPartnerParameters();
}

public void adjust_GdprForgetMe() {
Adjust.gdprForgetMe(LoaderAPI.getActivity());
}

public void adjust_GetGoogleAdId() {
if (this.isGoogleAdIdCallbackSet) {
Adjust.getGoogleAdId(LoaderAPI.getActivity(), new OnDeviceIdsRead() {
Expand Down
34 changes: 30 additions & 4 deletions source/android/AdjustMarmalade_platform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ static jmethodID g_adjust_TrackEvent;
static jmethodID g_adjust_SetEnabled;
static jmethodID g_adjust_IsEnabled;
static jmethodID g_adjust_SetOfflineMode;
static jmethodID g_adjust_SetReferrer;
static jmethodID g_adjust_SetDeviceToken;
static jmethodID g_adjust_SendFirstPackages;
static jmethodID g_adjust_AddSessionCallbackParameter;
Expand All @@ -28,13 +29,13 @@ static jmethodID g_adjust_RemoveSessionCallbackParameter;
static jmethodID g_adjust_RemoveSessionPartnerParameter;
static jmethodID g_adjust_ResetSessionCallbackParameters;
static jmethodID g_adjust_ResetSessionPartnerParameters;
static jmethodID g_adjust_OnPause;
static jmethodID g_adjust_OnResume;
static jmethodID g_adjust_SetReferrer;
static jmethodID g_adjust_GdprForgetMe;
static jmethodID g_adjust_GetGoogleAdId;
static jmethodID g_adjust_GetIdfa;
static jmethodID g_adjust_GetAdid;
static jmethodID g_adjust_GetAttribution;
static jmethodID g_adjust_OnPause;
static jmethodID g_adjust_OnResume;

char* get_json_string(rapidjson::Document &jsonDoc, const char* member_name) {
if (!jsonDoc.HasMember(member_name)) {
Expand Down Expand Up @@ -343,7 +344,7 @@ s3eResult AdjustMarmaladeInit_platform() {
}

// Get all the extension methods.
g_adjust_Start = env->GetMethodID(cls, "adjust_Start", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;DZZZLjava/lang/String;Ljava/lang/String;Ljava/lang/String;ZZZZZZZZZ)V");
g_adjust_Start = env->GetMethodID(cls, "adjust_Start", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;DDDDDDZZZLjava/lang/String;Ljava/lang/String;Ljava/lang/String;ZZZZZZZZZ)V");

if (!g_adjust_Start) {
goto fail;
Expand Down Expand Up @@ -427,6 +428,12 @@ s3eResult AdjustMarmaladeInit_platform() {
goto fail;
}

g_adjust_GdprForgetMe = env->GetMethodID(cls, "adjust_GdprForgetMe", "()V");

if (!g_adjust_GdprForgetMe) {
goto fail;
}

g_adjust_GetGoogleAdId = env->GetMethodID(cls, "adjust_GetGoogleAdId", "()V");

if (!g_adjust_GetGoogleAdId) {
Expand Down Expand Up @@ -510,6 +517,11 @@ s3eResult adjust_Start_platform(adjust_config* config) {
jboolean jIsGoogleAdIdCallbackSet = JNI_FALSE;
jboolean jIsIdfaCallbackSet = JNI_FALSE;
jdouble jDelayStart = config->delay_start != NULL ? *(config->delay_start) : -1;
jdouble jSecretId = config->secret_id != NULL ? *(config->secret_id) : -1;
jdouble jInfo1 = config->info_1 != NULL ? *(config->info_1) : -1;
jdouble jInfo2 = config->info_2 != NULL ? *(config->info_2) : -1;
jdouble jInfo3 = config->info_3 != NULL ? *(config->info_3) : -1;
jdouble jInfo4 = config->info_4 != NULL ? *(config->info_4) : -1;

if (config->is_event_buffering_enabled != NULL) {
jIsEventBufferingEnabled = (jboolean)(*(config->is_event_buffering_enabled));
Expand Down Expand Up @@ -602,6 +614,11 @@ s3eResult adjust_Start_platform(adjust_config* config) {
jLogLevel,
jSdkPrefix,
jDelayStart,
jSecretId,
jInfo1,
jInfo2,
jInfo3,
jInfo4,
jIsEventBufferingEnabled,
jIsSendingInBackgroundEnabled,
jShouldDeferredDeeplinkBeOpened,
Expand Down Expand Up @@ -774,6 +791,7 @@ s3eResult adjust_ResetSessionCallbackParameters_platform() {

return (s3eResult)0;
}

s3eResult adjust_ResetSessionPartnerParameters_platform() {
JNIEnv* env = s3eEdkJNIGetEnv();

Expand All @@ -782,6 +800,14 @@ s3eResult adjust_ResetSessionPartnerParameters_platform() {
return (s3eResult)0;
}

s3eResult adjust_GdprForgetMe_platform() {
JNIEnv* env = s3eEdkJNIGetEnv();

env->CallVoidMethod(g_Obj, g_adjust_GdprForgetMe);

return (s3eResult)0;
}

s3eResult adjust_GetGoogleAdId_platform() {
JNIEnv* env = s3eEdkJNIGetEnv();
env->CallVoidMethod(g_Obj, g_adjust_GetGoogleAdId);
Expand Down
7 changes: 6 additions & 1 deletion source/generic/AdjustMarmalade.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ char* adjust_CopyString(const char* source) {
}

s3eResult adjust_Start(adjust_config* config) {
config->set_sdk_prefix("marmalade4.11.0");
config->set_sdk_prefix("marmalade4.13.0");
return adjust_Start_platform(config);
}

Expand Down Expand Up @@ -172,10 +172,15 @@ s3eResult adjust_RemoveSessionPartnerParameter(const char* key) {
s3eResult adjust_ResetSessionCallbackParameters() {
return adjust_ResetSessionCallbackParameters_platform();
}

s3eResult adjust_ResetSessionPartnerParameters() {
return adjust_ResetSessionPartnerParameters_platform();
}

s3eResult adjust_GdprForgetMe() {
return adjust_GdprForgetMe_platform();
}

s3eResult adjust_GetGoogleAdId() {
return adjust_GetGoogleAdId_platform();
}
Expand Down
Loading

0 comments on commit 38becfa

Please sign in to comment.