├── .buildscript
└── test.sh
├── .travis.yml
├── LICENSE
├── README.md
├── Sample
├── .gitignore
├── app
│ ├── .gitignore
│ ├── build.gradle
│ ├── proguard-rules.pro
│ └── src
│ │ ├── androidTest
│ │ └── java
│ │ │ └── com
│ │ │ └── hackerli
│ │ │ └── sample
│ │ │ └── ExampleInstrumentedTest.java
│ │ ├── main
│ │ ├── AndroidManifest.xml
│ │ ├── java
│ │ │ └── com
│ │ │ │ └── hackerli
│ │ │ │ └── sample
│ │ │ │ └── MainActivity.java
│ │ └── res
│ │ │ ├── layout
│ │ │ └── activity_main.xml
│ │ │ ├── mipmap-hdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-mdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-xhdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-xxhdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-xxxhdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── values-w820dp
│ │ │ └── dimens.xml
│ │ │ └── values
│ │ │ ├── colors.xml
│ │ │ ├── dimens.xml
│ │ │ ├── strings.xml
│ │ │ └── styles.xml
│ │ └── test
│ │ └── java
│ │ └── com
│ │ └── hackerli
│ │ └── sample
│ │ └── ExampleUnitTest.java
├── build.gradle
├── com.hackerli.sample.trace.html
├── gradle.properties
├── gradle
│ └── wrapper
│ │ ├── gradle-wrapper.jar
│ │ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
└── settings.gradle
├── method-tracking
├── .gitignore
├── build.gradle
├── gradle
│ └── wrapper
│ │ ├── gradle-wrapper.jar
│ │ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── repo
│ └── com
│ │ └── uniquestudio
│ │ └── method-tracking
│ │ ├── 1.0.5
│ │ ├── method-tracking-1.0.5-groovydoc.jar
│ │ ├── method-tracking-1.0.5-groovydoc.jar.md5
│ │ ├── method-tracking-1.0.5-groovydoc.jar.sha1
│ │ ├── method-tracking-1.0.5-javadoc.jar
│ │ ├── method-tracking-1.0.5-javadoc.jar.md5
│ │ ├── method-tracking-1.0.5-javadoc.jar.sha1
│ │ ├── method-tracking-1.0.5-sources.jar
│ │ ├── method-tracking-1.0.5-sources.jar.md5
│ │ ├── method-tracking-1.0.5-sources.jar.sha1
│ │ ├── method-tracking-1.0.5.jar
│ │ ├── method-tracking-1.0.5.jar.md5
│ │ ├── method-tracking-1.0.5.jar.sha1
│ │ ├── method-tracking-1.0.5.pom
│ │ ├── method-tracking-1.0.5.pom.md5
│ │ └── method-tracking-1.0.5.pom.sha1
│ │ ├── 1.0.6
│ │ ├── method-tracking-1.0.6-groovydoc.jar
│ │ ├── method-tracking-1.0.6-groovydoc.jar.md5
│ │ ├── method-tracking-1.0.6-groovydoc.jar.sha1
│ │ ├── method-tracking-1.0.6-javadoc.jar
│ │ ├── method-tracking-1.0.6-javadoc.jar.md5
│ │ ├── method-tracking-1.0.6-javadoc.jar.sha1
│ │ ├── method-tracking-1.0.6-sources.jar
│ │ ├── method-tracking-1.0.6-sources.jar.md5
│ │ ├── method-tracking-1.0.6-sources.jar.sha1
│ │ ├── method-tracking-1.0.6.jar
│ │ ├── method-tracking-1.0.6.jar.md5
│ │ ├── method-tracking-1.0.6.jar.sha1
│ │ ├── method-tracking-1.0.6.pom
│ │ ├── method-tracking-1.0.6.pom.md5
│ │ └── method-tracking-1.0.6.pom.sha1
│ │ ├── 1.0
│ │ ├── method-tracking-1.0.jar
│ │ ├── method-tracking-1.0.jar.md5
│ │ ├── method-tracking-1.0.jar.sha1
│ │ ├── method-tracking-1.0.pom
│ │ ├── method-tracking-1.0.pom.md5
│ │ └── method-tracking-1.0.pom.sha1
│ │ ├── maven-metadata.xml
│ │ ├── maven-metadata.xml.md5
│ │ └── maven-metadata.xml.sha1
├── settings.gradle
└── src
│ ├── main
│ ├── groovy
│ │ └── com
│ │ │ └── uniquestudio
│ │ │ ├── HtmlGenerator.groovy
│ │ │ ├── MethodInfo.groovy
│ │ │ ├── MethodPlugin.groovy
│ │ │ ├── MethodTrackingTask.groovy
│ │ │ ├── TrackExtension.groovy
│ │ │ └── Utils.groovy
│ └── resources
│ │ └── META-INF
│ │ └── gradle-plugins
│ │ └── com.uniquestudio.method-tracking.properties
│ └── test
│ └── groovy
│ └── com.uniquestudio
│ └── MethodTrackingTest.groovy
└── screenshot
├── s_0.png
└── s_1.png
/.buildscript/test.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | echo "Start testing"
3 |
4 | cd method-tracking
5 | echo "Into method-tracking folder"
6 | ls
7 |
8 | ./gradlew --stacktrace test
9 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | sudo: false
2 |
3 | language: groovy
4 | groovy:
5 | - 2.3.6
6 | - 2.3.9
7 | jdk:
8 | - oraclejdk8
9 |
10 | script:
11 | - ./.buildscript/test.sh
12 |
13 |
14 | before_cache:
15 | - rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
16 | cache:
17 | directories:
18 | - $HOME/.gradle/caches/
19 | - $HOME/.gradle/wrapper/
20 |
21 | notifications:
22 | email: false
23 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | opyright 2017 coxier.
2 |
3 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
4 |
5 | http://www.apache.org/licenses/LICENSE-2.0
6 |
7 | Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
8 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Method Tracking
2 |
3 | # 
4 |
5 | A plugin to display how methods are called in application.
6 |
7 | [Live Demo](http://coxier.github.io/AppMethodTracking.html)
8 |
9 | # Usage
10 |
11 | ## Stpe1
12 | Add these to your root `build.gradle`.
13 |
14 | ```groovy
15 | buildscript {
16 | repositories {
17 | maven {
18 | url "https://plugins.gradle.org/m2/"
19 | }
20 | }
21 | dependencies {
22 | classpath "gradle.plugin.com.uniquestudio:method-tracking:1.0.6"
23 | }
24 | }
25 | ```
26 | Don't forget :
27 |
28 | ```groovy
29 | apply plugin: "com.uniquestudio.method-tracking"
30 | ```
31 |
32 | ## Step2
33 | First find where you want to debug.In my demo I care about how to wear cloth,so I add two lines around `wearCloth` like this:
34 |
35 | ```groovy
36 | Debug.startMethodTracing(getPackageName());
37 | wearCloth();
38 | Debug.stopMethodTracing();
39 |
40 | public void wearCloth() {
41 | putOnCoat();
42 | putOnPants();
43 | putOnShoes();
44 | putOnHat();
45 | }
46 |
47 |
48 | private void putOnPants() {
49 |
50 | }
51 |
52 | private void putOnCoat() {
53 |
54 | }
55 |
56 | private void putOnHat() {
57 | // Put on hat
58 | }
59 |
60 |
61 | public void putOnShoes() {
62 | putOnSocks();
63 | // Put on shoes
64 | }
65 |
66 | public void putOnSocks() {
67 | // Put on socks
68 | }
69 | ```
70 | ## Step3
71 | Now let's start configure this plugin.In your app module, add `method-tracking` closure.
72 |
73 | ```groovy
74 | methodTracking{
75 | traceName = 'com.hackerli.sample.trace'
76 | filterList = ['com.hackerli.sample']
77 | }
78 | ```
79 | * `traceName` is from the method `Debug.startMethodTracing(traceName)`
80 | * `filterList` is used to filter some extra methods.We usually use package name.
81 |
82 | ## Step4
83 | ```groovy
84 | ./gradlew track
85 | ```
86 | After above steps,[traceName.html](http://coxier.github.io/AppMethodTracking.html) is created.
87 |
88 | Its output like this:
89 |
90 |
91 |
92 | The digit is `useces`.
93 |
94 |
95 | In html,I add click event that means you can toggle these elements that have children.For example if I click `com.hackerli.sample.MainActivity.putOnShoes` above line,I will get:
96 |
97 |
98 |
99 |
100 | # THANKS
101 | I am inspired by [AppMethodOrder](https://github.com/zjw-swun/AppMethodOrder),espically how to compatible Windows os in groovy script or gradle script.
102 |
103 | # LICENSE
104 | ```
105 | Copyright 2017 coxier.
106 |
107 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
108 |
109 | http://www.apache.org/licenses/LICENSE-2.0
110 |
111 | Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
112 | ```
113 |
--------------------------------------------------------------------------------
/Sample/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 | /local.properties
4 | .DS_Store
5 | /build
6 | /captures
7 | .externalNativeBuild
8 | .idea
9 | *.trace
--------------------------------------------------------------------------------
/Sample/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/Sample/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 | apply plugin: 'com.uniquestudio.method-tracking'
3 |
4 | android {
5 | compileSdkVersion 25
6 | buildToolsVersion "25.0.2"
7 | defaultConfig {
8 | applicationId "com.hackerli.sample"
9 | minSdkVersion 15
10 | targetSdkVersion 25
11 | versionCode 1
12 | versionName "1.0"
13 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
14 | }
15 | buildTypes {
16 | release {
17 | minifyEnabled false
18 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
19 | }
20 | }
21 | }
22 |
23 | dependencies {
24 | compile fileTree(dir: 'libs', include: ['*.jar'])
25 | androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
26 | exclude group: 'com.android.support', module: 'support-annotations'
27 | })
28 | compile 'com.android.support:appcompat-v7:25.1.1'
29 | testCompile 'junit:junit:4.12'
30 | }
31 |
32 | methodTracking{
33 | traceName = 'com.hackerli.sample.trace'
34 | filterList = ['com.hackerli.sample']
35 | }
--------------------------------------------------------------------------------
/Sample/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in /home/coxier/Android/Sdk/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
--------------------------------------------------------------------------------
/Sample/app/src/androidTest/java/com/hackerli/sample/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package com.hackerli.sample;
2 |
3 | import android.content.Context;
4 | import android.support.test.InstrumentationRegistry;
5 | import android.support.test.runner.AndroidJUnit4;
6 |
7 | import org.junit.Test;
8 | import org.junit.runner.RunWith;
9 |
10 | import static org.junit.Assert.*;
11 |
12 | /**
13 | * Instrumentation test, which will execute on an Android device.
14 | *
15 | * @see Testing documentation
16 | */
17 | @RunWith(AndroidJUnit4.class)
18 | public class ExampleInstrumentedTest {
19 | @Test
20 | public void useAppContext() throws Exception {
21 | // Context of the app under test.
22 | Context appContext = InstrumentationRegistry.getTargetContext();
23 |
24 | assertEquals("com.hackerli.sample", appContext.getPackageName());
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/Sample/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/Sample/app/src/main/java/com/hackerli/sample/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.hackerli.sample;
2 |
3 | import android.Manifest;
4 | import android.content.pm.PackageManager;
5 | import android.os.Build;
6 | import android.os.Bundle;
7 | import android.os.Debug;
8 | import android.support.annotation.RequiresApi;
9 | import android.support.v4.content.ContextCompat;
10 | import android.support.v7.app.AppCompatActivity;
11 | import android.view.View;
12 |
13 | public class MainActivity extends AppCompatActivity implements View.OnClickListener{
14 |
15 | @Override
16 | protected void onCreate(Bundle savedInstanceState) {
17 | super.onCreate(savedInstanceState);
18 | setContentView(R.layout.activity_main);
19 | findViewById(R.id.bt_wear_cloth).setOnClickListener(this);
20 | }
21 |
22 |
23 | @RequiresApi(api = Build.VERSION_CODES.M)
24 | @Override
25 | public void onClick(View v) {
26 | if (ContextCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) {
27 | requestPermissions(new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, 1);
28 | }else{
29 | Debug.startMethodTracing(getPackageName());
30 | wearCloth();
31 | Debug.stopMethodTracing();
32 | }
33 | }
34 |
35 |
36 | public void wearCloth() {
37 | putOnCoat();
38 | putOnPants();
39 | putOnShoes();
40 | putOnHat();
41 | }
42 |
43 | private void putOnPants() {
44 |
45 | }
46 |
47 | private void putOnCoat() {
48 |
49 | }
50 |
51 | private void putOnHat() {
52 | // Put on hat
53 | }
54 |
55 |
56 | public void putOnShoes() {
57 | putOnSocks();
58 | // Put on shoes
59 | }
60 |
61 | public void putOnSocks() {
62 | // Put on socks
63 | }
64 |
65 | }
66 |
--------------------------------------------------------------------------------
/Sample/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
19 |
20 |
--------------------------------------------------------------------------------
/Sample/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CoXier/AppMethodTracking/9e95f82169f6068d57909a6829c2016a1c332571/Sample/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Sample/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CoXier/AppMethodTracking/9e95f82169f6068d57909a6829c2016a1c332571/Sample/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Sample/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CoXier/AppMethodTracking/9e95f82169f6068d57909a6829c2016a1c332571/Sample/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Sample/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CoXier/AppMethodTracking/9e95f82169f6068d57909a6829c2016a1c332571/Sample/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Sample/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CoXier/AppMethodTracking/9e95f82169f6068d57909a6829c2016a1c332571/Sample/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Sample/app/src/main/res/values-w820dp/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 64dp
6 |
7 |
--------------------------------------------------------------------------------
/Sample/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #3F51B5
4 | #303F9F
5 | #FF4081
6 |
7 |
--------------------------------------------------------------------------------
/Sample/app/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 16dp
4 | 16dp
5 |
6 |
--------------------------------------------------------------------------------
/Sample/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | Sample
3 |
4 |
--------------------------------------------------------------------------------
/Sample/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/Sample/app/src/test/java/com/hackerli/sample/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.hackerli.sample;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * @see Testing documentation
11 | */
12 | public class ExampleUnitTest {
13 | @Test
14 | public void addition_isCorrect() throws Exception {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------
/Sample/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 | repositories {
5 | jcenter()
6 | maven { url uri('/home/coxier/AppMethodTracking/method-tracking/repo') }
7 | }
8 | dependencies {
9 | classpath 'com.android.tools.build:gradle:2.2.2'
10 | classpath 'com.uniquestudio:method-tracking:1.0.6'
11 | // NOTE: Do not place your application dependencies here; they belong
12 | // in the individual module build.gradle files
13 | }
14 | }
15 |
16 | allprojects {
17 | repositories {
18 | jcenter()
19 | }
20 | }
21 |
22 | task clean(type: Delete) {
23 | delete rootProject.buildDir
24 | }
25 |
--------------------------------------------------------------------------------
/Sample/com.hackerli.sample.trace.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
17 |
23 |
24 | - com.hackerli.sample.MainActivity.wearCloth#54
- com.hackerli.sample.MainActivity.putOnCoat#6
- com.hackerli.sample.MainActivity.putOnPants#3
- com.hackerli.sample.MainActivity.putOnShoes#14
- com.hackerli.sample.MainActivity.putOnSocks#6
- com.hackerli.sample.MainActivity.putOnHat#4
--------------------------------------------------------------------------------
/Sample/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 |
3 | # IDE (e.g. Android Studio) users:
4 | # Gradle settings configured through the IDE *will override*
5 | # any settings specified in this file.
6 |
7 | # For more details on how to configure your build environment visit
8 | # http://www.gradle.org/docs/current/userguide/build_environment.html
9 |
10 | # Specifies the JVM arguments used for the daemon process.
11 | # The setting is particularly useful for tweaking memory settings.
12 | org.gradle.jvmargs=-Xmx1536m
13 |
14 | # When configured, Gradle will run in incubating parallel mode.
15 | # This option should only be used with decoupled projects. More details, visit
16 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
17 | # org.gradle.parallel=true
18 |
--------------------------------------------------------------------------------
/Sample/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CoXier/AppMethodTracking/9e95f82169f6068d57909a6829c2016a1c332571/Sample/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/Sample/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Mon Dec 28 10:00:20 PST 2015
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
7 |
--------------------------------------------------------------------------------
/Sample/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
10 | DEFAULT_JVM_OPTS=""
11 |
12 | APP_NAME="Gradle"
13 | APP_BASE_NAME=`basename "$0"`
14 |
15 | # Use the maximum available, or set MAX_FD != -1 to use that value.
16 | MAX_FD="maximum"
17 |
18 | warn ( ) {
19 | echo "$*"
20 | }
21 |
22 | die ( ) {
23 | echo
24 | echo "$*"
25 | echo
26 | exit 1
27 | }
28 |
29 | # OS specific support (must be 'true' or 'false').
30 | cygwin=false
31 | msys=false
32 | darwin=false
33 | case "`uname`" in
34 | CYGWIN* )
35 | cygwin=true
36 | ;;
37 | Darwin* )
38 | darwin=true
39 | ;;
40 | MINGW* )
41 | msys=true
42 | ;;
43 | esac
44 |
45 | # Attempt to set APP_HOME
46 | # Resolve links: $0 may be a link
47 | PRG="$0"
48 | # Need this for relative symlinks.
49 | while [ -h "$PRG" ] ; do
50 | ls=`ls -ld "$PRG"`
51 | link=`expr "$ls" : '.*-> \(.*\)$'`
52 | if expr "$link" : '/.*' > /dev/null; then
53 | PRG="$link"
54 | else
55 | PRG=`dirname "$PRG"`"/$link"
56 | fi
57 | done
58 | SAVED="`pwd`"
59 | cd "`dirname \"$PRG\"`/" >/dev/null
60 | APP_HOME="`pwd -P`"
61 | cd "$SAVED" >/dev/null
62 |
63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
64 |
65 | # Determine the Java command to use to start the JVM.
66 | if [ -n "$JAVA_HOME" ] ; then
67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
68 | # IBM's JDK on AIX uses strange locations for the executables
69 | JAVACMD="$JAVA_HOME/jre/sh/java"
70 | else
71 | JAVACMD="$JAVA_HOME/bin/java"
72 | fi
73 | if [ ! -x "$JAVACMD" ] ; then
74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
75 |
76 | Please set the JAVA_HOME variable in your environment to match the
77 | location of your Java installation."
78 | fi
79 | else
80 | JAVACMD="java"
81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
82 |
83 | Please set the JAVA_HOME variable in your environment to match the
84 | location of your Java installation."
85 | fi
86 |
87 | # Increase the maximum file descriptors if we can.
88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
89 | MAX_FD_LIMIT=`ulimit -H -n`
90 | if [ $? -eq 0 ] ; then
91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
92 | MAX_FD="$MAX_FD_LIMIT"
93 | fi
94 | ulimit -n $MAX_FD
95 | if [ $? -ne 0 ] ; then
96 | warn "Could not set maximum file descriptor limit: $MAX_FD"
97 | fi
98 | else
99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
100 | fi
101 | fi
102 |
103 | # For Darwin, add options to specify how the application appears in the dock
104 | if $darwin; then
105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
106 | fi
107 |
108 | # For Cygwin, switch paths to Windows format before running java
109 | if $cygwin ; then
110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
112 | JAVACMD=`cygpath --unix "$JAVACMD"`
113 |
114 | # We build the pattern for arguments to be converted via cygpath
115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
116 | SEP=""
117 | for dir in $ROOTDIRSRAW ; do
118 | ROOTDIRS="$ROOTDIRS$SEP$dir"
119 | SEP="|"
120 | done
121 | OURCYGPATTERN="(^($ROOTDIRS))"
122 | # Add a user-defined pattern to the cygpath arguments
123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
125 | fi
126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
127 | i=0
128 | for arg in "$@" ; do
129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
131 |
132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
134 | else
135 | eval `echo args$i`="\"$arg\""
136 | fi
137 | i=$((i+1))
138 | done
139 | case $i in
140 | (0) set -- ;;
141 | (1) set -- "$args0" ;;
142 | (2) set -- "$args0" "$args1" ;;
143 | (3) set -- "$args0" "$args1" "$args2" ;;
144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
150 | esac
151 | fi
152 |
153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
154 | function splitJvmOpts() {
155 | JVM_OPTS=("$@")
156 | }
157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
159 |
160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
161 |
--------------------------------------------------------------------------------
/Sample/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/Sample/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
--------------------------------------------------------------------------------
/method-tracking/.gitignore:
--------------------------------------------------------------------------------
1 | .idea
2 | .gradle
3 | /build
4 | gradle.properties
5 |
--------------------------------------------------------------------------------
/method-tracking/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'groovy'
2 | apply plugin: 'maven'
3 | apply plugin: 'java'
4 | apply plugin: 'com.gradle.plugin-publish'
5 |
6 | group 'com.uniquestudio'
7 | version '1.0.6'
8 |
9 |
10 | repositories {
11 | mavenCentral()
12 | }
13 |
14 | dependencies {
15 | compile gradleApi()
16 | compile localGroovy()
17 | testCompile gradleTestKit()
18 | testCompile 'junit:junit:4.12'
19 | }
20 |
21 | uploadArchives {
22 | repositories {
23 | mavenDeployer {
24 | repository(url: uri('repo'))
25 | }
26 | }
27 | }
28 |
29 | pluginBundle {
30 | website = 'https://github.com/CoXier/AppMethodTracking'
31 | vcsUrl = 'https://github.com/CoXier/AppMethodTracking'
32 | description = 'A gradle plugin tracking android application method'
33 | tags = ['tracking', 'method order']
34 |
35 | plugins {
36 | appMethodPlugin {
37 | id = 'com.uniquestudio.method-tracking'
38 | displayName = 'Track method order as you like'
39 | version = version
40 | }
41 | }
42 | }
43 |
44 | buildscript {
45 | repositories {
46 | maven {
47 | url "https://plugins.gradle.org/m2/"
48 | }
49 | }
50 | dependencies {
51 | classpath "com.gradle.publish:plugin-publish-plugin:0.9.7"
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/method-tracking/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CoXier/AppMethodTracking/9e95f82169f6068d57909a6829c2016a1c332571/method-tracking/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/method-tracking/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Mon Apr 10 18:50:46 CST 2017
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-3.1-bin.zip
7 |
--------------------------------------------------------------------------------
/method-tracking/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Attempt to set APP_HOME
10 | # Resolve links: $0 may be a link
11 | PRG="$0"
12 | # Need this for relative symlinks.
13 | while [ -h "$PRG" ] ; do
14 | ls=`ls -ld "$PRG"`
15 | link=`expr "$ls" : '.*-> \(.*\)$'`
16 | if expr "$link" : '/.*' > /dev/null; then
17 | PRG="$link"
18 | else
19 | PRG=`dirname "$PRG"`"/$link"
20 | fi
21 | done
22 | SAVED="`pwd`"
23 | cd "`dirname \"$PRG\"`/" >/dev/null
24 | APP_HOME="`pwd -P`"
25 | cd "$SAVED" >/dev/null
26 |
27 | APP_NAME="Gradle"
28 | APP_BASE_NAME=`basename "$0"`
29 |
30 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
31 | DEFAULT_JVM_OPTS=""
32 |
33 | # Use the maximum available, or set MAX_FD != -1 to use that value.
34 | MAX_FD="maximum"
35 |
36 | warn ( ) {
37 | echo "$*"
38 | }
39 |
40 | die ( ) {
41 | echo
42 | echo "$*"
43 | echo
44 | exit 1
45 | }
46 |
47 | # OS specific support (must be 'true' or 'false').
48 | cygwin=false
49 | msys=false
50 | darwin=false
51 | nonstop=false
52 | case "`uname`" in
53 | CYGWIN* )
54 | cygwin=true
55 | ;;
56 | Darwin* )
57 | darwin=true
58 | ;;
59 | MINGW* )
60 | msys=true
61 | ;;
62 | NONSTOP* )
63 | nonstop=true
64 | ;;
65 | esac
66 |
67 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
68 |
69 | # Determine the Java command to use to start the JVM.
70 | if [ -n "$JAVA_HOME" ] ; then
71 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
72 | # IBM's JDK on AIX uses strange locations for the executables
73 | JAVACMD="$JAVA_HOME/jre/sh/java"
74 | else
75 | JAVACMD="$JAVA_HOME/bin/java"
76 | fi
77 | if [ ! -x "$JAVACMD" ] ; then
78 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
79 |
80 | Please set the JAVA_HOME variable in your environment to match the
81 | location of your Java installation."
82 | fi
83 | else
84 | JAVACMD="java"
85 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
86 |
87 | Please set the JAVA_HOME variable in your environment to match the
88 | location of your Java installation."
89 | fi
90 |
91 | # Increase the maximum file descriptors if we can.
92 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
93 | MAX_FD_LIMIT=`ulimit -H -n`
94 | if [ $? -eq 0 ] ; then
95 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
96 | MAX_FD="$MAX_FD_LIMIT"
97 | fi
98 | ulimit -n $MAX_FD
99 | if [ $? -ne 0 ] ; then
100 | warn "Could not set maximum file descriptor limit: $MAX_FD"
101 | fi
102 | else
103 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
104 | fi
105 | fi
106 |
107 | # For Darwin, add options to specify how the application appears in the dock
108 | if $darwin; then
109 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
110 | fi
111 |
112 | # For Cygwin, switch paths to Windows format before running java
113 | if $cygwin ; then
114 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
115 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
116 | JAVACMD=`cygpath --unix "$JAVACMD"`
117 |
118 | # We build the pattern for arguments to be converted via cygpath
119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
120 | SEP=""
121 | for dir in $ROOTDIRSRAW ; do
122 | ROOTDIRS="$ROOTDIRS$SEP$dir"
123 | SEP="|"
124 | done
125 | OURCYGPATTERN="(^($ROOTDIRS))"
126 | # Add a user-defined pattern to the cygpath arguments
127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
129 | fi
130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
131 | i=0
132 | for arg in "$@" ; do
133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
135 |
136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
138 | else
139 | eval `echo args$i`="\"$arg\""
140 | fi
141 | i=$((i+1))
142 | done
143 | case $i in
144 | (0) set -- ;;
145 | (1) set -- "$args0" ;;
146 | (2) set -- "$args0" "$args1" ;;
147 | (3) set -- "$args0" "$args1" "$args2" ;;
148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
154 | esac
155 | fi
156 |
157 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
158 | function splitJvmOpts() {
159 | JVM_OPTS=("$@")
160 | }
161 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
162 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
163 |
164 | # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
165 | if [[ "$(uname)" == "Darwin" ]] && [[ "$HOME" == "$PWD" ]]; then
166 | cd "$(dirname "$0")"
167 | fi
168 |
169 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
170 |
--------------------------------------------------------------------------------
/method-tracking/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | set DIRNAME=%~dp0
12 | if "%DIRNAME%" == "" set DIRNAME=.
13 | set APP_BASE_NAME=%~n0
14 | set APP_HOME=%DIRNAME%
15 |
16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
17 | set DEFAULT_JVM_OPTS=
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windows variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 |
53 | :win9xME_args
54 | @rem Slurp the command line arguments.
55 | set CMD_LINE_ARGS=
56 | set _SKIP=2
57 |
58 | :win9xME_args_slurp
59 | if "x%~1" == "x" goto execute
60 |
61 | set CMD_LINE_ARGS=%*
62 |
63 | :execute
64 | @rem Setup the command line
65 |
66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
67 |
68 | @rem Execute Gradle
69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
70 |
71 | :end
72 | @rem End local scope for the variables with windows NT shell
73 | if "%ERRORLEVEL%"=="0" goto mainEnd
74 |
75 | :fail
76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
77 | rem the _cmd.exe /c_ return code!
78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
79 | exit /b 1
80 |
81 | :mainEnd
82 | if "%OS%"=="Windows_NT" endlocal
83 |
84 | :omega
85 |
--------------------------------------------------------------------------------
/method-tracking/repo/com/uniquestudio/method-tracking/1.0.5/method-tracking-1.0.5-groovydoc.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CoXier/AppMethodTracking/9e95f82169f6068d57909a6829c2016a1c332571/method-tracking/repo/com/uniquestudio/method-tracking/1.0.5/method-tracking-1.0.5-groovydoc.jar
--------------------------------------------------------------------------------
/method-tracking/repo/com/uniquestudio/method-tracking/1.0.5/method-tracking-1.0.5-groovydoc.jar.md5:
--------------------------------------------------------------------------------
1 | 0033103ec6aeffba3d4bca9f5f49d35c
--------------------------------------------------------------------------------
/method-tracking/repo/com/uniquestudio/method-tracking/1.0.5/method-tracking-1.0.5-groovydoc.jar.sha1:
--------------------------------------------------------------------------------
1 | b28cfde0d12c732f9b70ad802e3c8ff559edf773
--------------------------------------------------------------------------------
/method-tracking/repo/com/uniquestudio/method-tracking/1.0.5/method-tracking-1.0.5-javadoc.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CoXier/AppMethodTracking/9e95f82169f6068d57909a6829c2016a1c332571/method-tracking/repo/com/uniquestudio/method-tracking/1.0.5/method-tracking-1.0.5-javadoc.jar
--------------------------------------------------------------------------------
/method-tracking/repo/com/uniquestudio/method-tracking/1.0.5/method-tracking-1.0.5-javadoc.jar.md5:
--------------------------------------------------------------------------------
1 | 47ffa88b08cab9733715ee398cdd1762
--------------------------------------------------------------------------------
/method-tracking/repo/com/uniquestudio/method-tracking/1.0.5/method-tracking-1.0.5-javadoc.jar.sha1:
--------------------------------------------------------------------------------
1 | 6cd1fbd5b6ce22469ad9e82badd04423ba950dd6
--------------------------------------------------------------------------------
/method-tracking/repo/com/uniquestudio/method-tracking/1.0.5/method-tracking-1.0.5-sources.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CoXier/AppMethodTracking/9e95f82169f6068d57909a6829c2016a1c332571/method-tracking/repo/com/uniquestudio/method-tracking/1.0.5/method-tracking-1.0.5-sources.jar
--------------------------------------------------------------------------------
/method-tracking/repo/com/uniquestudio/method-tracking/1.0.5/method-tracking-1.0.5-sources.jar.md5:
--------------------------------------------------------------------------------
1 | b1e61793844a4e6fd45fdc5da5405093
--------------------------------------------------------------------------------
/method-tracking/repo/com/uniquestudio/method-tracking/1.0.5/method-tracking-1.0.5-sources.jar.sha1:
--------------------------------------------------------------------------------
1 | 9cda2cf9c6578ea7ada9950cd35678d9fca25db2
--------------------------------------------------------------------------------
/method-tracking/repo/com/uniquestudio/method-tracking/1.0.5/method-tracking-1.0.5.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CoXier/AppMethodTracking/9e95f82169f6068d57909a6829c2016a1c332571/method-tracking/repo/com/uniquestudio/method-tracking/1.0.5/method-tracking-1.0.5.jar
--------------------------------------------------------------------------------
/method-tracking/repo/com/uniquestudio/method-tracking/1.0.5/method-tracking-1.0.5.jar.md5:
--------------------------------------------------------------------------------
1 | 749cc4ddaef34ee1ee53b5fe13d54d4d
--------------------------------------------------------------------------------
/method-tracking/repo/com/uniquestudio/method-tracking/1.0.5/method-tracking-1.0.5.jar.sha1:
--------------------------------------------------------------------------------
1 | d35ff4f04ff44d703751e7dfc5ca6c4a318afaf7
--------------------------------------------------------------------------------
/method-tracking/repo/com/uniquestudio/method-tracking/1.0.5/method-tracking-1.0.5.pom:
--------------------------------------------------------------------------------
1 |
2 |
4 | 4.0.0
5 | com.uniquestudio
6 | method-tracking
7 | 1.0.5
8 |
9 |
--------------------------------------------------------------------------------
/method-tracking/repo/com/uniquestudio/method-tracking/1.0.5/method-tracking-1.0.5.pom.md5:
--------------------------------------------------------------------------------
1 | 5e85295d06f0eda4b10cc549c4a13529
--------------------------------------------------------------------------------
/method-tracking/repo/com/uniquestudio/method-tracking/1.0.5/method-tracking-1.0.5.pom.sha1:
--------------------------------------------------------------------------------
1 | 36a9e6e3b1ee032aa57f5d1a07ab06edff34c793
--------------------------------------------------------------------------------
/method-tracking/repo/com/uniquestudio/method-tracking/1.0.6/method-tracking-1.0.6-groovydoc.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CoXier/AppMethodTracking/9e95f82169f6068d57909a6829c2016a1c332571/method-tracking/repo/com/uniquestudio/method-tracking/1.0.6/method-tracking-1.0.6-groovydoc.jar
--------------------------------------------------------------------------------
/method-tracking/repo/com/uniquestudio/method-tracking/1.0.6/method-tracking-1.0.6-groovydoc.jar.md5:
--------------------------------------------------------------------------------
1 | 9467d47b6750a8e4df7328cce841ec36
--------------------------------------------------------------------------------
/method-tracking/repo/com/uniquestudio/method-tracking/1.0.6/method-tracking-1.0.6-groovydoc.jar.sha1:
--------------------------------------------------------------------------------
1 | 41c8f85dde2557755c4182b590294b15a2c4053b
--------------------------------------------------------------------------------
/method-tracking/repo/com/uniquestudio/method-tracking/1.0.6/method-tracking-1.0.6-javadoc.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CoXier/AppMethodTracking/9e95f82169f6068d57909a6829c2016a1c332571/method-tracking/repo/com/uniquestudio/method-tracking/1.0.6/method-tracking-1.0.6-javadoc.jar
--------------------------------------------------------------------------------
/method-tracking/repo/com/uniquestudio/method-tracking/1.0.6/method-tracking-1.0.6-javadoc.jar.md5:
--------------------------------------------------------------------------------
1 | 5ec3184a84ac5f3333d2c3818175bc57
--------------------------------------------------------------------------------
/method-tracking/repo/com/uniquestudio/method-tracking/1.0.6/method-tracking-1.0.6-javadoc.jar.sha1:
--------------------------------------------------------------------------------
1 | d42c6a8aaa71217cd9b535db963aa6dc1f63b182
--------------------------------------------------------------------------------
/method-tracking/repo/com/uniquestudio/method-tracking/1.0.6/method-tracking-1.0.6-sources.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CoXier/AppMethodTracking/9e95f82169f6068d57909a6829c2016a1c332571/method-tracking/repo/com/uniquestudio/method-tracking/1.0.6/method-tracking-1.0.6-sources.jar
--------------------------------------------------------------------------------
/method-tracking/repo/com/uniquestudio/method-tracking/1.0.6/method-tracking-1.0.6-sources.jar.md5:
--------------------------------------------------------------------------------
1 | 236fb6238ec1b2cb815e3c53aa238a69
--------------------------------------------------------------------------------
/method-tracking/repo/com/uniquestudio/method-tracking/1.0.6/method-tracking-1.0.6-sources.jar.sha1:
--------------------------------------------------------------------------------
1 | 523695d7c6cd818567d4881e2ed6e7098e192d04
--------------------------------------------------------------------------------
/method-tracking/repo/com/uniquestudio/method-tracking/1.0.6/method-tracking-1.0.6.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CoXier/AppMethodTracking/9e95f82169f6068d57909a6829c2016a1c332571/method-tracking/repo/com/uniquestudio/method-tracking/1.0.6/method-tracking-1.0.6.jar
--------------------------------------------------------------------------------
/method-tracking/repo/com/uniquestudio/method-tracking/1.0.6/method-tracking-1.0.6.jar.md5:
--------------------------------------------------------------------------------
1 | 36d397c6a78e0005cf9a69567054ae4a
--------------------------------------------------------------------------------
/method-tracking/repo/com/uniquestudio/method-tracking/1.0.6/method-tracking-1.0.6.jar.sha1:
--------------------------------------------------------------------------------
1 | 09f6905e0ea63c5f95927ef8ab33f5af29774cbf
--------------------------------------------------------------------------------
/method-tracking/repo/com/uniquestudio/method-tracking/1.0.6/method-tracking-1.0.6.pom:
--------------------------------------------------------------------------------
1 |
2 |
4 | 4.0.0
5 | com.uniquestudio
6 | method-tracking
7 | 1.0.6
8 |
9 |
10 | junit
11 | junit
12 | 4.12
13 | test
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/method-tracking/repo/com/uniquestudio/method-tracking/1.0.6/method-tracking-1.0.6.pom.md5:
--------------------------------------------------------------------------------
1 | 2c67c7adcd75d0a90c7adfaef9691516
--------------------------------------------------------------------------------
/method-tracking/repo/com/uniquestudio/method-tracking/1.0.6/method-tracking-1.0.6.pom.sha1:
--------------------------------------------------------------------------------
1 | 32869f1faa2a1eebc6d0f3578682807085e12b7e
--------------------------------------------------------------------------------
/method-tracking/repo/com/uniquestudio/method-tracking/1.0/method-tracking-1.0.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CoXier/AppMethodTracking/9e95f82169f6068d57909a6829c2016a1c332571/method-tracking/repo/com/uniquestudio/method-tracking/1.0/method-tracking-1.0.jar
--------------------------------------------------------------------------------
/method-tracking/repo/com/uniquestudio/method-tracking/1.0/method-tracking-1.0.jar.md5:
--------------------------------------------------------------------------------
1 | 478bbc9ebff7469df825d2d04fcf1a9b
--------------------------------------------------------------------------------
/method-tracking/repo/com/uniquestudio/method-tracking/1.0/method-tracking-1.0.jar.sha1:
--------------------------------------------------------------------------------
1 | 7bc6a5b871f64375ee19b19e6efd8f80831fd956
--------------------------------------------------------------------------------
/method-tracking/repo/com/uniquestudio/method-tracking/1.0/method-tracking-1.0.pom:
--------------------------------------------------------------------------------
1 |
2 |
4 | 4.0.0
5 | com.uniquestudio
6 | method-tracking
7 | 1.0
8 |
9 |
--------------------------------------------------------------------------------
/method-tracking/repo/com/uniquestudio/method-tracking/1.0/method-tracking-1.0.pom.md5:
--------------------------------------------------------------------------------
1 | b41d6c877dc9433eb19f6951bed742ef
--------------------------------------------------------------------------------
/method-tracking/repo/com/uniquestudio/method-tracking/1.0/method-tracking-1.0.pom.sha1:
--------------------------------------------------------------------------------
1 | becd1adb2279659c87a40fc766cdeecf7b1ecc9c
--------------------------------------------------------------------------------
/method-tracking/repo/com/uniquestudio/method-tracking/maven-metadata.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | com.uniquestudio
4 | method-tracking
5 |
6 | 1.0.6
7 |
8 | 1.0
9 | 1.0.5
10 | 1.0.6
11 |
12 | 20170421031250
13 |
14 |
15 |
--------------------------------------------------------------------------------
/method-tracking/repo/com/uniquestudio/method-tracking/maven-metadata.xml.md5:
--------------------------------------------------------------------------------
1 | d6a394d4dcbc0cdab26bb844e4a5c0cb
--------------------------------------------------------------------------------
/method-tracking/repo/com/uniquestudio/method-tracking/maven-metadata.xml.sha1:
--------------------------------------------------------------------------------
1 | 1c7ee129efccf62c13c104d0da00780514cc2d7b
--------------------------------------------------------------------------------
/method-tracking/settings.gradle:
--------------------------------------------------------------------------------
1 | rootProject.name = 'method-tracking'
2 |
3 |
--------------------------------------------------------------------------------
/method-tracking/src/main/groovy/com/uniquestudio/HtmlGenerator.groovy:
--------------------------------------------------------------------------------
1 | package com.uniquestudio
2 |
3 | /**
4 | * Created by coxier on 17-4-13.
5 | */
6 | class HtmlGenerator {
7 | static js = "\n"
21 |
22 | static css = "\n"
28 |
29 |
30 | static generate = {
31 | fileName, rootList ->
32 | File file = new File(fileName)
33 | file.createNewFile()
34 | StringBuilder builder = new StringBuilder()
35 | insertHead(builder)
36 | insertBody(builder,rootList)
37 | insertEnd(builder)
38 | file.write(builder.toString())
39 | }
40 |
41 | static insertHead(builder){
42 | builder.append("\n" +
43 | "\n")
44 | builder.append(js)
45 | builder.append(css)
46 | builder.append("\n")
47 | }
48 |
49 |
50 | static insertBody(builder,rootList){
51 | rootList.eachWithIndex{
52 | it,index->
53 | builder.append("")
54 | insertLi(index,builder,it)
55 | builder.append("
")
56 | }
57 | }
58 |
59 | static insertLi(index,builder,methodInfo){
60 | def id = "${index}"
61 | builder.append("" +
62 | "${methodInfo.methodSignature}#${methodInfo.usecs}")
63 | if (methodInfo.children != null){
64 | builder.append("")
65 | methodInfo.children.eachWithIndex{
66 | it,i->
67 | insertLi("${index}#$i",builder,it)
68 | }
69 | builder.append("
")
70 | }
71 | builder.append("")
72 | }
73 |
74 | static insertEnd(builder) {
75 | builder.append("")
76 | builder.append("")
77 | }
78 |
79 |
80 |
81 | }
82 |
--------------------------------------------------------------------------------
/method-tracking/src/main/groovy/com/uniquestudio/MethodInfo.groovy:
--------------------------------------------------------------------------------
1 | package com.uniquestudio
2 |
3 | /**
4 | * Created by coxier on 17-4-12.
5 | */
6 | class MethodInfo {
7 | String methodSignature
8 | String packageName
9 | String usecs
10 | // ent or xit
11 | String action
12 |
13 | def children
14 |
15 | @Override
16 | boolean equals(Object obj) {
17 | MethodInfo another = (MethodInfo)obj
18 | return usecs.equals(another.usecs)
19 | }
20 |
21 | @Override
22 | String toString() {
23 | return "${action}\t${usecs}\t${methodSignature}"
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/method-tracking/src/main/groovy/com/uniquestudio/MethodPlugin.groovy:
--------------------------------------------------------------------------------
1 | package com.uniquestudio
2 |
3 | import org.gradle.api.Plugin
4 | import org.gradle.api.Project
5 |
6 |
7 | /**
8 | * Created by coxier on 17-4-10.
9 | */
10 | class MethodPlugin implements Plugin{
11 | @Override
12 | void apply(Project project) {
13 | project.extensions.create('methodTracking',TrackExtension)
14 | project.task('track',type:MethodTrackingTask)
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/method-tracking/src/main/groovy/com/uniquestudio/MethodTrackingTask.groovy:
--------------------------------------------------------------------------------
1 | package com.uniquestudio
2 |
3 | import org.gradle.api.DefaultTask
4 | import org.gradle.api.tasks.TaskAction
5 |
6 | /**
7 | * Created by coxier on 17-4-10.
8 | */
9 | class MethodTrackingTask extends DefaultTask {
10 | String group = 'MethodTracking'
11 |
12 | def projectDirPath
13 |
14 | String traceInfo
15 | def traceName
16 | def filterList
17 |
18 | def filteredMethod
19 |
20 | int start, end
21 |
22 | @TaskAction
23 | track() {
24 | traceInfo = generateTrace()
25 | println traceInfo
26 | parseTraceInfo()
27 | }
28 |
29 | /**
30 | * dump trace file whose name is set in methodTrack extension.
31 | * @return
32 | */
33 | def generateTrace() {
34 | traceName = project.methodTracking.traceName
35 | filterList = project.methodTracking.filterList
36 | if (traceName == null) throw new RuntimeException('Trace name cannot be null')
37 | if (filterList == null) throw new RuntimeException('At least one filter is needed')
38 |
39 | projectDirPath = project.getProjectDir().getParentFile().path + File.separator
40 | def platformPath = project.android.getSdkDirectory().toString() + '/platform-tools'
41 |
42 | // pull trace file from devise
43 | def adb = platformPath + '/adb'
44 | def pullCommand = "${adb} pull /sdcard/${traceName} ${projectDirPath}${traceName}"
45 | println "${pullCommand}"
46 | String os = System.getProperty("os.name").toLowerCase()
47 | if (os.contains("windows"))
48 | ("cmd /c start /b ${pullCommand}").execute().waitFor()
49 | else
50 | ['bash', '-c', pullCommand].execute().waitFor()
51 |
52 | File file = new File("${projectDirPath}${traceName}")
53 | if (!file.exists()) throw new RuntimeException("Trace name may be invalid or devices offline")
54 |
55 | // dump trace file
56 | def dmtracedump = "${platformPath}/dmtracedump"
57 | def dmCommand = "${dmtracedump} -o ${projectDirPath}${traceName}"
58 | println "${dmCommand}"
59 | if (os.contains("windows"))
60 | ("cmd /c start /b ${dmCommand}").execute().text
61 | else
62 | ['bash', '-c', dmCommand].execute().text
63 | }
64 |
65 | /**
66 | * parseMethod trace info to html.
67 | * If method A invokes B and C,we call A is root of B and C.
68 | * Obviously after parsing ,we will get some {@link MethodInfo}s
69 | */
70 | def parseTraceInfo() {
71 | println '\nSTART PARSING\n'
72 |
73 | filteredMethod = parseMethodInfo(traceInfo)
74 | filteredMethod.each { println(it) }
75 |
76 | def rootList = []
77 | start = 0
78 | end = filteredMethod.size()
79 | while (start < end) {
80 | MethodInfo root = search()
81 | rootList.add(root)
82 | }
83 | println('\n')
84 | rootList.each {
85 | printMethod(0, it)
86 | }
87 |
88 | // generate html
89 | def generator = HtmlGenerator.generate
90 | generator(projectDirPath + "${traceName}.html", rootList)
91 |
92 | println '\nFINISHED'
93 | }
94 |
95 | /**
96 | * extract all methods from traceInfo
97 | * @param traceInfo
98 | * @return
99 | */
100 | def parseMethodInfo(traceInfo){
101 | String[] traceList = traceInfo.split('\n')
102 | int i
103 | for (i = 0; i < traceList.length; i++) {
104 | String s = traceList[i]
105 | // methods appear
106 | if (s == "Trace (threadID action usecs class.method signature):") {
107 | i++
108 | break
109 | }
110 | }
111 |
112 | filteredMethod = []
113 |
114 | // filter method by package name
115 | while (i < traceList.length) {
116 | def info = Utils.parseMethod(traceList[i])
117 | filterList.each {
118 | if (info.get(2) == it) {
119 | MethodInfo methodInfo = new MethodInfo()
120 | methodInfo.action = info.get(0)
121 | methodInfo.usecs = info.get(1)
122 | methodInfo.methodSignature = info.get(3)
123 | filteredMethod.add(methodInfo)
124 | // break
125 | return true
126 | }
127 | }
128 | i++
129 | }
130 | println(filteredMethod.class)
131 | filteredMethod
132 | }
133 |
134 |
135 | MethodInfo search() {
136 | int k = find()
137 | MethodInfo root = filteredMethod.get(k)
138 | root.usecs = (filteredMethod.get(k).usecs as int) - (filteredMethod.get(start).usecs as int)
139 |
140 | start++
141 | def children = []
142 | while (start < k) {
143 | children.add(search())
144 | }
145 | start = k + 1
146 | root.children = children
147 | root
148 | }
149 |
150 | int find() {
151 | int k = start + 1
152 | int count = 1
153 | MethodInfo kM = filteredMethod.get(k)
154 | MethodInfo sM = filteredMethod.get(start)
155 |
156 | while (true) {
157 | if (kM.methodSignature == sM.methodSignature) {
158 | if (kM.action == 'ent') count++
159 | else count--
160 |
161 | if (count == 0) break
162 | }
163 | kM = filteredMethod.get(++k)
164 | }
165 | k
166 | }
167 |
168 | def printMethod(int i, MethodInfo info) {
169 | def blank = ''
170 | int j = 0
171 | while (j < i) {
172 | blank = blank + '\t'
173 | j++
174 | }
175 | println("${blank}${info.methodSignature}#${info.usecs}")
176 | def children = info.children
177 | children.eachWithIndex {
178 | item, index ->
179 | printMethod(i + 1, item)
180 | }
181 | }
182 |
183 | }
184 |
--------------------------------------------------------------------------------
/method-tracking/src/main/groovy/com/uniquestudio/TrackExtension.groovy:
--------------------------------------------------------------------------------
1 | package com.uniquestudio
2 |
3 |
4 | /**
5 | * Created by coxier on 17-4-12.
6 | */
7 | class TrackExtension {
8 | def traceName
9 | /**
10 | * filter method by package name
11 | */
12 | def filterList
13 | }
14 |
--------------------------------------------------------------------------------
/method-tracking/src/main/groovy/com/uniquestudio/Utils.groovy:
--------------------------------------------------------------------------------
1 | package com.uniquestudio
2 | /**
3 | * Created by coxier on 17-4-12.
4 | */
5 | class Utils {
6 | /**
7 | *
8 | * @param s
9 | * @return List format is [ext/ent,usecs,packageName,methodSignature]
10 | */
11 | static def parseMethod(String s) {
12 | def result = []
13 | int start = 0, end = 0
14 | for (int i = 0; i < s.length(); i++) {
15 | if (s.charAt(i) == ' ' as char) {
16 | start = i + 1
17 | break
18 | }
19 | }
20 |
21 | // ext or ent
22 | for (int i = start; i < s.length(); i++) {
23 | if (s.charAt(i) == ' ' as char) {
24 | end = i
25 | result.add(s.subSequence(start, end))
26 | start = end
27 | break
28 | }
29 | }
30 |
31 | for (int i = start; i < s.length(); i++) {
32 | if (s.charAt(i) == ' ' as char) continue
33 | start = i
34 | break
35 | }
36 |
37 | // usesc
38 | for(int i= start;i= ('0' as char) && c<= ('9' as char) ) continue
41 | end = i
42 | result.add(s.subSequence(start,end))
43 | start = end
44 | break
45 | }
46 |
47 | // methodSignature
48 | for (int i= start;i filteredMethod = task.parseMethodInfo(traceInfo).toList()
62 |
63 | assertNotNull(filteredMethod)
64 | assertNotEquals(filteredMethod.size, 0)
65 |
66 | for (MethodInfo it : filteredMethod) {
67 | assertTrue(it.action == "ent" || it.action == "xit")
68 | assertTrue(it.methodSignature == "com.hackerli.sample.MainActivity.putOnHat"
69 | || it.methodSignature == "com.hackerli.sample.MainActivity.putOnSocks"
70 | || it.methodSignature == "com.hackerli.sample.MainActivity.putOnShoes"
71 | || it.methodSignature == "com.hackerli.sample.MainActivity.putOnCoat"
72 | || it.methodSignature == "com.hackerli.sample.MainActivity.putOnPants"
73 | || it.methodSignature == "com.hackerli.sample.MainActivity.wearCloth")
74 | }
75 |
76 |
77 | }
78 |
79 | }
80 |
--------------------------------------------------------------------------------
/screenshot/s_0.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CoXier/AppMethodTracking/9e95f82169f6068d57909a6829c2016a1c332571/screenshot/s_0.png
--------------------------------------------------------------------------------
/screenshot/s_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CoXier/AppMethodTracking/9e95f82169f6068d57909a6829c2016a1c332571/screenshot/s_1.png
--------------------------------------------------------------------------------