Skip to content

Commit

Permalink
[feature] add APP analysis feature to analyse ATX devices (#42)
Browse files Browse the repository at this point in the history
* [feature] add APP analysis feature to analyse ATX-Angent devices

* [opt] opt tendid token get from env params

* [opt] delete opt log
  • Loading branch information
atomtong authored and codeskyblue committed Jan 7, 2020
1 parent f5c0b93 commit ea26d02
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 3 deletions.
5 changes: 5 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,12 @@ android {
// 1: original version
// 2: update all dependencies to latest
// 6: input method, battery,rotation monitor
def buildTendId = System.getenv("TEND_ID")
def buildChannel = "official"

defaultConfig {
buildConfigField "String", "buildTendId", "\"${buildTendId}\""
buildConfigField "String", "buildChannel", "\"${buildChannel}\""
applicationId "com.github.uiautomator"
minSdkVersion 18
targetSdkVersion 28
Expand Down
Binary file not shown.
5 changes: 2 additions & 3 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
android:label="@string/app_name"
android:persistent="true"
android:theme="@style/AppTheme"
android:usesCleartextTraffic="true">
android:usesCleartextTraffic="true"
android:name=".MainApplication">
<activity
android:name=".IdentifyActivity"
android:excludeFromRecents="true"
Expand Down Expand Up @@ -111,15 +112,13 @@
<uses-permission android:name="android.permission.DISABLE_KEYGUARD" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.MANAGE_ACCOUNTS" />
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />

<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />

</manifest>
22 changes: 22 additions & 0 deletions app/src/main/java/com/github/uiautomator/MainApplication.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package com.github.uiautomator;

import android.app.Application;
import android.util.Log;

import com.tendcloud.tenddata.TCAgent;

public class MainApplication extends Application {
private static final String TAG = ">>>>>MainApplication";
@Override
public void onCreate() {
super.onCreate();
// JLibrary.InitEntry(this); //移动安全联盟统一SDK初始化
TCAgent.LOG_ON = true;
// App ID: 在TalkingData创建应用后,进入数据报表页中,在“系统设置”-“编辑应用”页面里查看App ID。
// 渠道 ID: 是渠道标识符,可通过不同渠道单独追踪数据。
TCAgent.init(this, BuildConfig.buildTendId, BuildConfig.buildChannel);
// 如果已经在AndroidManifest.xml配置了App ID和渠道ID,调用TCAgent.init(this)即可;或与AndroidManifest.xml中的对应参数保持一致。
TCAgent.setReportUncaughtExceptions(true);
Log.e(TAG, "TCAgent init over>>>>>");
}
}

0 comments on commit ea26d02

Please sign in to comment.