当前位置:   article > 正文

安卓替换原始摄像头模块,免ROOT修改微信QQ抖音快手虚拟视频,仅供学习分享hook思路_虚拟视频替换本地摄像头手机版

虚拟视频替换本地摄像头手机版

这个插件我已经开源出来了,纯源码【只分享核心HOOK代码,仅供学习】,我也是借鉴了别人的一些开源代码所以才搞出来的,主要很方便,可以一键选择本地视频,然后支持浏览视频的功能,支持HOOK的平台也比较多,比如微信QQ抖音快手,在LSP里面选择就可以了,不提供成品,仅分享HOOK思路和代码,供大家学习研究。

下面是我本地测试了一下效果,然后给大家录制出来了:

看看这款QQ微信抖音快手的虚拟视频插件,开源版奥!!!哈哈

声音开关和视频开关代码:

  1. <project version="4">
  2. <component name="ExternalStorageConfigurationManager" enabled="true" />
  3. <component name="FrameworkDetectionExcludesConfiguration">
  4. <file type="web" url="file://$PROJECT_DIR$" />
  5. </component>
  6. <component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="jbr-17" project-jdk-type="JavaSDK">
  7. <output url="file://$PROJECT_DIR$/build/classes" />
  8. </component>
  9. <component name="ProjectType">
  10. <option name="id" value="Android" />
  11. </component>
  12. </project>

视频播放功能:

  1. plugins {
  2. id("com.android.application")
  3. id("org.jetbrains.kotlin.android")
  4. }
  5. android {
  6. namespace = "com.wangyiheng.vcamsx"
  7. compileSdk = 34
  8. defaultConfig {
  9. applicationId = "com.wangyiheng.vcamsx"
  10. minSdk = 24
  11. //noinspection EditedTargetSdkVersion
  12. targetSdk = 34
  13. versionCode = 1
  14. versionName = "1.0"
  15. testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
  16. vectorDrawables {
  17. useSupportLibrary = true
  18. }
  19. }
  20. buildTypes {
  21. release {
  22. isMinifyEnabled = false
  23. proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
  24. }
  25. }
  26. compileOptions {
  27. sourceCompatibility = JavaVersion.VERSION_1_8
  28. targetCompatibility = JavaVersion.VERSION_1_8
  29. }
  30. kotlinOptions {
  31. jvmTarget = "1.8"
  32. }
  33. buildFeatures {
  34. compose = true
  35. }
  36. composeOptions {
  37. kotlinCompilerExtensionVersion = "1.4.3"
  38. }
  39. packaging {
  40. resources {
  41. excludes += "/META-INF/{AL2.0,LGPL2.1}"
  42. }
  43. }
  44. }
  45. dependencies {
  46. // Core library for Kotlin extensions and utilities
  47. implementation("androidx.core:core-ktx:1.9.0")
  48. // Lifecycle components for using ViewModel and LiveData in a Kotlin-friendly way
  49. implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.6.2")
  50. // Compose support for Activities
  51. implementation("androidx.activity:activity-compose:1.8.0")
  52. // Bill of Materials (BOM) for all Compose libraries, ensures compatible versions
  53. implementation(platform("androidx.compose:compose-bom:2023.03.00"))
  54. // Compose UI framework
  55. implementation("androidx.compose.ui:ui")
  56. // Compose library for graphics
  57. implementation("androidx.compose.ui:ui-graphics")
  58. // Tooling for UI preview in Compose
  59. implementation("androidx.compose.ui:ui-tooling-preview")
  60. // Material3 design components for Compose
  61. implementation("androidx.compose.material3:material3")
  62. // Media3 ExoPlayer for handling media playback
  63. implementation("androidx.media3:media3-exoplayer:1.2.0")
  64. implementation("androidx.media3:media3-ui:1.2.0")
  65. // JUnit for unit testing
  66. testImplementation("junit:junit:4.13.2")
  67. // AndroidX Test library for Android-specific JUnit4 helpers
  68. androidTestImplementation("androidx.test.ext:junit:1.1.5")
  69. // Espresso for UI testing
  70. androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
  71. // BOM for Compose in android tests
  72. androidTestImplementation(platform("androidx.compose:compose-bom:2023.03.00"))
  73. // Compose testing library for JUnit4
  74. androidTestImplementation("androidx.compose.ui:ui-test-junit4")
  75. // Tooling for debugging Compose UIs
  76. debugImplementation("androidx.compose.ui:ui-tooling")
  77. // Manifest for testing Compose UIs
  78. debugImplementation("androidx.compose.ui:ui-test-manifest")
  79. // Koin core module for Dependency Injection
  80. implementation ("io.insert-koin:koin-core:3.2.2")
  81. // Koin module for Android
  82. implementation ("io.insert-koin:koin-android:3.2.2")
  83. // Koin module for AndroidX Compose
  84. implementation ("io.insert-koin:koin-androidx-compose:3.2.2")
  85. // Xposed API for advanced customization and hooking into Android apps (compile only)
  86. compileOnly("de.robv.android.xposed:api:82")
  87. implementation ("com.crossbowffs.remotepreferences:remotepreferences:0.8")
  88. implementation ("com.google.code.gson:gson:2.8.8")
  89. }

