Skip to content

Commit

Permalink
Merge pull request #8 from adtrace/beta
Browse files Browse the repository at this point in the history
android v2.4.0
  • Loading branch information
namini40 authored Jan 14, 2023
2 parents fe493d2 + 98d4e15 commit 3757b93
Show file tree
Hide file tree
Showing 131 changed files with 2,015 additions and 611 deletions.
12 changes: 5 additions & 7 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions .idea/jarRepositories.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,14 +105,14 @@ These are the minimum required steps to integrate the AdTrace SDK in your Androi
If you are using Maven, add the following to your `build.gradle` file:

```java
implementation 'io.adtrace:android-sdk:2.3.0'
implementation 'io.adtrace:android-sdk:2.4.0'
implementation 'com.android.installreferrer:installreferrer:2.2'
```

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

```java
implementation 'io.adtrace:android-sdk-plugin-webbridge:2.3.0'
implementation 'io.adtrace:android-sdk-plugin-webbridge:2.4.0'
```

**Note**: The minimum supported Android API level for the web view extension is 17 (Jelly Bean).
Expand Down Expand Up @@ -1836,7 +1836,7 @@ And a click package added to the SDK's package handler:

```
V/AdTrace: Path: /sdk_click
ClientSdk: android2.1.0
ClientSdk: android2.4.0
Parameters:
app_token adt1exadt1ex
click_time yyyy-MM-dd'T'HH:mm:ss.SSS'Z'Z
Expand Down
1 change: 1 addition & 0 deletions VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2.4.0
1 change: 1 addition & 0 deletions android-sdk-imei-plugin/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
164 changes: 164 additions & 0 deletions android-sdk-imei-plugin/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,164 @@
apply plugin: 'com.android.library'
apply plugin: 'maven-publish'
apply plugin: 'signing'

android {
compileSdkVersion rootProject.ext.coreCompileSdkVersion

defaultConfig {
minSdkVersion rootProject.ext.coreMinSdkVersion
targetSdkVersion rootProject.ext.coreTargetSdkVersion
}


}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
// Add SDK via module.
compileOnly project(':android-sdk')
// Add SDK via Maven.
// implementation 'io.adtrace:android-sdk:2.4.0'
}

// 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 adtraceImeiAndroidAar (type: Copy) {
dependsOn 'assembleRelease'

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

}

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

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

archiveName "${project.name}.jar"
}

task androidJavadocs(type: Javadoc) {
source = android.sourceSets.main.java.srcDirs
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
android.libraryVariants.all { variant ->
if (variant.name == 'release') {
classpath += variant.javaCompileProvider.get().classpath
}
}
}

task adtraceImeiAndroidJavadocsJar(type: Jar) {
dependsOn 'androidJavadocs'
classifier = 'javadoc'
from androidJavadocs.destinationDir
}

task adtraceImeiAndroidSourcesJar(type: Jar) {
classifier = 'sources'
from android.sourceSets.main.java.srcDirs
}

artifacts {
archives adtraceImeiAndroidJar
archives adtraceImeiAndroidJavadocsJar
archives adtraceImeiAndroidSourcesJar
}
publishing {
publications {
mavenAndroidImei(MavenPublication) {
customizePom(pom)
groupId rootProject.ext.adtraceGroupId
artifactId 'android-sdk-plugin-imei'
version rootProject.ext.coreVersionName

artifact adtraceImeiAndroidJar
artifact adtraceImeiAndroidJavadocsJar
artifact adtraceImeiAndroidSourcesJar
}
}

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


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

// Add all items necessary for maven central publication.
root.children().last() + {
resolveStrategy = Closure.DELEGATE_FIRST
description 'The AdTrace SDK for Android'
name 'AdTrace Android SDK'
url 'https://github.com/adtrace/adtrace_sdk_android'
organization {
name 'adtrace'
url 'https://www.adtrace.io'
}
licenses {
license {
name 'MIT License'
url 'http://www.opensource.org/licenses/mit-license.php'
}
}
scm {
url '[email protected]:adtrace/adtrace_sdk_android.git'
connection 'scm:git:[email protected]:adtrace/adtrace_sdk_android.git'
developerConnection 'scm:git:[email protected]:adtrace/adtrace_sdk_android.git'
}
developers {
developer {
name 'Nasser Amini'
email '[email protected]'
}
}
}
}
}

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

signing {
sign configurations.archives
sign publishing.publications.mavenAndroidImei
}
21 changes: 21 additions & 0 deletions android-sdk-imei-plugin/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# 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
8 changes: 8 additions & 0 deletions android-sdk-imei-plugin/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="io.adtrace.sdk.imei">

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>

</manifest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package io.adtrace.sdk.imei;

public class AdTraceImei {
static boolean isImeiToBeRead = false;

public static void readImei() {
AdTraceImei.isImeiToBeRead = true;
}

public static void doNotReadImei() {
AdTraceImei.isImeiToBeRead = false;
}
}
Loading

0 comments on commit 3757b93

Please sign in to comment.