From 5c7252031f5b45b2908b5ce5d40408435b3e77a1 Mon Sep 17 00:00:00 2001 From: tianhui12 <83947211+tianhui12@users.noreply.github.com> Date: Tue, 26 Dec 2023 18:57:50 +0800 Subject: [PATCH] Feat/v2.0.0 (#8) * giokit 2.0.0 * rename advert->ads * ViewPosition -> Index * Update libs.versions.toml --------- Co-authored-by: shenliming <348515494@qq.com> Co-authored-by: tianhui --- app-saas/.gitignore | 1 - app-saas/build.gradle | 65 --- app-saas/proguard-rules.pro | 21 - app-saas/src/main/AndroidManifest.xml | 37 -- .../src/main/java/com/growingio/saas/App.kt | 70 --- .../growingio/saas/CustomChromeClient.java | 24 - .../java/com/growingio/saas/MainActivity.kt | 27 -- .../com/growingio/saas/MoreChromeClient.java | 24 - .../saas/WebCircleHybridActivity.java | 45 -- .../saas/X5CircleHybridActivity.java | 51 --- .../drawable-v24/ic_launcher_foreground.xml | 30 -- .../res/drawable/ic_launcher_background.xml | 170 -------- .../main/res/layout/activity_web_circle.xml | 13 - .../src/main/res/layout/activity_web_x5.xml | 13 - .../res/mipmap-anydpi-v26/ic_launcher.xml | 5 - .../mipmap-anydpi-v26/ic_launcher_round.xml | 5 - .../src/main/res/mipmap-hdpi/ic_launcher.png | Bin 3593 -> 0 bytes .../res/mipmap-hdpi/ic_launcher_round.png | Bin 5339 -> 0 bytes .../src/main/res/mipmap-mdpi/ic_launcher.png | Bin 2636 -> 0 bytes .../res/mipmap-mdpi/ic_launcher_round.png | Bin 3388 -> 0 bytes .../src/main/res/mipmap-xhdpi/ic_launcher.png | Bin 4926 -> 0 bytes .../res/mipmap-xhdpi/ic_launcher_round.png | Bin 7472 -> 0 bytes .../main/res/mipmap-xxhdpi/ic_launcher.png | Bin 7909 -> 0 bytes .../res/mipmap-xxhdpi/ic_launcher_round.png | Bin 11873 -> 0 bytes .../main/res/mipmap-xxxhdpi/ic_launcher.png | Bin 10652 -> 0 bytes .../res/mipmap-xxxhdpi/ic_launcher_round.png | Bin 16570 -> 0 bytes app-saas/src/main/res/values-night/themes.xml | 16 - app-saas/src/main/res/values/colors.xml | 10 - app-saas/src/main/res/values/strings.xml | 3 - app-saas/src/main/res/values/themes.xml | 16 - app/build.gradle | 57 ++- app/src/main/AndroidManifest.xml | 3 +- .../main/java/com/growingio/giokit/v3/App.kt | 13 +- .../com/growingio/giokit/v3/LambdaTest.java | 14 +- .../com/growingio/giokit/v3/MainActivity.kt | 4 + .../com/growingio/giokit/v3/SecondActivity.kt | 13 +- .../giokit/v3/WebCircleHybridActivity.java | 3 +- .../src/main/res/layout/activity_second.xml | 32 +- build.gradle | 34 +- config.gradle | 79 ---- giokit-no-op/build.gradle | 17 +- giokit-no-op/src/main/AndroidManifest.xml | 4 - giokit-plugin/.gitignore | 1 - giokit-plugin/build.gradle | 43 -- giokit-plugin/gradle.properties | 19 - giokit-plugin/publishMaven.gradle | 182 -------- giokit-plugin/settings.gradle | 19 - .../growingio/giokit/plugin/GioKitPlugin.kt | 106 ----- .../giokit/plugin/GioKitSaasPlugin.kt | 111 ----- .../plugin/extension/GioKitExtension.kt | 31 -- .../plugin/processor/GioKitConfigProcessor.kt | 112 ----- .../plugin/processor/GioKitXmlHandler.kt | 56 --- .../plugin/transform/GioBaseClassVisitor.kt | 132 ------ .../plugin/transform/HookInjectorClass.kt | 232 ---------- .../plugin/transform/saas/GioCodeVisitor.kt | 191 -------- .../plugin/transform/saas/GioConfigVisitor.kt | 144 ------ .../transform/saas/GioDatabaseVisitor.kt | 86 ---- .../plugin/transform/saas/GioHttpVisitor.kt | 60 --- .../transform/saas/GioWebViewVisitor.kt | 134 ------ .../transform/saas/GiokitSaasFactory.kt | 90 ---- .../transform/saas/GiokitSaasTransform.kt | 94 ---- .../plugin/transform/v3/GioCodeVisitor.kt | 190 -------- .../plugin/transform/v3/GioConfigVisitor.kt | 144 ------ .../plugin/transform/v3/GioDatabaseVisitor.kt | 100 ----- .../plugin/transform/v3/GioHttpVisitor.kt | 120 ----- .../plugin/transform/v3/GioWebViewVisitor.kt | 124 ------ .../plugin/transform/v3/GiokitV3Factory.kt | 90 ---- .../plugin/transform/v3/GiokitV3Transform.kt | 94 ---- .../giokit/plugin/utils/FilterUtils.kt | 100 ----- .../giokit/plugin/utils/GioKitExt.kt | 81 ---- .../plugin/utils/GioTransformContext.kt | 70 --- giokit/build.gradle | 59 ++- giokit/src/main/AndroidManifest.xml | 4 +- giokit/src/main/assets/gio_hybrid.min.js | 3 - giokit/src/main/assets/giokit_touch.js | 1 + .../java/com/growingio/giokit/GioKitImpl.kt | 11 - .../java/com/growingio/giokit/GioKitOption.kt | 3 - .../growingio/giokit/circle/ActionStruct.java | 71 --- .../giokit/circle/CircleAnchorView.java | 329 +++++++------- .../giokit/circle/ClassExistHelper.java | 264 ----------- .../growingio/giokit/circle/ViewHelper.java | 277 ------------ .../com/growingio/giokit/circle/ViewNode.java | 409 ------------------ .../growingio/giokit/circle/ViewTraveler.java | 13 - .../growingio/giokit/circle/WindowHelper.java | 4 - .../com/growingio/giokit/hook/GioDatabase.kt | 62 +-- .../growingio/giokit/hook/GioPluginConfig.kt | 70 ++- .../com/growingio/giokit/hook/GioWebView.kt | 81 +++- .../giokit/hover/menu/GioSdkMenuContent.kt | 8 + .../giokit/instant/InstantEventView.kt | 9 + .../giokit/launch/sdkcrash/SdkErrorAdapter.kt | 6 +- .../giokit/launch/sdkdata/SdkDataAdapter.kt | 7 + .../launch/sdkdata/SdkDataHeaderAdapter.kt | 29 +- .../launch/sdkdata/SdkDataInfoFragment.kt | 2 + .../launch/sdkdata/SdkDataSearchSource.kt | 2 +- .../sdkdata/SdkSearchEventPopupWindow.kt | 4 + .../giokit/launch/sdkhttp/SdkHttpAdapter.kt | 5 + .../launch/sdkhttp/SdkHttpRequestFragment.kt | 2 + .../giokit/launch/sdkinfo/SdkInfoFragment.kt | 16 +- .../giokit/setting/GiokitSettingActivity.kt | 2 + .../setting/SdkCommonSettingFragment.kt | 1 - .../giokit/utils/CheckSdkStatusManager.kt | 45 +- .../giokit/utils/CheckSdkStatusSaasImpl.kt | 201 --------- .../giokit/utils/CheckSdkStatusV3Impl.kt | 38 +- .../com/growingio/giokit/utils/FileUtils.kt | 7 + .../giokit/utils/SdkSaasInfoUtils.kt | 220 ---------- .../growingio/giokit/utils/SdkV3InfoUtils.kt | 52 +-- gradle/libs.versions.toml | 203 +++++++++ gradle/publishAll.sh | 1 - gradle/publishAllToMavenLocal.sh | 1 - gradle/publishMaven.gradle | 2 +- gradle/stagingMaven.gradle | 2 +- settings.gradle | 12 - uikit/build.gradle | 27 +- uikit/src/main/AndroidManifest.xml | 7 - .../hover/window/HoverMenuService.java | 2 +- 115 files changed, 735 insertions(+), 5714 deletions(-) delete mode 100644 app-saas/.gitignore delete mode 100644 app-saas/build.gradle delete mode 100644 app-saas/proguard-rules.pro delete mode 100644 app-saas/src/main/AndroidManifest.xml delete mode 100644 app-saas/src/main/java/com/growingio/saas/App.kt delete mode 100644 app-saas/src/main/java/com/growingio/saas/CustomChromeClient.java delete mode 100644 app-saas/src/main/java/com/growingio/saas/MainActivity.kt delete mode 100644 app-saas/src/main/java/com/growingio/saas/MoreChromeClient.java delete mode 100644 app-saas/src/main/java/com/growingio/saas/WebCircleHybridActivity.java delete mode 100644 app-saas/src/main/java/com/growingio/saas/X5CircleHybridActivity.java delete mode 100644 app-saas/src/main/res/drawable-v24/ic_launcher_foreground.xml delete mode 100644 app-saas/src/main/res/drawable/ic_launcher_background.xml delete mode 100644 app-saas/src/main/res/layout/activity_web_circle.xml delete mode 100644 app-saas/src/main/res/layout/activity_web_x5.xml delete mode 100644 app-saas/src/main/res/mipmap-anydpi-v26/ic_launcher.xml delete mode 100644 app-saas/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml delete mode 100644 app-saas/src/main/res/mipmap-hdpi/ic_launcher.png delete mode 100644 app-saas/src/main/res/mipmap-hdpi/ic_launcher_round.png delete mode 100644 app-saas/src/main/res/mipmap-mdpi/ic_launcher.png delete mode 100644 app-saas/src/main/res/mipmap-mdpi/ic_launcher_round.png delete mode 100644 app-saas/src/main/res/mipmap-xhdpi/ic_launcher.png delete mode 100644 app-saas/src/main/res/mipmap-xhdpi/ic_launcher_round.png delete mode 100644 app-saas/src/main/res/mipmap-xxhdpi/ic_launcher.png delete mode 100644 app-saas/src/main/res/mipmap-xxhdpi/ic_launcher_round.png delete mode 100644 app-saas/src/main/res/mipmap-xxxhdpi/ic_launcher.png delete mode 100644 app-saas/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png delete mode 100644 app-saas/src/main/res/values-night/themes.xml delete mode 100644 app-saas/src/main/res/values/colors.xml delete mode 100644 app-saas/src/main/res/values/strings.xml delete mode 100644 app-saas/src/main/res/values/themes.xml rename app-saas/src/main/res/layout/activity_main.xml => app/src/main/res/layout/activity_second.xml (55%) delete mode 100644 config.gradle delete mode 100644 giokit-no-op/src/main/AndroidManifest.xml delete mode 100644 giokit-plugin/.gitignore delete mode 100644 giokit-plugin/build.gradle delete mode 100644 giokit-plugin/gradle.properties delete mode 100644 giokit-plugin/publishMaven.gradle delete mode 100644 giokit-plugin/settings.gradle delete mode 100644 giokit-plugin/src/main/kotlin/com/growingio/giokit/plugin/GioKitPlugin.kt delete mode 100644 giokit-plugin/src/main/kotlin/com/growingio/giokit/plugin/GioKitSaasPlugin.kt delete mode 100644 giokit-plugin/src/main/kotlin/com/growingio/giokit/plugin/extension/GioKitExtension.kt delete mode 100644 giokit-plugin/src/main/kotlin/com/growingio/giokit/plugin/processor/GioKitConfigProcessor.kt delete mode 100644 giokit-plugin/src/main/kotlin/com/growingio/giokit/plugin/processor/GioKitXmlHandler.kt delete mode 100644 giokit-plugin/src/main/kotlin/com/growingio/giokit/plugin/transform/GioBaseClassVisitor.kt delete mode 100644 giokit-plugin/src/main/kotlin/com/growingio/giokit/plugin/transform/HookInjectorClass.kt delete mode 100644 giokit-plugin/src/main/kotlin/com/growingio/giokit/plugin/transform/saas/GioCodeVisitor.kt delete mode 100644 giokit-plugin/src/main/kotlin/com/growingio/giokit/plugin/transform/saas/GioConfigVisitor.kt delete mode 100644 giokit-plugin/src/main/kotlin/com/growingio/giokit/plugin/transform/saas/GioDatabaseVisitor.kt delete mode 100644 giokit-plugin/src/main/kotlin/com/growingio/giokit/plugin/transform/saas/GioHttpVisitor.kt delete mode 100644 giokit-plugin/src/main/kotlin/com/growingio/giokit/plugin/transform/saas/GioWebViewVisitor.kt delete mode 100644 giokit-plugin/src/main/kotlin/com/growingio/giokit/plugin/transform/saas/GiokitSaasFactory.kt delete mode 100644 giokit-plugin/src/main/kotlin/com/growingio/giokit/plugin/transform/saas/GiokitSaasTransform.kt delete mode 100644 giokit-plugin/src/main/kotlin/com/growingio/giokit/plugin/transform/v3/GioCodeVisitor.kt delete mode 100644 giokit-plugin/src/main/kotlin/com/growingio/giokit/plugin/transform/v3/GioConfigVisitor.kt delete mode 100644 giokit-plugin/src/main/kotlin/com/growingio/giokit/plugin/transform/v3/GioDatabaseVisitor.kt delete mode 100644 giokit-plugin/src/main/kotlin/com/growingio/giokit/plugin/transform/v3/GioHttpVisitor.kt delete mode 100644 giokit-plugin/src/main/kotlin/com/growingio/giokit/plugin/transform/v3/GioWebViewVisitor.kt delete mode 100644 giokit-plugin/src/main/kotlin/com/growingio/giokit/plugin/transform/v3/GiokitV3Factory.kt delete mode 100644 giokit-plugin/src/main/kotlin/com/growingio/giokit/plugin/transform/v3/GiokitV3Transform.kt delete mode 100644 giokit-plugin/src/main/kotlin/com/growingio/giokit/plugin/utils/FilterUtils.kt delete mode 100644 giokit-plugin/src/main/kotlin/com/growingio/giokit/plugin/utils/GioKitExt.kt delete mode 100644 giokit-plugin/src/main/kotlin/com/growingio/giokit/plugin/utils/GioTransformContext.kt delete mode 100644 giokit/src/main/assets/gio_hybrid.min.js create mode 100644 giokit/src/main/assets/giokit_touch.js delete mode 100644 giokit/src/main/java/com/growingio/giokit/circle/ActionStruct.java delete mode 100644 giokit/src/main/java/com/growingio/giokit/circle/ClassExistHelper.java delete mode 100644 giokit/src/main/java/com/growingio/giokit/circle/ViewNode.java delete mode 100644 giokit/src/main/java/com/growingio/giokit/circle/ViewTraveler.java delete mode 100644 giokit/src/main/java/com/growingio/giokit/utils/CheckSdkStatusSaasImpl.kt delete mode 100644 giokit/src/main/java/com/growingio/giokit/utils/SdkSaasInfoUtils.kt create mode 100644 gradle/libs.versions.toml delete mode 100644 uikit/src/main/AndroidManifest.xml diff --git a/app-saas/.gitignore b/app-saas/.gitignore deleted file mode 100644 index 42afabf..0000000 --- a/app-saas/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/build \ No newline at end of file diff --git a/app-saas/build.gradle b/app-saas/build.gradle deleted file mode 100644 index bff50b0..0000000 --- a/app-saas/build.gradle +++ /dev/null @@ -1,65 +0,0 @@ -plugins { - id 'com.android.application' - id 'kotlin-android' - - id 'com.growingio.android' - id 'com.growingio.giokit.saas' -} - -android { - compileSdk rootProject.ext.android.compileSdkVersion - - defaultConfig { - applicationId "com.growingio.saas" - minSdkVersion 21 - targetSdkVersion 32 - versionCode rootProject.ext.android.versionCode - versionName rootProject.ext.android.versionName - - multiDexEnabled true - testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" - } - - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' - } - } - compileOptions { - sourceCompatibility JavaVersion.VERSION_11 - targetCompatibility JavaVersion.VERSION_11 - } - kotlinOptions { - jvmTarget = '11' - } -} - -giokitExt { - debugMode true - trackFinder { - domain = ["com.growingio.saas"] - } -} - - -dependencies { - implementation rootProject.ext.dependencies["kotlin-stdlib"] - implementation rootProject.ext.dependencies["core-ktx"] - implementation rootProject.ext.dependencies["appcompat"] - implementation rootProject.ext.dependencies["material"] - implementation rootProject.ext.dependencies["constraintLayout"] - - - implementation fileTree(include: ['*.jar'], dir: '../thirdLibs') - implementation 'androidx.multidex:multidex:2.0.1' - implementation rootProject.ext.growingio["autotrack-saas"] - //implementation rootProject.ext.growingio["track-saas-cdp"] - //implementation "com.growingio.giokit:giokit:1.0.0" - implementation project(":giokit") - - testImplementation rootProject.ext.dependencies["junit"] - androidTestImplementation rootProject.ext.dependencies["androidx-junit"] - androidTestImplementation rootProject.ext.dependencies["espresso-core"] - -} \ No newline at end of file diff --git a/app-saas/proguard-rules.pro b/app-saas/proguard-rules.pro deleted file mode 100644 index 481bb43..0000000 --- a/app-saas/proguard-rules.pro +++ /dev/null @@ -1,21 +0,0 @@ -# Add project specific ProGuard rules here. -# You can control the set of applied configuration files using the -# proguardFiles setting in build.gradle. -# -# For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html - -# If your project uses WebView with JS, uncomment the following -# and specify the fully qualified class name to the JavaScript interface -# class: -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { -# public *; -#} - -# Uncomment this to preserve the line number information for -# debugging stack traces. -#-keepattributes SourceFile,LineNumberTable - -# If you keep the line number information, uncomment this to -# hide the original source file name. -#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/app-saas/src/main/AndroidManifest.xml b/app-saas/src/main/AndroidManifest.xml deleted file mode 100644 index c86dfa5..0000000 --- a/app-saas/src/main/AndroidManifest.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app-saas/src/main/java/com/growingio/saas/App.kt b/app-saas/src/main/java/com/growingio/saas/App.kt deleted file mode 100644 index 31229d0..0000000 --- a/app-saas/src/main/java/com/growingio/saas/App.kt +++ /dev/null @@ -1,70 +0,0 @@ -package com.growingio.saas - -import android.app.Application -import android.content.Intent.FLAG_ACTIVITY_SINGLE_TOP -import android.widget.Toast -import com.growingio.android.sdk.collection.Configuration -import com.growingio.android.sdk.collection.CoreInitialize -import com.growingio.android.sdk.collection.GConfig -import com.growingio.android.sdk.collection.GrowingIO -import com.growingio.android.sdk.deeplink.DeeplinkCallback -import com.growingio.android.sdk.utils.LogUtil -import com.growingio.giokit.GioKit - -/** - *

- * - * @author cpacm 2021/9/26 - */ -class App : Application() { - - override fun onCreate() { - super.onCreate() - val startMill = System.currentTimeMillis() - //Debug.startMethodTracing() - initGioSdk() - //Debug.stopMethodTracing() - LogUtil.d("startup", System.currentTimeMillis() - startMill) - GioKit.Builder(this).build() - } - - fun initGioSdk() { - val configuration = Configuration() - .setProjectId("0a1b4118dd954ec3bcc69da5138bdb96") - .setURLScheme("growing.1f85fd632636891b") - .setMutiprocess(true) - .setTestMode(true) - //.setDataSourceId("12345678") - .setDebugMode(true) - .setOAIDEnable(true) - .setUploadExceptionEnable(true) // DeepLink 唤醒测试连接:https://gio.ren/dweyPBZ - // 二维码扫码地址:https://www.growingio.com/projects/QJoOzEPY/sourcemonitor/tracker - .setDeeplinkCallback(object : DeeplinkCallback { - override fun onReceive(params: Map?, error: Int, tmClick: Long) { - if (params != null) { - - Toast.makeText( - applicationContext, - "自定义参数: $params 点击时间 $tmClick", - Toast.LENGTH_SHORT - ).show() - } - } - }) - .setChannel("小木2") - - GrowingIO.startWithConfiguration(this, configuration) - GrowingIO.getInstance().track("TestSession") - } - - fun track() { - GrowingIO.getInstance().track("TestSession") - } - - fun test() { - GrowingIO.getInstance().disableDataCollect() - GConfig.getUrlScheme() - CoreInitialize.config() - GrowingIO.getInstance().track("test") - } -} \ No newline at end of file diff --git a/app-saas/src/main/java/com/growingio/saas/CustomChromeClient.java b/app-saas/src/main/java/com/growingio/saas/CustomChromeClient.java deleted file mode 100644 index 31812c1..0000000 --- a/app-saas/src/main/java/com/growingio/saas/CustomChromeClient.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.growingio.saas; - -import android.util.Log; -import android.webkit.WebChromeClient; -import android.webkit.WebView; - -/** - *

- * - * @author cpacm 2021/10/13 - */ -public class CustomChromeClient extends WebChromeClient { - - @Override - public void onCloseWindow(WebView window) { - Log.d("test", "onCloseWindow"); - } - - @Override - public void onProgressChanged(WebView var1, int var2) { - Log.d("test", "onProgressChanged"); - super.onProgressChanged(var1, var2); - } -} diff --git a/app-saas/src/main/java/com/growingio/saas/MainActivity.kt b/app-saas/src/main/java/com/growingio/saas/MainActivity.kt deleted file mode 100644 index 1014232..0000000 --- a/app-saas/src/main/java/com/growingio/saas/MainActivity.kt +++ /dev/null @@ -1,27 +0,0 @@ -package com.growingio.saas - -import android.content.Intent -import android.os.Bundle -import android.widget.Button -import android.widget.TextView -import androidx.appcompat.app.AppCompatActivity -import com.growingio.android.sdk.collection.GrowingIO - -class MainActivity : AppCompatActivity() { - override fun onCreate(savedInstanceState: Bundle?) { - super.onCreate(savedInstanceState) - setContentView(R.layout.activity_main) - - val tv = findViewById(R.id.track) - tv.setOnClickListener { - //startActivity(Intent(this,SecondActivity::class.java)) - } - - val webBtn = findViewById