Skip to content
This repository has been archived by the owner on Aug 17, 2023. It is now read-only.

Commit

Permalink
Merge branch 'release/2.0.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
th-anguyen committed May 25, 2021
2 parents 6129f47 + 7a99f7a commit c9e2dd3
Show file tree
Hide file tree
Showing 6 changed files with 63 additions and 77 deletions.
13 changes: 0 additions & 13 deletions cordova-plugin-one/hooks/android_app_name.js

This file was deleted.

30 changes: 0 additions & 30 deletions cordova-plugin-one/hooks/lib/android-helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,35 +37,5 @@ module.exports = {
var buildGradle = utilities.readBuildGradle();
buildGradle = buildGradle.replace(/\n\s+\/\/ One Cordova Plugin - Start One SDK configuration[\s\S]*\/\/ One Cordova Plugin - End One SDK configuration/, "");
utilities.writeBuildGradle(buildGradle);
},

addApplicationToManifest: function (context) {
logger.log("One plugin: Adding android:name=\"com.thunderhead.ThunderheadApplication\" to AndroidManifest.xml...");
var APP_CLASS = 'com.thunderhead.ThunderheadApplication';
var platformRoot = path.join(context.opts.projectRoot, 'platforms/android');
var manifestFile = path.join(platformRoot, 'app/src/main/AndroidManifest.xml');

if (fs.existsSync(manifestFile)) {
fs.readFile(manifestFile, 'utf8', function (err, data) {
if (err) {
logger.log("One Plugin: Read Manfiest file error: ", err.message);
throw new Error('Unable to find AndroidManifest.xml: ' + err);
}

if (data.indexOf(APP_CLASS) == -1) {
var result = data.replace(/<application/g, '<application android:name="' + APP_CLASS + '"');
fs.writeFile(manifestFile, result, 'utf8', function (err) {
if (err) {
logger.log(":: Manfiest - write file error: ", err.message);
throw new Error('Unable to write AndroidManifest.xml: ' + err);
}
})
} else {
logger.log("One Plugin: Cannot find index of ", APP_CLASS);
}
});
} else {
logger.log("One Plugin: Cannot find AndroidManifest.xml.\n Manifest File: ", manifestFile);
}
}
};
2 changes: 1 addition & 1 deletion cordova-plugin-one/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cordova-plugin-one",
"version": "2.0.1",
"version": "2.0.2",
"description": "One Cordova Plugin for the ONE SDK for iOS and Android",
"homepage": "https://www.thunderhead.com/",
"repository": {
Expand Down
18 changes: 5 additions & 13 deletions cordova-plugin-one/plugin.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<plugin id="cordova-plugin-one" version="2.0.1" xmlns="http://apache.org/cordova/ns/plugins/1.0">
<plugin id="cordova-plugin-one" version="2.0.2" xmlns="http://apache.org/cordova/ns/plugins/1.0">
<name>cordova-plugin-one</name>
<description>One Cordova Plugin for the ONE SDK for iOS and Android</description>
<license>Copyright © 2021 Thunderhead. All rights reserved.</license>
Expand Down Expand Up @@ -55,17 +55,9 @@

<!-- Android -->
<platform name="android">
<hook type="before_build" src="hooks/android_app_name.js" />
<hook type="before_clean" src="hooks/android_app_name.js" />
<hook type="before_compile" src="hooks/android_app_name.js" />
<hook type="before_docs" src="hooks/android_app_name.js" />
<hook type="before_emulate" src="hooks/android_app_name.js" />
<hook type="before_prepare" src="hooks/android_app_name.js" />
<hook type="before_run" src="hooks/android_app_name.js" />
<hook type="before_serve" src="hooks/android_app_name.js" />
<hook type="after_plugin_install" src="hooks/android_app_name.js" />
<hook type="after_platform_add" src="hooks/android_app_name.js" />

<config-file parent="/manifest/application" target="AndroidManifest.xml">
<provider android:authorities="com.thunderhead.provider" android:enabled="true" android:name="com.thunderhead.ThunderheadProvider" />
</config-file>
<config-file parent="/*" target="res/xml/config.xml">
<feature name="One">
<param name="android-package" value="com.thunderhead.plugin.one.OnePlugin" />
Expand All @@ -78,7 +70,7 @@
</config-file>
<source-file src="src/android/OnePlugin.java" target-dir="src/com/thunderhead/plugin/one" />
<source-file src="src/android/OneSdkVersion.java" target-dir="src/com/thunderhead/" />
<source-file src="src/android/ThunderheadApplication.java" target-dir="src/com/thunderhead/" />
<source-file src="src/android/ThunderheadProvider.java" target-dir="src/com/thunderhead/provider" />
<framework src="com.thunderhead.android:one-sdk:9.1.0" />
<framework src="src/android/one.gradle" custom="true" type="gradleReference" />
</platform>
Expand Down
20 changes: 0 additions & 20 deletions cordova-plugin-one/src/android/ThunderheadApplication.java

This file was deleted.

57 changes: 57 additions & 0 deletions cordova-plugin-one/src/android/ThunderheadProvider.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
package com.thunderhead;

import android.util.Log;
import android.content.ContentProvider;
import com.thunderhead.android.api.codeless.OneCodelessInteractionTrackingConfiguration;
import android.content.ContentValues;
import android.database.Cursor;
import android.net.Uri;

public class ThunderheadProvider extends ContentProvider {
protected static final String LOG_TAG = "ThunderheadProvider";

public ThunderheadProvider() {
}

@Override
public int delete(Uri uri, String selection, String[] selectionArgs) {
return 0;
}

@Override
public String getType(Uri uri) {
return null;
}

@Override
public Uri insert(Uri uri, ContentValues values) {
return null;
}

@Override
public boolean onCreate() {
Log.d(LOG_TAG, "Setting default ONE configuration.");

final OneCodelessInteractionTrackingConfiguration codelessInteractionTrackingConfiguration =
new OneCodelessInteractionTrackingConfiguration.Builder()
// disables Fragment/Activity Interaction Tracking
.disableCodelessInteractionTracking(true)
// disables WebView URL Interaction Tracking
.disableWebViewInteractionTracking(true)
.build();
One.setCodelessInteractionTrackingConfiguration(codelessInteractionTrackingConfiguration);
return false;
}

@Override
public Cursor query(Uri uri, String[] projection, String selection,
String[] selectionArgs, String sortOrder) {
return null;
}

@Override
public int update(Uri uri, ContentValues values, String selection,
String[] selectionArgs) {
return 0;
}
}

0 comments on commit c9e2dd3

Please sign in to comment.