├── app
├── .gitignore
├── src
│ ├── main
│ │ ├── res
│ │ │ ├── values
│ │ │ │ ├── strings.xml
│ │ │ │ ├── colors.xml
│ │ │ │ └── themes.xml
│ │ │ ├── mipmap-hdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-mdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-xhdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-xxhdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-xxxhdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-anydpi-v26
│ │ │ │ ├── ic_launcher.xml
│ │ │ │ └── ic_launcher_round.xml
│ │ │ ├── menu
│ │ │ │ └── menu_main.xml
│ │ │ ├── layout
│ │ │ │ ├── activity_expandable_listview.xml
│ │ │ │ ├── fragment_test.xml
│ │ │ │ ├── child_item.xml
│ │ │ │ ├── parent_item.xml
│ │ │ │ ├── item_listview.xml
│ │ │ │ ├── tab1.xml
│ │ │ │ ├── tab2.xml
│ │ │ │ ├── tab3.xml
│ │ │ │ ├── activity_tabhost.xml
│ │ │ │ ├── activity_main.xml
│ │ │ │ └── activity_adapter_view_test.xml
│ │ │ ├── values-night
│ │ │ │ └── themes.xml
│ │ │ ├── drawable-v24
│ │ │ │ └── ic_launcher_foreground.xml
│ │ │ └── drawable
│ │ │ │ └── ic_launcher_background.xml
│ │ ├── java
│ │ │ └── com
│ │ │ │ └── peakmain
│ │ │ │ └── asmactualcombat
│ │ │ │ ├── viewmodel
│ │ │ │ └── ClickDealViewModel.kt
│ │ │ │ ├── view
│ │ │ │ ├── FixedHeightGridView.java
│ │ │ │ └── FixedHeightListView.java
│ │ │ │ ├── activity
│ │ │ │ ├── MainActivity.kt
│ │ │ │ ├── TestActivity.java
│ │ │ │ ├── AdapterViewTestActivity.java
│ │ │ │ └── TabHostTestActivity.java
│ │ │ │ ├── fragment
│ │ │ │ └── TestClickFragment.java
│ │ │ │ ├── adapter
│ │ │ │ └── TextViewListViewAdapter.java
│ │ │ │ ├── utils
│ │ │ │ └── TestUtils.java
│ │ │ │ └── App.java
│ │ └── AndroidManifest.xml
│ ├── test
│ │ └── java
│ │ │ └── com
│ │ │ └── peakmain
│ │ │ └── asmactualcombat
│ │ │ └── ExampleUnitTest.kt
│ └── androidTest
│ │ └── java
│ │ └── com
│ │ └── peakmain
│ │ └── asmactualcombat
│ │ └── ExampleInstrumentedTest.kt
├── proguard-rules.pro
└── build.gradle
├── plugin
├── .gitignore
├── consumer-rules.pro
├── peakmain.gpg
├── src
│ └── main
│ │ ├── resources
│ │ └── META-INF
│ │ │ └── gradle-plugins
│ │ │ └── com.peakmain.plugin.properties
│ │ └── groovy
│ │ └── com
│ │ └── peakmain
│ │ └── analytics
│ │ └── plugin
│ │ ├── utils
│ │ ├── StringBuilderUtils.groovy
│ │ ├── OpcodesUtils.groovy
│ │ ├── log
│ │ │ ├── LogUI.groovy
│ │ │ └── Logger.groovy
│ │ ├── MethodFieldUtils.groovy
│ │ └── NetworkFieldUtils.groovy
│ │ ├── entity
│ │ ├── MethodCalledBean.groovy
│ │ └── PeakmainMethodCell.groovy
│ │ ├── PeakmainPlugin.groovy
│ │ ├── visitor
│ │ ├── NetworkMethodCalledReplaceAdapter.groovy
│ │ ├── PeakmainVisitor.groovy
│ │ ├── MonitorMethodCalledReplaceAdapter.groovy
│ │ ├── MonitorMethodCalledClearAdapter.groovy
│ │ └── base
│ │ │ ├── MonitorMethodPatternAdapter.groovy
│ │ │ └── MonitorDefalutMethodAdapter.groovy
│ │ └── ext
│ │ ├── MonitorConfig.groovy
│ │ ├── NetworkHookMethodConfig.groovy
│ │ └── PeakmainHookConfig.groovy
├── local.gradle
├── upload.gradle
├── build.gradle
└── proguard-rules.pro
├── sdk
├── .gitignore
├── consumer-rules.pro
├── src
│ ├── main
│ │ ├── res
│ │ │ └── values
│ │ │ │ └── ids.xml
│ │ ├── java
│ │ │ └── com
│ │ │ │ └── peakmain
│ │ │ │ └── sdk
│ │ │ │ ├── utils
│ │ │ │ ├── network
│ │ │ │ │ ├── UserAgent.java
│ │ │ │ │ ├── NetworkGlide.java
│ │ │ │ │ └── Mob.java
│ │ │ │ ├── ReplaceReflexMethodUtils.java
│ │ │ │ ├── FragmentCacheUtil.java
│ │ │ │ ├── LogManager.java
│ │ │ │ ├── SystemUtils.java
│ │ │ │ ├── AopUtils.java
│ │ │ │ ├── Base64Coder.java
│ │ │ │ ├── ReflectUtil.java
│ │ │ │ └── PreferencesUtil.java
│ │ │ │ ├── annotation
│ │ │ │ ├── LogFrameInfo.java
│ │ │ │ ├── SensorsDataTrackViewOnClick.java
│ │ │ │ ├── DataFragmentTitle.java
│ │ │ │ └── LogMessage.java
│ │ │ │ ├── interfaces
│ │ │ │ ├── OnUploadSensorsDataListener.java
│ │ │ │ ├── ISensorsDataInstance.java
│ │ │ │ └── OnReplaceMethodListener.java
│ │ │ │ ├── constants
│ │ │ │ └── SensorsDataConstants.java
│ │ │ │ ├── manager
│ │ │ │ └── SensorsDatabaseHelper.java
│ │ │ │ ├── SensorsDataInstance.java
│ │ │ │ ├── SensorsDataAPI.java
│ │ │ │ ├── SensorsDataContentProvider.java
│ │ │ │ └── bean
│ │ │ │ └── SensorsEventBean.java
│ │ └── AndroidManifest.xml
│ ├── test
│ │ └── java
│ │ │ └── com
│ │ │ └── peakmain
│ │ │ └── sdk
│ │ │ └── ExampleUnitTest.java
│ └── androidTest
│ │ └── java
│ │ └── com
│ │ └── peakmain
│ │ └── sdk
│ │ └── ExampleInstrumentedTest.java
├── proguard-rules.pro
└── build.gradle
├── .idea
├── .gitignore
├── codeStyles
│ ├── codeStyleConfig.xml
│ └── Project.xml
├── compiler.xml
├── kotlinc.xml
├── vcs.xml
├── gradle.xml
├── jarRepositories.xml
├── inspectionProfiles
│ └── Project_Default.xml
└── misc.xml
├── repo
└── com
│ └── peakmain
│ └── android.plugin
│ ├── maven-metadata.xml.md5
│ ├── maven-metadata.xml.sha1
│ ├── 1.0.0
│ ├── android.plugin-1.0.0.jar.md5
│ ├── android.plugin-1.0.0.pom.md5
│ ├── android.plugin-1.0.0-javadoc.jar.md5
│ ├── android.plugin-1.0.0-sources.jar.md5
│ ├── android.plugin-1.0.0.jar.sha1
│ ├── android.plugin-1.0.0.pom.sha1
│ ├── android.plugin-1.0.0-groovydoc.jar.md5
│ ├── android.plugin-1.0.0-groovydoc.jar.sha1
│ ├── android.plugin-1.0.0-javadoc.jar.sha1
│ ├── android.plugin-1.0.0-sources.jar.sha1
│ ├── android.plugin-1.0.0.jar
│ ├── android.plugin-1.0.0-javadoc.jar
│ ├── android.plugin-1.0.0-sources.jar
│ ├── android.plugin-1.0.0-groovydoc.jar
│ └── android.plugin-1.0.0.pom
│ └── maven-metadata.xml
├── settings.gradle
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── jitpack.yml
├── .gitignore
├── config.gradle
├── gradle.properties
├── gradlew.bat
├── README.md
└── gradlew
/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
--------------------------------------------------------------------------------
/plugin/.gitignore:
--------------------------------------------------------------------------------
1 | /build
--------------------------------------------------------------------------------
/sdk/.gitignore:
--------------------------------------------------------------------------------
1 | /build
--------------------------------------------------------------------------------
/sdk/consumer-rules.pro:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/plugin/consumer-rules.pro:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # Default ignored files
2 | /shelf/
3 | /workspace.xml
4 |
--------------------------------------------------------------------------------
/repo/com/peakmain/android.plugin/maven-metadata.xml.md5:
--------------------------------------------------------------------------------
1 | 1aff9fd18322a3b736300a731672b239
--------------------------------------------------------------------------------
/plugin/peakmain.gpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Peakmain/AsmActualCombat/HEAD/plugin/peakmain.gpg
--------------------------------------------------------------------------------
/repo/com/peakmain/android.plugin/maven-metadata.xml.sha1:
--------------------------------------------------------------------------------
1 | fc3e850bc127b742963bfc2521a96b60fadd172d
--------------------------------------------------------------------------------
/repo/com/peakmain/android.plugin/1.0.0/android.plugin-1.0.0.jar.md5:
--------------------------------------------------------------------------------
1 | fd6124103aa9a77e38eaf78e9558166d
--------------------------------------------------------------------------------
/repo/com/peakmain/android.plugin/1.0.0/android.plugin-1.0.0.pom.md5:
--------------------------------------------------------------------------------
1 | 1f4a8c2099f7fc1746b8bed2e5c8d073
--------------------------------------------------------------------------------
/repo/com/peakmain/android.plugin/1.0.0/android.plugin-1.0.0-javadoc.jar.md5:
--------------------------------------------------------------------------------
1 | 2cc9b1363bfc937a7649e1aa16cea730
--------------------------------------------------------------------------------
/repo/com/peakmain/android.plugin/1.0.0/android.plugin-1.0.0-sources.jar.md5:
--------------------------------------------------------------------------------
1 | 32d450b9507a682871fd3e8605a16eba
--------------------------------------------------------------------------------
/repo/com/peakmain/android.plugin/1.0.0/android.plugin-1.0.0.jar.sha1:
--------------------------------------------------------------------------------
1 | b1369af4e2ec9f4ab89b1a61a19ec57bdb5c1cc5
--------------------------------------------------------------------------------
/repo/com/peakmain/android.plugin/1.0.0/android.plugin-1.0.0.pom.sha1:
--------------------------------------------------------------------------------
1 | 4091e952207b4d3f651142fb23baae002a0a11c2
--------------------------------------------------------------------------------
/repo/com/peakmain/android.plugin/1.0.0/android.plugin-1.0.0-groovydoc.jar.md5:
--------------------------------------------------------------------------------
1 | 0ac51ea00d12ba6ce9f1a20e85b9f379
--------------------------------------------------------------------------------
/repo/com/peakmain/android.plugin/1.0.0/android.plugin-1.0.0-groovydoc.jar.sha1:
--------------------------------------------------------------------------------
1 | fbb8bc2211ff080e1824de7a463f086f0051ba54
--------------------------------------------------------------------------------
/repo/com/peakmain/android.plugin/1.0.0/android.plugin-1.0.0-javadoc.jar.sha1:
--------------------------------------------------------------------------------
1 | 56a89147078682bfb97de30a858b4920e26b746a
--------------------------------------------------------------------------------
/repo/com/peakmain/android.plugin/1.0.0/android.plugin-1.0.0-sources.jar.sha1:
--------------------------------------------------------------------------------
1 | 39df0624188e77e61afecdd148c4f6a2f37a0aef
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':sdk'
2 | include ':plugin'
3 | include ':app'
4 | rootProject.name = "AsmActualCombat"
5 |
--------------------------------------------------------------------------------
/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | AsmActualCombat
3 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Peakmain/AsmActualCombat/HEAD/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/jitpack.yml:
--------------------------------------------------------------------------------
1 | before_install:
2 | - sdk install java 11.0.10-open
3 | - sdk use java 11.0.10-open
4 |
5 |
6 | jdk:
7 | - openjdk11
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Peakmain/AsmActualCombat/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Peakmain/AsmActualCombat/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/plugin/src/main/resources/META-INF/gradle-plugins/com.peakmain.plugin.properties:
--------------------------------------------------------------------------------
1 | implementation-class=com.peakmain.analytics.plugin.PeakmainPlugin
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Peakmain/AsmActualCombat/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Peakmain/AsmActualCombat/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Peakmain/AsmActualCombat/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Peakmain/AsmActualCombat/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Peakmain/AsmActualCombat/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Peakmain/AsmActualCombat/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Peakmain/AsmActualCombat/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Peakmain/AsmActualCombat/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/repo/com/peakmain/android.plugin/1.0.0/android.plugin-1.0.0.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Peakmain/AsmActualCombat/HEAD/repo/com/peakmain/android.plugin/1.0.0/android.plugin-1.0.0.jar
--------------------------------------------------------------------------------
/.idea/codeStyles/codeStyleConfig.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/repo/com/peakmain/android.plugin/1.0.0/android.plugin-1.0.0-javadoc.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Peakmain/AsmActualCombat/HEAD/repo/com/peakmain/android.plugin/1.0.0/android.plugin-1.0.0-javadoc.jar
--------------------------------------------------------------------------------
/repo/com/peakmain/android.plugin/1.0.0/android.plugin-1.0.0-sources.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Peakmain/AsmActualCombat/HEAD/repo/com/peakmain/android.plugin/1.0.0/android.plugin-1.0.0-sources.jar
--------------------------------------------------------------------------------
/.idea/compiler.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/repo/com/peakmain/android.plugin/1.0.0/android.plugin-1.0.0-groovydoc.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Peakmain/AsmActualCombat/HEAD/repo/com/peakmain/android.plugin/1.0.0/android.plugin-1.0.0-groovydoc.jar
--------------------------------------------------------------------------------
/.idea/kotlinc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/sdk/src/main/res/values/ids.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Wed Jan 19 15:44:53 CST 2022
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-6.7.1-all.zip
7 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 | /local.properties
4 | /.idea/caches
5 | /.idea/libraries
6 | /.idea/modules.xml
7 | /.idea/workspace.xml
8 | /.idea/navEditor.xml
9 | /.idea/assetWizardSettings.xml
10 | .DS_Store
11 | /build
12 | /captures
13 | .externalNativeBuild
14 | .cxx
15 | local.properties
16 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/menu_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #FFBB86FC
4 | #FF6200EE
5 | #FF3700B3
6 | #FF03DAC5
7 | #FF018786
8 | #FF000000
9 |
--------------------------------------------------------------------------------
/config.gradle:
--------------------------------------------------------------------------------
1 | ext {
2 | android = [
3 | compileSdkVersion: 31,
4 | targetSdkVersion : 31,
5 | minSdkVersion : 19,
6 | versionCode : 20220707,
7 | versionName : "1.1.0",
8 | ]
9 | dependencies = [
10 | jpush: ['cn.jiguang.sdk:jpush:4.6.0',
11 | 'cn.jiguang.sdk:jcore:3.1.2',],
12 | ]
13 | }
--------------------------------------------------------------------------------
/repo/com/peakmain/android.plugin/maven-metadata.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | com.peakmain
4 | android.plugin
5 |
6 | 1.0.0
7 |
8 | 1.0.0
9 |
10 | 20231012030831
11 |
12 |
13 |
--------------------------------------------------------------------------------
/sdk/src/main/java/com/peakmain/sdk/utils/network/UserAgent.java:
--------------------------------------------------------------------------------
1 | package com.peakmain.sdk.utils.network;
2 |
3 |
4 | /**
5 | * author :Peakmain
6 | * createTime:2022/6/14
7 | * mail:2726449200@qq.com
8 | * describe:
9 | */
10 | public class UserAgent {
11 |
12 | public static String getUa(com.qiniu.android.http.UserAgent userAgent, String part) {
13 | return "";
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/app/src/main/java/com/peakmain/asmactualcombat/viewmodel/ClickDealViewModel.kt:
--------------------------------------------------------------------------------
1 | package com.peakmain.asmactualcombat.viewmodel
2 |
3 | import com.peakmain.basiclibrary.base.viewmodel.BaseViewModel
4 |
5 | /**
6 | * author :Peakmain
7 | * createTime:2022/3/28
8 | * mail:2726449200@qq.com
9 | * describe:
10 | */
11 | class ClickDealViewModel: BaseViewModel() {
12 | override fun initModel() {
13 |
14 | }
15 | }
--------------------------------------------------------------------------------
/sdk/src/main/java/com/peakmain/sdk/utils/network/NetworkGlide.java:
--------------------------------------------------------------------------------
1 | package com.peakmain.sdk.utils.network;
2 |
3 | import java.util.HashMap;
4 | import java.util.Map;
5 |
6 | /**
7 | * author :Peakmain
8 | * createTime:2022/6/16
9 | * mail:2726449200@qq.com
10 | * describe:
11 | */
12 | public class NetworkGlide {
13 | public Map getHeaders() {
14 | return new HashMap<>();
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/app/src/test/java/com/peakmain/asmactualcombat/ExampleUnitTest.kt:
--------------------------------------------------------------------------------
1 | package com.peakmain.asmactualcombat
2 |
3 | import org.junit.Test
4 |
5 | import org.junit.Assert.*
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * See [testing documentation](http://d.android.com/tools/testing).
11 | */
12 | class ExampleUnitTest {
13 | @Test
14 | fun addition_isCorrect() {
15 | assertEquals(4, 2 + 2)
16 | }
17 | }
--------------------------------------------------------------------------------
/plugin/local.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'groovy'
2 | apply plugin: 'maven'
3 | repositories {
4 | jcenter()
5 | }
6 |
7 | uploadArchives {
8 | repositories.mavenDeployer {
9 | //本地仓库路径,以放到项目根目录下的 repo 的文件夹为例
10 | repository(url: uri('../repo'))
11 |
12 | //groupId
13 | pom.groupId = 'com.peakmain'
14 |
15 | //artifactId
16 | pom.artifactId = 'android.plugin'
17 |
18 | //插件版本号
19 | pom.version = '1.0.0'
20 | }
21 | }
22 |
23 |
--------------------------------------------------------------------------------
/sdk/src/test/java/com/peakmain/sdk/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.peakmain.sdk;
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() {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------
/sdk/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
11 |
12 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_expandable_listview.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
12 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_test.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
12 |
--------------------------------------------------------------------------------
/sdk/src/main/java/com/peakmain/sdk/annotation/LogFrameInfo.java:
--------------------------------------------------------------------------------
1 | package com.peakmain.sdk.annotation;
2 |
3 | import java.lang.annotation.ElementType;
4 | import java.lang.annotation.Retention;
5 | import java.lang.annotation.RetentionPolicy;
6 | import java.lang.annotation.Target;
7 |
8 | /**
9 | * author :Peakmain
10 | * createTime:2022/4/13
11 | * mail:2726449200@qq.com
12 | * describe:打印Method stack Map Frame
13 | */
14 |
15 | @Target({ElementType.METHOD})
16 | @Retention(RetentionPolicy.RUNTIME)
17 | public @interface LogFrameInfo {
18 | }
19 |
--------------------------------------------------------------------------------
/sdk/src/main/java/com/peakmain/sdk/annotation/SensorsDataTrackViewOnClick.java:
--------------------------------------------------------------------------------
1 | package com.peakmain.sdk.annotation;
2 |
3 | import java.lang.annotation.ElementType;
4 | import java.lang.annotation.Retention;
5 | import java.lang.annotation.RetentionPolicy;
6 | import java.lang.annotation.Target;
7 |
8 | /**
9 | * author:Peakmain
10 | * createTime:2021/6/15
11 | * mail:2726449200@qq.com
12 | * describe:
13 | */
14 | @Target({ElementType.METHOD})
15 | @Retention(RetentionPolicy.RUNTIME)
16 | public @interface SensorsDataTrackViewOnClick {
17 | }
18 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/child_item.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
13 |
--------------------------------------------------------------------------------
/sdk/src/main/java/com/peakmain/sdk/annotation/DataFragmentTitle.java:
--------------------------------------------------------------------------------
1 | package com.peakmain.sdk.annotation;
2 |
3 | import java.lang.annotation.ElementType;
4 | import java.lang.annotation.Retention;
5 | import java.lang.annotation.RetentionPolicy;
6 | import java.lang.annotation.Target;
7 |
8 | /**
9 | * author :Peakmain
10 | * createTime:2022/7/23
11 | * mail:2726449200@qq.com
12 | * describe:通过注解自定义 Fragment 的标题(title 属性)
13 | */
14 | @Target({ElementType.TYPE})
15 | @Retention(RetentionPolicy.RUNTIME)
16 | public @interface DataFragmentTitle {
17 | String title() default "";
18 | }
19 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/parent_item.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
14 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_listview.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
15 |
16 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/tab1.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
12 |
13 |
18 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/tab2.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
12 |
13 |
18 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/tab3.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
12 |
13 |
18 |
--------------------------------------------------------------------------------
/sdk/src/main/java/com/peakmain/sdk/annotation/LogMessage.java:
--------------------------------------------------------------------------------
1 | package com.peakmain.sdk.annotation;
2 |
3 | import java.lang.annotation.ElementType;
4 | import java.lang.annotation.Retention;
5 | import java.lang.annotation.RetentionPolicy;
6 | import java.lang.annotation.Target;
7 |
8 | /**
9 | * author :Peakmain
10 | * createTime:2021/6/16
11 | * describe:
12 | */
13 |
14 | @Target({ElementType.METHOD})
15 | @Retention(RetentionPolicy.RUNTIME)
16 | public @interface LogMessage {
17 | /**
18 | * 是否打印方法耗时时间
19 | */
20 | boolean isLogTime() default false;
21 |
22 | /**
23 | *
24 | * 是否打印方法的参数和返回值
25 | */
26 | boolean isLogParametersReturnValue() default false;
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/sdk/src/main/java/com/peakmain/sdk/interfaces/OnUploadSensorsDataListener.java:
--------------------------------------------------------------------------------
1 | package com.peakmain.sdk.interfaces;
2 |
3 | import com.peakmain.sdk.constants.SensorsDataConstants;
4 |
5 | /**
6 | * author :Peakmain
7 | * createTime:2022/3/29
8 | * mail:2726449200@qq.com
9 | * describe:上传埋点信息接口
10 | */
11 | public interface OnUploadSensorsDataListener {
12 | /**
13 | * 上传埋点
14 | *
15 | * @param state APP_START_EVENT_STATE = 1;
16 | * APP_END__EVENT_STATE = 2;
17 | * APP_VIEW_SCREEN__EVENT_STATE = 3;
18 | * APP_VIEW_CLICK__EVENT_STATE = 4;
19 | * @param data 埋点数据
20 | */
21 | void onUploadSensors(@SensorsDataConstants.STATE int state, String data);
22 | }
23 |
--------------------------------------------------------------------------------
/sdk/src/main/java/com/peakmain/sdk/interfaces/ISensorsDataInstance.java:
--------------------------------------------------------------------------------
1 | package com.peakmain.sdk.interfaces;
2 |
3 | import androidx.annotation.NonNull;
4 | import androidx.annotation.Nullable;
5 |
6 | import com.peakmain.sdk.SensorsDataAPI;
7 |
8 | import org.json.JSONObject;
9 |
10 | /**
11 | * author :Peakmain
12 | * createTime:2022/7/8
13 | * mail:2726449200@qq.com
14 | * describe:
15 | */
16 | public interface ISensorsDataInstance {
17 |
18 |
19 | void onEvent(String eventName, String eventValue);
20 | void track(@NonNull final String eventName, @Nullable JSONObject properties);
21 | void track(@NonNull final String eventName, @Nullable JSONObject properties,@Nullable OnUploadSensorsDataListener onUploadSensorsDataListener);
22 |
23 | }
24 |
--------------------------------------------------------------------------------
/plugin/upload.gradle:
--------------------------------------------------------------------------------
1 |
2 | version = '1.1.4'
3 | group = 'io.github.peakmain'
4 | gradlePlugin {
5 | plugins {
6 | peakmainPlugin {
7 | id = 'io.github.peakmain'
8 | implementationClass = 'com.peakmain.analytics.plugin.PeakmainPlugin'
9 | }
10 | }
11 | }
12 | pluginBundle {
13 | // These settings are set for the whole plugin bundle
14 | website = 'https://github.com/Peakmain/AsmActualCombat'
15 | vcsUrl = 'https://github.com/Peakmain/AsmActualCombat'
16 |
17 | description = 'Peakmain ASM plugin!'
18 |
19 | plugins {
20 | peakmainPlugin {
21 | // id is captured from java-gradle-plugin configuration
22 | displayName = 'com.peakmain.plugin'
23 | tags = ['android', 'asm_plugin']
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/plugin/build.gradle:
--------------------------------------------------------------------------------
1 |
2 | plugins {
3 | id 'maven-publish'
4 | id 'java-gradle-plugin'
5 | id 'com.gradle.plugin-publish' version '0.18.0'
6 | }
7 | apply plugin: 'groovy'
8 | apply plugin: 'maven'
9 | apply from :'upload.gradle'
10 | apply from :'local.gradle'
11 | dependencies {
12 | implementation gradleApi()
13 | implementation localGroovy()
14 |
15 | implementation 'org.ow2.asm:asm:9.2'
16 | implementation 'org.ow2.asm:asm-commons:9.2'
17 | implementation 'org.ow2.asm:asm-analysis:9.2'
18 | implementation 'org.ow2.asm:asm-util:9.2'
19 | implementation 'org.ow2.asm:asm-tree:9.2'
20 | compileOnly 'com.android.tools.build:gradle:4.0.1', {
21 | exclude group: 'org.ow2.asm'
22 | }
23 | }
24 |
25 | repositories {
26 | google()
27 | mavenCentral()
28 | }
29 |
30 |
--------------------------------------------------------------------------------
/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
--------------------------------------------------------------------------------
/app/src/main/java/com/peakmain/asmactualcombat/view/FixedHeightGridView.java:
--------------------------------------------------------------------------------
1 | package com.peakmain.asmactualcombat.view;
2 |
3 | import android.content.Context;
4 | import android.util.AttributeSet;
5 | import android.widget.GridView;
6 |
7 | /**
8 | * author :Peakmain
9 | * createTime:2022/3/28
10 | * mail:2726449200@qq.com
11 | * describe:
12 | */
13 | public class FixedHeightGridView extends GridView {
14 | public FixedHeightGridView(Context context, AttributeSet attrs) {
15 | super(context, attrs);
16 | }
17 |
18 | @Override
19 | protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
20 | int expandSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2,
21 | MeasureSpec.AT_MOST);
22 |
23 | super.onMeasure(widthMeasureSpec, expandSpec);
24 | }
25 |
26 | }
27 |
--------------------------------------------------------------------------------
/sdk/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
--------------------------------------------------------------------------------
/app/src/main/java/com/peakmain/asmactualcombat/view/FixedHeightListView.java:
--------------------------------------------------------------------------------
1 | package com.peakmain.asmactualcombat.view;
2 |
3 | import android.content.Context;
4 | import android.util.AttributeSet;
5 | import android.widget.ListView;
6 |
7 | /**
8 | * author :Peakmain
9 | * createTime:2022/3/28
10 | * mail:2726449200@qq.com
11 | * describe:
12 | */
13 | public class FixedHeightListView extends ListView {
14 | public FixedHeightListView(Context context, AttributeSet attrs) {
15 | super(context, attrs);
16 | }
17 |
18 | @Override
19 | protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
20 | int expandSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2,
21 |
22 | MeasureSpec.AT_MOST);
23 |
24 | super.onMeasure(widthMeasureSpec, expandSpec);
25 | }
26 |
27 | }
28 |
--------------------------------------------------------------------------------
/plugin/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
--------------------------------------------------------------------------------
/app/src/androidTest/java/com/peakmain/asmactualcombat/ExampleInstrumentedTest.kt:
--------------------------------------------------------------------------------
1 | package com.peakmain.asmactualcombat
2 |
3 | import androidx.test.platform.app.InstrumentationRegistry
4 | import androidx.test.ext.junit.runners.AndroidJUnit4
5 |
6 | import org.junit.Test
7 | import org.junit.runner.RunWith
8 |
9 | import org.junit.Assert.*
10 |
11 | /**
12 | * Instrumented test, which will execute on an Android device.
13 | *
14 | * See [testing documentation](http://d.android.com/tools/testing).
15 | */
16 | @RunWith(AndroidJUnit4::class)
17 | class ExampleInstrumentedTest {
18 | @Test
19 | fun useAppContext() {
20 | // Context of the app under test.
21 | val appContext = InstrumentationRegistry.getInstrumentation().targetContext
22 | assertEquals("com.peakmain.asmactualcombat", appContext.packageName)
23 | }
24 | }
--------------------------------------------------------------------------------
/app/src/main/res/values/themes.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
16 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_tabhost.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
12 |
13 |
18 |
19 |
23 |
24 |
--------------------------------------------------------------------------------
/sdk/src/androidTest/java/com/peakmain/sdk/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package com.peakmain.sdk;
2 |
3 | import android.content.Context;
4 |
5 | import androidx.test.platform.app.InstrumentationRegistry;
6 | import androidx.test.ext.junit.runners.AndroidJUnit4;
7 |
8 | import org.junit.Test;
9 | import org.junit.runner.RunWith;
10 |
11 | import static org.junit.Assert.*;
12 |
13 | /**
14 | * Instrumented test, which will execute on an Android device.
15 | *
16 | * @see Testing documentation
17 | */
18 | @RunWith(AndroidJUnit4.class)
19 | public class ExampleInstrumentedTest {
20 | @Test
21 | public void useAppContext() {
22 | // Context of the app under test.
23 | Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
24 | assertEquals("com.peakmain.sdk.test", appContext.getPackageName());
25 | }
26 | }
--------------------------------------------------------------------------------
/.idea/gradle.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
21 |
22 |
--------------------------------------------------------------------------------
/app/src/main/res/values-night/themes.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
16 |
--------------------------------------------------------------------------------
/plugin/src/main/groovy/com/peakmain/analytics/plugin/utils/StringBuilderUtils.groovy:
--------------------------------------------------------------------------------
1 | package com.peakmain.analytics.plugin.utils
2 |
3 | import org.objectweb.asm.MethodVisitor
4 | import org.objectweb.asm.Opcodes
5 |
6 | /**
7 | * author :Peakmain
8 | * createTime:2022/4/6
9 | * mail:2726449200@qq.com
10 | * describe:StringBuilder的工具类
11 | */
12 | class StringBuilderUtils {
13 | private MethodVisitor mv
14 |
15 | StringBuilderUtils(MethodVisitor methodVisitor) {
16 | this.mv = methodVisitor
17 | }
18 |
19 | void appendLdcString(String value) {
20 | mv.visitTypeInsn(Opcodes.NEW, "java/lang/StringBuilder")
21 | mv.visitInsn(Opcodes.DUP)
22 | mv.visitMethodInsn(Opcodes.INVOKESPECIAL, "java/lang/StringBuilder", "", "()V", false);
23 | mv.visitLdcInsn(value)
24 | mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, "java/lang/StringBuilder", "append", "(Ljava/lang/String;)Ljava/lang/StringBuilder;", false)
25 | mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, "java/lang/StringBuilder", "toString", "()Ljava/lang/String;", false)
26 | }
27 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/peakmain/asmactualcombat/activity/MainActivity.kt:
--------------------------------------------------------------------------------
1 | package com.peakmain.asmactualcombat.activity
2 |
3 | import android.content.Intent
4 | import cn.jiguang.w.c
5 | import com.peakmain.basiclibrary.base.activity.BaseActivity
6 | import com.peakmain.asmactualcombat.viewmodel.ClickDealViewModel
7 | import com.peakmain.asmactualcombat.R
8 | import com.peakmain.asmactualcombat.databinding.ActivityMainBinding
9 | import com.peakmain.asmactualcombat.utils.Utils
10 | import com.peakmain.ui.utils.ToastUtils
11 |
12 | /**
13 | * author :Peakmain
14 | * createTime:2022/1/14
15 | * mail:2726449200@qq.com
16 | * describe:
17 | */
18 | class MainActivity(override val layoutId: Int = R.layout.activity_main) :
19 | BaseActivity() {
20 |
21 | override fun initView() {
22 | mBinding.buttonClick.setOnClickListener {
23 | startActivity(Intent(this, ClickDealActivity::class.java))
24 | }
25 | mBinding.buttonClick1.setOnClickListener {
26 | //startActivity(Intent(this,TestActivity::class.java))
27 | ToastUtils.showLong(Utils.getAndroidId(this))
28 | }
29 | }
30 |
31 | }
--------------------------------------------------------------------------------
/sdk/build.gradle:
--------------------------------------------------------------------------------
1 | plugins {
2 | id 'com.android.library'
3 | }
4 |
5 | android {
6 | compileSdkVersion rootProject.ext.android.compileSdkVersion
7 |
8 | defaultConfig {
9 | minSdkVersion rootProject.ext.android.minSdkVersion
10 | targetSdkVersion rootProject.ext.android.targetSdkVersion
11 | versionCode rootProject.ext.android.versionCode
12 | versionName rootProject.ext.android.versionName
13 |
14 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
15 | consumerProguardFiles "consumer-rules.pro"
16 | }
17 |
18 | buildTypes {
19 | release {
20 | minifyEnabled false
21 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
22 | }
23 | }
24 | compileOptions {
25 | sourceCompatibility JavaVersion.VERSION_1_8
26 | targetCompatibility JavaVersion.VERSION_1_8
27 | }
28 | }
29 |
30 | dependencies {
31 |
32 | implementation 'androidx.appcompat:appcompat:1.2.0'
33 | implementation 'org.jetbrains:annotations:15.0'
34 | implementation 'com.qiniu:qiniu-android-sdk:7.3.15'
35 | implementation 'androidx.preference:preference:1.1.1'
36 | }
--------------------------------------------------------------------------------
/sdk/src/main/java/com/peakmain/sdk/interfaces/OnReplaceMethodListener.java:
--------------------------------------------------------------------------------
1 | package com.peakmain.sdk.interfaces;
2 |
3 | import android.content.ContentResolver;
4 | import android.content.pm.PackageInfo;
5 | import android.content.pm.PackageManager;
6 | import android.net.wifi.ScanResult;
7 | import android.net.wifi.WifiInfo;
8 | import android.net.wifi.WifiManager;
9 | import android.telephony.SubscriptionInfo;
10 | import android.telephony.TelephonyManager;
11 |
12 | import com.peakmain.sdk.constants.SensorsDataConstants;
13 |
14 | import java.util.List;
15 |
16 | /**
17 | * author :Peakmain
18 | * createTime:2022/4/15
19 | * mail:2726449200@qq.com
20 | * describe:替换方法监听事件
21 | */
22 | public interface OnReplaceMethodListener {
23 | String onReplaceMethodListener(@SensorsDataConstants.TELEPHONY_STATE int telephoneState, TelephonyManager manager, int slotIndex);
24 |
25 |
26 | WifiInfo onReplaceMethodListener(WifiManager wifiManager);
27 |
28 | List onReplaceWifiManagerMethodListener(WifiManager wifiManager);
29 |
30 | String onReplaceMethodListener(SubscriptionInfo subscriptionInfo);
31 |
32 | List onReplaceMethodListener(PackageManager manager);
33 |
34 | String onReplaceMethodListener(ContentResolver resolver, String name);
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/plugin/src/main/groovy/com/peakmain/analytics/plugin/entity/MethodCalledBean.groovy:
--------------------------------------------------------------------------------
1 | package com.peakmain.analytics.plugin.entity
2 |
3 | /**
4 | * author :Peakmain
5 | * createTime:2022/4/1
6 | * mail:2726449200@qq.com
7 | * describe:
8 | */
9 | class MethodCalledBean {
10 | String methodOwner
11 | String methodName
12 | String[] methodDescriptor
13 | String newMethodOwner
14 | String newMethodName
15 | int newOpcode
16 |
17 | HashMap newMethodDescriptor
18 |
19 |
20 | MethodCalledBean(String methodOwner, String methodName, String[] methodDescriptor) {
21 | this.methodOwner = methodOwner
22 | this.methodName = methodName
23 | this.methodDescriptor = methodDescriptor
24 | }
25 |
26 | MethodCalledBean(String methodOwner, String methodName, String[] methodDescriptor, String newMethodOwner, String newMethodName, int newOpcode, HashMap newMethodDescriptor) {
27 | this.methodOwner = methodOwner
28 | this.methodName = methodName
29 | this.methodDescriptor = methodDescriptor
30 | this.newMethodOwner = newMethodOwner
31 | this.newMethodName = newMethodName
32 | this.newOpcode = newOpcode
33 | this.newMethodDescriptor = newMethodDescriptor
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/plugin/src/main/groovy/com/peakmain/analytics/plugin/utils/OpcodesUtils.groovy:
--------------------------------------------------------------------------------
1 | package com.peakmain.analytics.plugin.utils
2 |
3 | import org.objectweb.asm.Opcodes
4 |
5 | class OpcodesUtils implements Opcodes {
6 | public static final int ASM_VERSION = Opcodes.ASM9
7 | static boolean isSynthetic(int access) {
8 | return (access & ACC_SYNTHETIC) != 0
9 | }
10 |
11 | static boolean isPrivate(int access) {
12 | return (access & ACC_PRIVATE) != 0
13 | }
14 |
15 | static boolean isPublic(int access) {
16 | return (access & ACC_PUBLIC) != 0
17 | }
18 |
19 | static boolean isStatic(int access) {
20 | return (access & ACC_STATIC) != 0
21 | }
22 |
23 | static boolean isNative(int access) {
24 | return (access & ACC_NATIVE) != 0
25 | }
26 |
27 | static boolean isAbstract(int access) {
28 | return (access & ACC_ABSTRACT) != 0
29 | }
30 | /**
31 | * 是否是接口
32 | */
33 | static boolean isInterface(int access) {
34 | return (access & ACC_INTERFACE) != 0
35 | }
36 | /**
37 | * 是否是枚举类型
38 | */
39 | static boolean isEnum(int access) {
40 | return (access & ACC_ENUM) != 0
41 |
42 | }
43 |
44 | static boolean isInitMethod(String name) {
45 | return name == ""
46 | }
47 |
48 | }
49 |
--------------------------------------------------------------------------------
/plugin/src/main/groovy/com/peakmain/analytics/plugin/utils/log/LogUI.groovy:
--------------------------------------------------------------------------------
1 | package com.peakmain.analytics.plugin.utils.log
2 | /**
3 | * 具体规则
4 | * 字背景颜色范围: 40--49 字颜色: 30--39
5 | * 40: 黑 30: 黑
6 | * 41:红 31: 红
7 | * 42:绿 32: 绿
8 | * 43:黄 33: 黄
9 | * 44:蓝 34: 蓝
10 | * 45:紫 35: 紫
11 | * 46:深绿 36: 深绿
12 | * 47:白色 37: 白色
13 | *
14 | * 输出特效格式控制
15 | * 033[0m 关闭所有属性
16 | * 033[1m 设置高亮度
17 | * 03[4m 下划线
18 | * 033[5m 闪烁
19 | * 033[7m 反显
20 | * 033[8m 消隐
21 | * 033[30m -- \033[37m 设置前景色
22 | * 033[40m -- \033[47m 设置背景色
23 | */
24 | enum LogUI {
25 | //color
26 | C_ERROR("\033[40;31m"),
27 | C_WARN("\033[40;33m"),
28 | C_BLACK_GREEN("\033[40;32m"),
29 | //end
30 | E_NORMAL("\033[0m");
31 |
32 | private final String value
33 |
34 | LogUI(String value) {
35 | this.value = value
36 | }
37 |
38 | String getValue() {
39 | return this.value
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
11 |
17 |
23 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/plugin/src/main/groovy/com/peakmain/analytics/plugin/entity/PeakmainMethodCell.groovy:
--------------------------------------------------------------------------------
1 | package com.peakmain.analytics.plugin.entity
2 |
3 | class PeakmainMethodCell {
4 | /**
5 | * 原方法名
6 | */
7 | String name
8 | /**
9 | * 原方法描述
10 | */
11 | String desc
12 | /**
13 | * 方法所在的接口或类
14 | */
15 | String parent
16 | /**
17 | * 采集数据的方法名
18 | */
19 | String agentName
20 | /**
21 | * 采集数据的方法描述
22 | */
23 | String agentDesc
24 | /**
25 | * 采集数据的方法参数起始索引( 0:this,1+:普通参数 )
26 | */
27 | int paramsStart
28 | /**
29 | * 采集数据的方法参数个数
30 | */
31 | int paramsCount
32 | /**
33 | * 参数类型对应的ASM指令,加载不同类型的参数需要不同的指令
34 | */
35 | List opcodes
36 |
37 | PeakmainMethodCell(String name, String desc, String agentName) {
38 | this.name = name
39 | this.desc = desc
40 | this.agentName = agentName
41 | }
42 |
43 | PeakmainMethodCell(String name, String desc, String parent, String agentName, String agentDesc, int paramsStart, int paramsCount, List opcodes) {
44 | this.name = name
45 | this.desc = desc
46 | this.parent = parent
47 | this.agentName = agentName
48 | this.agentDesc = agentDesc
49 | this.paramsStart = paramsStart
50 | this.paramsCount = paramsCount
51 | this.opcodes = opcodes
52 | }
53 | }
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 | # IDE (e.g. Android Studio) users:
3 | # Gradle settings configured through the IDE *will override*
4 | # any settings specified in this file.
5 | # For more details on how to configure your build environment visit
6 | # http://www.gradle.org/docs/current/userguide/build_environment.html
7 | # Specifies the JVM arguments used for the daemon process.
8 | # The setting is particularly useful for tweaking memory settings.
9 | org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
10 | # When configured, Gradle will run in incubating parallel mode.
11 | # This option should only be used with decoupled projects. More details, visit
12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
13 | # org.gradle.parallel=true
14 | # AndroidX package structure to make it clearer which packages are bundled with the
15 | # Android operating system, and which are packaged with your app"s APK
16 | # https://developer.android.com/topic/libraries/support-library/androidx-rn
17 | android.useAndroidX=true
18 | # Automatically convert third-party libraries to use AndroidX
19 | android.enableJetifier=true
20 | # Kotlin code style for this project: "official" or "obsolete":
21 | kotlin.code.style=official
22 | monitorPlugin.disableAppPlugin=false
23 | android.useNewApkCreator=false
24 |
25 |
26 | applicationId="com.peakmain.asmactualcombat"
27 | jpushKey=c96e188b4adafb8551aea1a3
--------------------------------------------------------------------------------
/repo/com/peakmain/android.plugin/1.0.0/android.plugin-1.0.0.pom:
--------------------------------------------------------------------------------
1 |
2 |
4 | 4.0.0
5 | com.peakmain
6 | android.plugin
7 | 1.0.0
8 |
9 |
10 | org.ow2.asm
11 | asm
12 | 9.2
13 | runtime
14 |
15 |
16 | org.ow2.asm
17 | asm-commons
18 | 9.2
19 | runtime
20 |
21 |
22 | org.ow2.asm
23 | asm-analysis
24 | 9.2
25 | runtime
26 |
27 |
28 | org.ow2.asm
29 | asm-util
30 | 9.2
31 | runtime
32 |
33 |
34 | org.ow2.asm
35 | asm-tree
36 | 9.2
37 | runtime
38 |
39 |
40 |
41 |
--------------------------------------------------------------------------------
/sdk/src/main/java/com/peakmain/sdk/utils/ReplaceReflexMethodUtils.java:
--------------------------------------------------------------------------------
1 | package com.peakmain.sdk.utils;
2 |
3 | import android.util.Log;
4 |
5 | import com.peakmain.sdk.map.p;
6 |
7 | import java.lang.reflect.Method;
8 |
9 | /**
10 | * author :Peakmain
11 | * createTime:2022/6/10
12 | * mail:2726449200@qq.com
13 | * describe:
14 | */
15 | public class ReplaceReflexMethodUtils {
16 |
17 | public static Method a(Class clazz, String name, Class>... var2) {
18 | if("getImei".equals(name)){
19 | Log.e("TAG","getImei");
20 | return null;
21 | }
22 | try {
23 | return clazz.getDeclaredMethod(c(name), var2);
24 | } catch (Throwable var3) {
25 | return null;
26 | }
27 | }
28 | public static String c(String var0) {
29 | return var0.length() < 2 ? "" : p.a(var0.substring(1));
30 | }
31 | public static Object a(String var0, String name, Object[] var2, Class>[] var3) throws Exception {
32 | if("getImei".equals(name)){
33 | Log.e("TAG","getImei");
34 | return null;
35 | }
36 | return a(Class.forName(var0), name, var2, var3);
37 | }
38 | private static Object a(Class> var0, String var1, Object[] var2, Class>[] var3) throws Exception {
39 | Method var4;
40 | if (!(var4 = var0.getDeclaredMethod(var1, var3)).isAccessible()) {
41 | var4.setAccessible(true);
42 | }
43 |
44 | return var4.invoke((Object)null, var2);
45 | }
46 |
47 | }
48 |
--------------------------------------------------------------------------------
/app/src/main/java/com/peakmain/asmactualcombat/fragment/TestClickFragment.java:
--------------------------------------------------------------------------------
1 | package com.peakmain.asmactualcombat.fragment;
2 |
3 |
4 | import android.os.Bundle;
5 | import android.view.LayoutInflater;
6 | import android.view.View;
7 | import android.view.ViewGroup;
8 |
9 | import androidx.annotation.NonNull;
10 | import androidx.annotation.Nullable;
11 | import androidx.appcompat.widget.AppCompatButton;
12 | import androidx.fragment.app.Fragment;
13 |
14 | import com.peakmain.asmactualcombat.R;
15 | import com.peakmain.sdk.annotation.DataFragmentTitle;
16 | import com.peakmain.ui.utils.ToastUtils;
17 |
18 | /**
19 | * author :Peakmain
20 | * createTime:2022/3/28
21 | * mail:2726449200@qq.com
22 | * describe:
23 | */
24 | @DataFragmentTitle(title="测试Fragment")
25 | public class TestClickFragment extends Fragment {
26 | @Nullable
27 | @Override
28 | public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
29 | View view = inflater.inflate(R.layout.fragment_test, container, false);
30 | AppCompatButton button = view.findViewById(R.id.button);
31 | button.setTag(R.id.sensors_analytics_tag_view_fragment_name,TestClickFragment.class.getCanonicalName());
32 | button.setOnClickListener(new View.OnClickListener() {
33 | @Override
34 | public void onClick(View view) {
35 | ToastUtils.showShort("TestFragment click");
36 | }
37 | });
38 | return view;
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_adapter_view_test.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
10 |
11 |
17 |
18 |
22 |
23 |
29 |
30 |
36 |
37 |
--------------------------------------------------------------------------------
/sdk/src/main/java/com/peakmain/sdk/utils/FragmentCacheUtil.java:
--------------------------------------------------------------------------------
1 | package com.peakmain.sdk.utils;
2 |
3 | import android.text.TextUtils;
4 |
5 | import androidx.collection.LruCache;
6 |
7 | import java.lang.ref.WeakReference;
8 |
9 | /**
10 | * author :Peakmain
11 | * createTime:2022/7/23
12 | * mail:2726449200@qq.com
13 | * describe:
14 | */
15 | public class FragmentCacheUtil {
16 | private static final LruCache> sFragmentLruCache = new LruCache<>(Integer.MAX_VALUE);
17 | public static void setFragmentToCache(String fragmentName, Object object) {
18 | if (!TextUtils.isEmpty(fragmentName) && null != object) {
19 | sFragmentLruCache.put(fragmentName, new WeakReference<>(object));
20 | }
21 | }
22 |
23 | public static Object getFragmentFromCache(String fragmentName) {
24 | try {
25 | if (!TextUtils.isEmpty(fragmentName)) {
26 | WeakReference