赞
踩
这个插件我已经开源出来了,纯源码【只分享核心HOOK代码,仅供学习】,我也是借鉴了别人的一些开源代码所以才搞出来的,主要很方便,可以一键选择本地视频,然后支持浏览视频的功能,支持HOOK的平台也比较多,比如微信QQ抖音快手,在LSP里面选择就可以了,不提供成品,仅分享HOOK思路和代码,供大家学习研究。
下面是我本地测试了一下效果,然后给大家录制出来了:
看看这款QQ微信抖音快手的虚拟视频插件,开源版奥!!!哈哈
声音开关和视频开关代码:
- <project version="4">
-
- <component name="ExternalStorageConfigurationManager" enabled="true" />
-
- <component name="FrameworkDetectionExcludesConfiguration">
-
- <file type="web" url="file://$PROJECT_DIR$" />
-
- </component>
-
- <component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="jbr-17" project-jdk-type="JavaSDK">
-
- <output url="file://$PROJECT_DIR$/build/classes" />
-
- </component>
-
- <component name="ProjectType">
-
- <option name="id" value="Android" />
-
- </component>
-
- </project>
视频播放功能:
- plugins {
-
- id("com.android.application")
-
- id("org.jetbrains.kotlin.android")
-
- }
-
-
-
- android {
-
- namespace = "com.wangyiheng.vcamsx"
-
- compileSdk = 34
-
-
-
- defaultConfig {
-
- applicationId = "com.wangyiheng.vcamsx"
-
- minSdk = 24
-
- //noinspection EditedTargetSdkVersion
-
- targetSdk = 34
-
- versionCode = 1
-
- versionName = "1.0"
-
-
-
- testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
-
- vectorDrawables {
-
- useSupportLibrary = true
-
- }
-
- }
-
-
-
- buildTypes {
-
- release {
-
- isMinifyEnabled = false
-
- proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
-
- }
-
- }
-
- compileOptions {
-
- sourceCompatibility = JavaVersion.VERSION_1_8
-
- targetCompatibility = JavaVersion.VERSION_1_8
-
- }
-
- kotlinOptions {
-
- jvmTarget = "1.8"
-
- }
-
- buildFeatures {
-
- compose = true
-
- }
-
- composeOptions {
-
- kotlinCompilerExtensionVersion = "1.4.3"
-
- }
-
- packaging {
-
- resources {
-
- excludes += "/META-INF/{AL2.0,LGPL2.1}"
-
- }
-
- }
-
- }
-
-
-
- dependencies {
-
-
-
- // Core library for Kotlin extensions and utilities
-
- implementation("androidx.core:core-ktx:1.9.0")
-
-
-
- // Lifecycle components for using ViewModel and LiveData in a Kotlin-friendly way
-
- implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.6.2")
-
-
-
- // Compose support for Activities
-
- implementation("androidx.activity:activity-compose:1.8.0")
-
-
-
- // Bill of Materials (BOM) for all Compose libraries, ensures compatible versions
-
- implementation(platform("androidx.compose:compose-bom:2023.03.00"))
-
-
-
- // Compose UI framework
-
- implementation("androidx.compose.ui:ui")
-
-
-
- // Compose library for graphics
-
- implementation("androidx.compose.ui:ui-graphics")
-
-
-
- // Tooling for UI preview in Compose
-
- implementation("androidx.compose.ui:ui-tooling-preview")
-
-
-
- // Material3 design components for Compose
-
- implementation("androidx.compose.material3:material3")
-
-
-
- // Media3 ExoPlayer for handling media playback
-
- implementation("androidx.media3:media3-exoplayer:1.2.0")
-
- implementation("androidx.media3:media3-ui:1.2.0")
-
-
-
- // JUnit for unit testing
-
- testImplementation("junit:junit:4.13.2")
-
-
-
- // AndroidX Test library for Android-specific JUnit4 helpers
-
- androidTestImplementation("androidx.test.ext:junit:1.1.5")
-
-
-
- // Espresso for UI testing
-
- androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
-
-
-
- // BOM for Compose in android tests
-
- androidTestImplementation(platform("androidx.compose:compose-bom:2023.03.00"))
-
-
-
- // Compose testing library for JUnit4
-
- androidTestImplementation("androidx.compose.ui:ui-test-junit4")
-
-
-
- // Tooling for debugging Compose UIs
-
- debugImplementation("androidx.compose.ui:ui-tooling")
-
-
-
- // Manifest for testing Compose UIs
-
- debugImplementation("androidx.compose.ui:ui-test-manifest")
-
-
-
- // Koin core module for Dependency Injection
-
- implementation ("io.insert-koin:koin-core:3.2.2")
-
-
-
- // Koin module for Android
-
- implementation ("io.insert-koin:koin-android:3.2.2")
-
-
-
- // Koin module for AndroidX Compose
-
- implementation ("io.insert-koin:koin-androidx-compose:3.2.2")
-
-
-
- // Xposed API for advanced customization and hooking into Android apps (compile only)
-
- compileOnly("de.robv.android.xposed:api:82")
-
-
-
-
-
- implementation ("com.crossbowffs.remotepreferences:remotepreferences:0.8")
-
-
-
- implementation ("com.google.code.gson:gson:2.8.8")
-
- }
添加视频功能:
- plugins {
-
- id("com.android.application")
-
- id("org.jetbrains.kotlin.android")
-
- }
-
-
-
- android {
-
- namespace = "com.wangyiheng.vcamsx"
-
- compileSdk = 34
-
-
-
- defaultConfig {
-
- applicationId = "com.wangyiheng.vcamsx"
-
- minSdk = 24
-
- //noinspection EditedTargetSdkVersion
-
- targetSdk = 34
-
- versionCode = 1
-
- versionName = "1.0"
-
-
-
- testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
-
- vectorDrawables {
-
- useSupportLibrary = true
-
- }
-
- }
-
-
-
- buildTypes {
-
- release {
-
- isMinifyEnabled = false
-
- proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
-
- }
-
- }
-
- compileOptions {
-
- sourceCompatibility = JavaVersion.VERSION_1_8
-
- targetCompatibility = JavaVersion.VERSION_1_8
-
- }
-
- kotlinOptions {
-
- jvmTarget = "1.8"
-
- }
-
- buildFeatures {
-
- compose = true
-
- }
-
- composeOptions {
-
- kotlinCompilerExtensionVersion = "1.4.3"
-
- }
-
- packaging {
-
- resources {
-
- excludes += "/META-INF/{AL2.0,LGPL2.1}"
-
- }
-
- }
-
- }
-
-
-
- dependencies {
-
-
-
- // Core library for Kotlin extensions and utilities
-
- implementation("androidx.core:core-ktx:1.9.0")
-
-
-
- // Lifecycle components for using ViewModel and LiveData in a Kotlin-friendly way
-
- implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.6.2")
-
-
-
- // Compose support for Activities
-
- implementation("androidx.activity:activity-compose:1.8.0")
-
-
-
- // Bill of Materials (BOM) for all Compose libraries, ensures compatible versions
-
- implementation(platform("androidx.compose:compose-bom:2023.03.00"))
-
-
-
- // Compose UI framework
-
- implementation("androidx.compose.ui:ui")
-
-
-
- // Compose library for graphics
-
- implementation("androidx.compose.ui:ui-graphics")
-
-
-
- // Tooling for UI preview in Compose
-
- implementation("androidx.compose.ui:ui-tooling-preview")
-
-
-
- // Material3 design components for Compose
-
- implementation("androidx.compose.material3:material3")
-
-
-
- // Media3 ExoPlayer for handling media playback
-
- implementation("androidx.media3:media3-exoplayer:1.2.0")
-
- implementation("androidx.media3:media3-ui:1.2.0")
-
-
-
- // JUnit for unit testing
-
- testImplementation("junit:junit:4.13.2")
-
-
-
- // AndroidX Test library for Android-specific JUnit4 helpers
-
- androidTestImplementation("androidx.test.ext:junit:1.1.5")
-
-
-
- // Espresso for UI testing
-
- androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
-
-
-
- // BOM for Compose in android tests
-
- androidTestImplementation(platform("androidx.compose:compose-bom:2023.03.00"))
-
-
-
- // Compose testing library for JUnit4
-
- androidTestImplementation("androidx.compose.ui:ui-test-junit4")
-
-
-
- // Tooling for debugging Compose UIs
-
- debugImplementation("androidx.compose.ui:ui-tooling")
-
-
-
- // Manifest for testing Compose UIs
-
- debugImplementation("androidx.compose.ui:ui-test-manifest")
-
-
-
- // Koin core module for Dependency Injection
-
- implementation ("io.insert-koin:koin-core:3.2.2")
-
-
-
- // Koin module for Android
-
- implementation ("io.insert-koin:koin-android:3.2.2")
-
-
-
- // Koin module for AndroidX Compose
-
- implementation ("io.insert-koin:koin-androidx-compose:3.2.2")
-
-
-
- // Xposed API for advanced customization and hooking into Android apps (compile only)
-
- compileOnly("de.robv.android.xposed:api:82")
-
-
-
-
-
- implementation ("com.crossbowffs.remotepreferences:remotepreferences:0.8")
-
-
-
- implementation ("com.google.code.gson:gson:2.8.8")
-
- }
HOOk类代码:【仅供学习】
- # Project-wide Gradle settings.
-
- # IDE (e.g. Android Studio) users:
-
- # Gradle settings configured through the IDE *will override*
-
- # any settings specified in this file.
-
- # For more details on how to configure your build environment visit
-
- # http://www.gradle.org/docs/current/userguide/build_environment.html
-
- # Specifies the JVM arguments used for the daemon process.
-
- # The setting is particularly useful for tweaking memory settings.
-
- org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
-
- # When configured, Gradle will run in incubating parallel mode.
-
- # This option should only be used with decoupled projects. More details, visit
-
- # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
-
- # org.gradle.parallel=true
-
- # AndroidX package structure to make it clearer which packages are bundled with the
-
- # Android operating system, and which are packaged with your app's APK
-
- # https://developer.android.com/topic/libraries/support-library/androidx-rn
-
- android.useAndroidX=true
-
- # Kotlin code style for this project: "official" or "obsolete":
-
- kotlin.code.style=official
-
- # Enables namespacing of each library's R class so that its R class includes only the
-
- # resources declared in the library itself and none from the library's dependencies,
-
- # thereby reducing the size of the R class for that library
-
- android.nonTransitiveRClass=true
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。