这个是开源的,然后功能就跟标题描述的一样,软件成品我这里不会发布,但是会把dex核心字节集文件分享出来,方便大家学习,软件原理就是通过HOOK技术截取相机视频流,然后实现虚拟视频的效果,然后微信QQ这些都能用的,仅供学习娱乐。
下面是运行的演示效果视频【仅供娱乐学习】
安卓免root虚拟摄像头,看下这个功能!!!
下面是核心dex字节码, 你可以转JAVA自己分析代码:
=======================================================
.class Lcom/example/vcam/HookMain$1;
.super Lde/robv/android/xposed/XC_MethodHook;
.source "HookMain.java"
annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
value = Lcom/example/vcam/HookMain;->handleLoadPackage(Lde/robv/android/xposed/callbacks/XC_LoadPackage$LoadPackageParam;)V
.end annotation
.annotation system Ldalvik/annotation/InnerClass;
accessFlags = 0x0
name = null
.end annotation
instance fields
.field final synthetic this$0:Lcom/example/vcam/HookMain;
.field final synthetic val$lpparam:Lde/robv/android/xposed/callbacks/XC_LoadPackage$LoadPackageParam;
direct methods
.method constructor <init>(Lcom/example/vcam/HookMain;Lde/robv/android/xposed/callbacks/XC_LoadPackage$LoadPackageParam;)V
.registers 3
.line 98
iput-object p1, p0, Lcom/example/vcam/HookMain$1;->this$0:Lcom/example/vcam/HookMain;
iput-object p2, p0, Lcom/example/vcam/HookMain$1;->val$lpparam:Lde/robv/android/xposed/callbacks/XC_LoadPackage$LoadPackageParam;
invoke-direct {p0}, Lde/robv/android/xposed/XC_MethodHook;-><init>()V
return-void
.end method
virtual methods
.method protected beforeHookedMethod(Lde/robv/android/xposed/XC_MethodHook$MethodHookParam;)V
.registers 6
.line 101
new-instance v0, Ljava/io/File;
new-instance v1, Ljava/lang/StringBuilder;
invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
sget-object v2, Lcom/example/vcam/HookMain;->video_path:Ljava/lang/String;
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
const-string v2, "virtual.mp4"
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v1
invoke-direct {v0, v1}, Ljava/io/File;-><init>(Ljava/lang/String;)V
.line 102
invoke-virtual {v0}, Ljava/io/File;->exists()Z
move-result v0
const/4 v1, 0x0
if-eqz v0, :cond_c2
.line 103
new-instance v0, Ljava/io/File;
new-instance v2, Ljava/lang/StringBuilder;
invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V
invoke-static {}, Landroid/os/Environment;->getExternalStorageDirectory()Ljava/io/File;
move-result-object v3
invoke-virtual {v3}, Ljava/io/File;->getPath()Ljava/lang/String;
move-result-object v3
invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
const-string v3, "/DCIM/Camera1/disable.jpg"
invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v2
invoke-direct {v0, v2}, Ljava/io/File;-><init>(Ljava/lang/String;)V
.line 104
invoke-virtual {v0}, Ljava/io/File;->exists()Z
move-result v0
if-eqz v0, :cond_44
return-void
.line 107
:cond_44
sget-boolean v0, Lcom/example/vcam/HookMain;->is_hooked:Z
if-eqz v0, :cond_4b
.line 108
sput-boolean v1, Lcom/example/vcam/HookMain;->is_hooked:Z
return-void
.line 111
:cond_4b
iget-object v0, p1, Lde/robv/android/xposed/XC_MethodHook$MethodHookParam;->args:[Ljava/lang/Object;
aget-object v0, v0, v1
if-nez v0, :cond_52
return-void
.line 114
:cond_52
iget-object v0, p1, Lde/robv/android/xposed/XC_MethodHook$MethodHookParam;->args:[Ljava/lang/Object;
aget-object v0, v0, v1
sget-object v2, Lcom/example/vcam/HookMain;->c1_fake_texture:Landroid/graphics/SurfaceTexture;
invoke-virtual {v0, v2}, Ljava/lang/Object;->equals(Ljava/lang/Object;)Z
move-result v0
if-eqz v0, :cond_5f
return-void
.line 117
:cond_5f
sget-object v0, Lcom/example/vcam/HookMain;->origin_preview_camera:Landroid/hardware/Camera;
if-eqz v0, :cond_8e
sget-object v0, Lcom/example/vcam/HookMain;->origin_preview_camera:Landroid/hardware/Camera;
iget-object v2, p1, Lde/robv/android/xposed/XC_MethodHook$MethodHookParam;->thisObject:Ljava/lang/Object;
invoke-virtual {v0, v2}, Ljava/lang/Object;->equals(Ljava/lang/Object;)Z
move-result v0
if-eqz v0, :cond_8e
.line 118
iget-object p1, p1, Lde/robv/android/xposed/XC_MethodHook$MethodHookParam;->args:[Ljava/lang/Object;
sget-object v0, Lcom/example/vcam/HookMain;->fake_SurfaceTexture:Landroid/graphics/SurfaceTexture;
aput-object v0, p1, v1
.line 119
new-instance p1, Ljava/lang/StringBuilder;
invoke-direct {p1}, Ljava/lang/StringBuilder;-><init>()V
const-string v0, "【VCAM】发现重复"
invoke-virtual {p1, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
sget-object v0, Lcom/example/vcam/HookMain;->origin_preview_camera:Landroid/hardware/Camera;
invoke-virtual {v0}, Ljava/lang/Object;->toString()Ljava/lang/String;
move-result-object v0
invoke-virtual {p1, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {p1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object p1
invoke-static {p1}, Lde/robv/android/xposed/XposedBridge;->log(Ljava/lang/String;)V
return-void
:cond_8e
const-string v0, "【VCAM】创建预览"
.line 122
invoke-static {v0}, Lde/robv/android/xposed/XposedBridge;->log(Ljava/lang/String;)V
.line 125
iget-object v0, p1, Lde/robv/android/xposed/XC_MethodHook$MethodHookParam;->thisObject:Ljava/lang/Object;
check-cast v0, Landroid/hardware/Camera;
sput-object v0, Lcom/example/vcam/HookMain;->origin_preview_camera:Landroid/hardware/Camera;
.line 126
iget-object v0, p1, Lde/robv/android/xposed/XC_MethodHook$MethodHookParam;->args:[Ljava/lang/Object;
aget-object v0, v0, v1
check-cast v0, Landroid/graphics/SurfaceTexture;
sput-object v0, Lcom/example/vcam/HookMain;->mSurfacetexture:Landroid/graphics/SurfaceTexture;
.line 127
sget-object v0, Lcom/example/vcam/HookMain;->fake_SurfaceTexture:Landroid/graphics/SurfaceTexture;
const/16 v2, 0xa
if-nez v0, :cond_af
.line 128
new-instance v0, Landroid/graphics/SurfaceTexture;
invoke-direct {v0, v2}, Landroid/graphics/SurfaceTexture;-><init>(I)V
sput-object v0, Lcom/example/vcam/HookMain;->fake_SurfaceTexture:Landroid/graphics/SurfaceTexture;
goto :goto_bb
.line 130
:cond_af
sget-object v0, Lcom/example/vcam/HookMain;->fake_SurfaceTexture:Landroid/graphics/SurfaceTexture;
invoke-virtual {v0}, Landroid/graphics/SurfaceTexture;->release()V
.line 131
new-instance v0, Landroid/graphics/SurfaceTexture;
invoke-direct {v0, v2}, Landroid/graphics/SurfaceTexture;-><init>(I)V
sput-object v0, Lcom/example/vcam/HookMain;->fake_SurfaceTexture:Landroid/graphics/SurfaceTexture;
.line 133
:goto_bb
iget-object p1, p1, Lde/robv/android/xposed/XC_MethodHook$MethodHookParam;->args:[Ljava/lang/Object;
sget-object v0, Lcom/example/vcam/HookMain;->fake_SurfaceTexture:Landroid/graphics/SurfaceTexture;
aput-object v0, p1, v1
goto :goto_13a
.line 135
:cond_c2
new-instance p1, Ljava/io/File;
new-instance v0, Ljava/lang/StringBuilder;
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
invoke-static {}, Landroid/os/Environment;->getExternalStorageDirectory()Ljava/io/File;
move-result-object v2
invoke-virtual {v2}, Ljava/io/File;->getPath()Ljava/lang/String;
move-result-object v2
invoke-virtual {v0, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
const-string v2, "/DCIM/Camera1/no_toast.jpg"
invoke-virtual {v0, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v0
invoke-direct {p1, v0}, Ljava/io/File;-><init>(Ljava/lang/String;)V
.line 136
iget-object v0, p0, Lcom/example/vcam/HookMain$1;->this$0:Lcom/example/vcam/HookMain;
invoke-virtual {p1}, Ljava/io/File;->exists()Z
move-result p1
xor-int/lit8 p1, p1, 0x1
iput-boolean p1, v0, Lcom/example/vcam/HookMain;->need_to_show_toast:Z
.line 137
iget-object p1, p0, Lcom/example/vcam/HookMain$1;->this$0:Lcom/example/vcam/HookMain;
iget-object p1, p1, Lcom/example/vcam/HookMain;->toast_content:Landroid/content/Context;
if-eqz p1, :cond_13a
iget-object p1, p0, Lcom/example/vcam/HookMain$1;->this$0:Lcom/example/vcam/HookMain;
iget-boolean p1, p1, Lcom/example/vcam/HookMain;->need_to_show_toast:Z
if-eqz p1, :cond_13a
.line 139
:try_start_f6
iget-object p1, p0, Lcom/example/vcam/HookMain$1;->this$0:Lcom/example/vcam/HookMain;
iget-object p1, p1, Lcom/example/vcam/HookMain;->toast_content:Landroid/content/Context;
new-instance v0, Ljava/lang/StringBuilder;
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
const-string v2, "不存在替换视频\n"
invoke-virtual {v0, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
iget-object v2, p0, Lcom/example/vcam/HookMain$1;->val$lpparam:Lde/robv/android/xposed/callbacks/XC_LoadPackage$LoadPackageParam;
iget-object v2, v2, Lde/robv/android/xposed/callbacks/XC_LoadPackage$LoadPackageParam;->packageName:Ljava/lang/String;
invoke-virtual {v0, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
const-string v2, "当前路径:"
invoke-virtual {v0, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
sget-object v2, Lcom/example/vcam/HookMain;->video_path:Ljava/lang/String;
invoke-virtual {v0, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v0
invoke-static {p1, v0, v1}, Landroid/widget/Toast;->makeText(Landroid/content/Context;Ljava/lang/CharSequence;I)Landroid/widget/Toast;
move-result-object p1
invoke-virtual {p1}, Landroid/widget/Toast;->show()V
:try_end_120
.catch Ljava/lang/Exception; {:try_start_f6 .. :try_end_120} :catch_121
goto :goto_13a
:catch_121
move-exception p1
.line 141
new-instance v0, Ljava/lang/StringBuilder;
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
const-string v1, "【hook】[toast]"
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {p1}, Ljava/lang/Exception;->toString()Ljava/lang/String;
move-result-object p1
invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object p1
invoke-static {p1}, Lde/robv/android/xposed/XposedBridge;->log(Ljava/lang/String;)V
:cond_13a
:goto_13a
return-void
.end method
==============================================================
版权归原作者 kaiyuandaima666 所有, 如有侵权,请联系我们删除。