Skip to content

Commit

Permalink
first init
Browse files Browse the repository at this point in the history
  • Loading branch information
cpacm committed Sep 1, 2021
0 parents commit d662a37
Show file tree
Hide file tree
Showing 392 changed files with 15,528 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
*.iml
.gradle
/local.properties
/.idea/caches
/.idea/libraries
/.idea/modules.xml
/.idea/workspace.xml
/.idea/navEditor.xml
/.idea/assetWizardSettings.xml
.DS_Store
/build
/captures
.externalNativeBuild
.cxx
local.properties
Empty file added .idea/.gitignore
Empty file.
11 changes: 11 additions & 0 deletions .idea/compiler.xml

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

24 changes: 24 additions & 0 deletions .idea/gradle.xml

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

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

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

7 changes: 7 additions & 0 deletions .idea/kotlinc.xml

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

61 changes: 61 additions & 0 deletions .idea/misc.xml

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

10 changes: 10 additions & 0 deletions .idea/runConfigurations.xml

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

6 changes: 6 additions & 0 deletions .idea/vcs.xml

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

1 change: 1 addition & 0 deletions app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
62 changes: 62 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
plugins {
id 'com.android.application'
id 'kotlin-android'

id 'com.growingio.android.autotracker'
id 'com.growingio.giokit'
}

android {
compileSdkVersion rootProject.ext.android.compileSdkVersion
buildToolsVersion rootProject.ext.android.suppotrSdkVersion

defaultConfig {
applicationId rootProject.ext.android.applicationId + ".demo"
minSdkVersion rootProject.ext.android.minSdkVersion
targetSdkVersion rootProject.ext.android.targetSdkVersion
versionCode rootProject.ext.android.versionCode
versionName rootProject.ext.android.versionName

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
}

giokitExt {
trackFinder {
domain = ["com.growingio.giokit.demo"]
}
}

growingAutotracker {
logEnabled false
excludePackages = ["com.growingio.giokit.launch"]
}

dependencies {
implementation rootProject.ext.dependencies["kotlin-stdlib"]
implementation rootProject.ext.dependencies["core-ktx"]
implementation rootProject.ext.dependencies["appcompat"]
implementation rootProject.ext.dependencies["material"]
implementation rootProject.ext.dependencies["constraintLayout"]

implementation rootProject.ext.growingio["autotracker-cdp"]
implementation project(":giokit")

testImplementation rootProject.ext.dependencies["junit"]
androidTestImplementation rootProject.ext.dependencies["androidx-junit"]
androidTestImplementation rootProject.ext.dependencies["espresso-core"]
}
21 changes: 21 additions & 0 deletions app/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
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package com.growingio.giokit

import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.ext.junit.runners.AndroidJUnit4

import org.junit.Test
import org.junit.runner.RunWith

import org.junit.Assert.*

/**
* Instrumented test, which will execute on an Android device.
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
@RunWith(AndroidJUnit4::class)
class ExampleInstrumentedTest {
@Test
fun useAppContext() {
// Context of the app under test.
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
assertEquals("com.growingio.giokit", appContext.packageName)
}
}
43 changes: 43 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.growingio.giokit.demo">

<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_SETTINGS" />

<application
android:name=".App"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:usesCleartextTraffic="true"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.GioKit">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>

<intent-filter>
<data android:scheme="growing.8226cee4b794ebd0" />

<action android:name="android.intent.action.VIEW" />

<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
</intent-filter>
</activity>

<activity android:name=".SecondActivity" />
</application>

</manifest>
41 changes: 41 additions & 0 deletions app/src/main/java/com/growingio/giokit/demo/App.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
package com.growingio.giokit.demo

import android.app.Application
import com.growingio.android.sdk.TrackerContext
import com.growingio.android.sdk.autotrack.CdpAutotrackConfiguration
import com.growingio.android.sdk.autotrack.GrowingAutotracker
import com.growingio.android.sdk.autotrack.IgnorePolicy
import com.growingio.android.sdk.track.events.helper.EventExcludeFilter
import com.growingio.android.sdk.track.events.helper.FieldIgnoreFilter
import com.growingio.giokit.GioKit

/**
* <p>
*
* @author cpacm 2021/8/12
*/
class App : Application() {

override fun onCreate() {
super.onCreate()

val config = CdpAutotrackConfiguration("91eaf9b283361032", "growing.8226cee4b794ebd0")
.setDataSourceId("951f87ed30c9d9a3")
.setDebugEnabled(true)
.setDataCollectionServerHost("http://117.50.105.254:8080")
.setExcludeEvent(EventExcludeFilter.FORM_SUBMIT)
.setExcludeEvent(EventExcludeFilter.VIEW_CHANGE)
.setIgnoreField(FieldIgnoreFilter.NETWORK_STATE)
.setChannel("test")


GrowingAutotracker.startWithConfiguration(this, config)

GioKit.Builder(this).build()
}

fun onTest() {
GrowingAutotracker.get().trackCustomEvent("test")
TrackerContext.initializedSuccessfully()
}
}
Loading

0 comments on commit d662a37

Please sign in to comment.