添加视频功能:

  1. plugins {
  2. id("com.android.application")
  3. id("org.jetbrains.kotlin.android")
  4. }
  5. android {
  6. namespace = "com.wangyiheng.vcamsx"
  7. compileSdk = 34
  8. defaultConfig {
  9. applicationId = "com.wangyiheng.vcamsx"
  10. minSdk = 24
  11. //noinspection EditedTargetSdkVersion
  12. targetSdk = 34
  13. versionCode = 1
  14. versionName = "1.0"
  15. testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
  16. vectorDrawables {
  17. useSupportLibrary = true
  18. }
  19. }
  20. buildTypes {
  21. release {
  22. isMinifyEnabled = false
  23. proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
  24. }
  25. }
  26. compileOptions {
  27. sourceCompatibility = JavaVersion.VERSION_1_8
  28. targetCompatibility = JavaVersion.VERSION_1_8
  29. }
  30. kotlinOptions {
  31. jvmTarget = "1.8"
  32. }
  33. buildFeatures {
  34. compose = true
  35. }
  36. composeOptions {
  37. kotlinCompilerExtensionVersion = "1.4.3"
  38. }
  39. packaging {
  40. resources {
  41. excludes += "/META-INF/{AL2.0,LGPL2.1}"
  42. }
  43. }
  44. }
  45. dependencies {
  46. // Core library for Kotlin extensions and utilities
  47. implementation("androidx.core:core-ktx:1.9.0")
  48. // Lifecycle components for using ViewModel and LiveData in a Kotlin-friendly way
  49. implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.6.2")
  50. // Compose support for Activities
  51. implementation("androidx.activity:activity-compose:1.8.0")
  52. // Bill of Materials (BOM) for all Compose libraries, ensures compatible versions
  53. implementation(platform("androidx.compose:compose-bom:2023.03.00"))
  54. // Compose UI framework
  55. implementation("androidx.compose.ui:ui")
  56. // Compose library for graphics
  57. implementation("androidx.compose.ui:ui-graphics")
  58. // Tooling for UI preview in Compose
  59. implementation("androidx.compose.ui:ui-tooling-preview")
  60. // Material3 design components for Compose
  61. implementation("androidx.compose.material3:material3")
  62. // Media3 ExoPlayer for handling media playback
  63. implementation("androidx.media3:media3-exoplayer:1.2.0")
  64. implementation("androidx.media3:media3-ui:1.2.0")
  65. // JUnit for unit testing
  66. testImplementation("junit:junit:4.13.2")
  67. // AndroidX Test library for Android-specific JUnit4 helpers
  68. androidTestImplementation("androidx.test.ext:junit:1.1.5")
  69. // Espresso for UI testing
  70. androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
  71. // BOM for Compose in android tests
  72. androidTestImplementation(platform("androidx.compose:compose-bom:2023.03.00"))
  73. // Compose testing library for JUnit4
  74. androidTestImplementation("androidx.compose.ui:ui-test-junit4")
  75. // Tooling for debugging Compose UIs
  76. debugImplementation("androidx.compose.ui:ui-tooling")
  77. // Manifest for testing Compose UIs
  78. debugImplementation("androidx.compose.ui:ui-test-manifest")
  79. // Koin core module for Dependency Injection
  80. implementation ("io.insert-koin:koin-core:3.2.2")
  81. // Koin module for Android
  82. implementation ("io.insert-koin:koin-android:3.2.2")
  83. // Koin module for AndroidX Compose
  84. implementation ("io.insert-koin:koin-androidx-compose:3.2.2")
  85. // Xposed API for advanced customization and hooking into Android apps (compile only)
  86. compileOnly("de.robv.android.xposed:api:82")
  87. implementation ("com.crossbowffs.remotepreferences:remotepreferences:0.8")
  88. implementation ("com.google.code.gson:gson:2.8.8")
  89. }

HOOk类代码:【仅供学习】

  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. # Kotlin code style for this project: "official" or "obsolete":
  19. kotlin.code.style=official
  20. # Enables namespacing of each library's R class so that its R class includes only the
  21. # resources declared in the library itself and none from the library's dependencies,
  22. # thereby reducing the size of the R class for that library
  23. android.nonTransitiveRClass=true

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/不正经/article/detail/324612
推荐阅读
相关标签
  

闽ICP备14008679号