Giter VIP home page Giter VIP logo

androidautotrack's Introduction

AndroidAutoTrack

双击优化

原理和无痕埋点相似,通过classvisitor的机制访问所有View.OnClickListener的子类,然后插入双击优化的代码块。

使用原则

根目录build 添加插件

buildscript {
   
   repositories {
       maven {
           url "file://${rootDir.absolutePath}/.repo"
       }
       google()
       jcenter()

   }
   dependencies {
       classpath 'com.kronos.doubleTap:double_tap_plugin:0.1.3'
   }
}

app 运行工程下引入插件 同时将你需要插入的代码的className 和functionname 标记在Extension中

apply plugin: 'doubleTap'

doubleTab {
   injectClassName = "com.a.doubleclickplugin.DoubleTapCheck"
   injectFunctionName = "isNotDoubleTap"
}

直接编译你的项目,观察项目下的build/imtermediates/transform/DoubleTabTrasform/ 文件夹下面

如果有插入的代码那么代表该插件已经编织代码成功

安卓无痕埋点 原理如下:

通过编译时检索代码中是否实现了View.OnClickListener接口,然后在onClick方法尾部插入代码打点代码。

如何将参数传递给打点代码

View.OnClickListener listener=new View.OnClickListener() {
            @Test
            private Entity mdata;

            @Override
            public void onClick(View v) {
                mdata = new Entity();
                Log.i("MainActivity", v.toString());
                Intent intent = new Intent();
                intent.setClass(MainActivity.this, SecondActivity.class);
                startActivity(intent);
            }
        });

备注

androidautotrack's People

Contributors

leifzhang avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.