-
Notifications
You must be signed in to change notification settings - Fork 404
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
2. 解决应用程序没有权限读取视频而导致失败的问题 3. 优化readme 1. Optimize package volume 2. Solve the problem that the application does not have permission to read video, resulting in failure 3. Optimize Readme
- Loading branch information
1 parent
cce3ebd
commit 847bfb0
Showing
21 changed files
with
442 additions
and
384 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,56 @@ | ||
# android_virtual_cam | ||
xposed安卓虚拟摄像头 | ||
## 感谢https://github.com/wangwei1237/CameraHook 提供的HOOK思路!! | ||
## 求有无极的大佬,希望帮忙测试一下此模块虚拟框架下是否可用,测试后希望在issue中反馈一下,谢谢!!! | ||
|
||
## 具体的使用方法(English version is below): | ||
1、安装xposed框架(传统xposed,edxp,lsposed等均可,不确定虚拟框架能否使用,已经确定VMOS可用,应用转生不可用) | ||
2、安装模块,启用模块,lsposed等包含定义域的框架需要选勾目标app,但无需选勾系统框架。 | ||
3、将需要替换的视频命名为`virtual.mp4`,放在`/sdcard/DCIM/Camera1/`目录下。(前置摄像头需要水平翻转后右旋90°保存,如果打开相机时看见“宽:...高:...”,则需要匹配分辨率) | ||
4、若需要拦截拍照事件,请在`/sdcard/DCIM/Camera1/`目录下放置 `1000.bmp` 用于替换,(前置摄像头需要水平翻转后右旋90°保存,需要匹配分辨率) | ||
> 注意:不是所有应用的拍照都调用`1000.bmp`,有很多app只是从`virtual.mp4`里截屏,只有在拍照时弹出“发现拍照”才是真正的调用`1000.bmp` | ||
5、**授予目标应用读取本地文件的权限,至少是允许读取媒体文件。** | ||
6、强制结束目标应用/重启手机。 | ||
|
||
## 如何获得分辨率??(仅看见“宽:...高:...”需要) | ||
在目标应用中打开摄像头,可在弹出的toast消息里看见。 | ||
|
||
## Camera2接口有问题?? | ||
是的,目前Camera2接口的HOOK不是所有应用程序都能生效,部分app报错打开相机失败,如果想停用Camera2接口的HOOK,可在`/sdcard/DCIM/Camera1/`下创建`disable.jpg`,以停用此项HOOK | ||
|
||
## 我不需要静音?? | ||
在`/sdcard/DCIM/Camera1/`下创建`no-silent.jpg`,就不会静音了。 | ||
|
||
## Detailed usage : | ||
1. Install this moudle. enable it in Xposed. Framework which has a scope list need to choose target app, but needn't to choose system framework. | ||
2. Create `virtual.mp4` and put it under `/sdcard/DCIM/Camera1/` ,(if use front camera ,image should be Flip horizontal and right rotation 90 degrees, if you see "宽:...高:..." when opan camera, the resolution should be matched) | ||
3. If you wants to hook image capture event, you should create `1000.bmp` under `/sdcard/DCIM/Camera1/` for replace. (if use front camera ,image should be Flip horizontal and right rotation 90 degrees, the resolution should be matched) | ||
> ATTENTION: NOT all apps invoke `1000.bmp` when capture image, some apps directly capture a photo from `virtual.mp4`, when you see “发现拍照” when take photos, the app invoke `1000.bmp` . | ||
4. authorize the target app to access local storage in system. | ||
5. Reboot your phone or shutdown target app. | ||
|
||
## bugs with camera2 api, need to disable it? | ||
create `disable.jpg` under `/sdcard/DCIM/Camera1/` to disable this method hook. | ||
## how to get resolution ??(only needed if you see "宽:...高:...")? | ||
open camera in target app, and you can find resolution in toast message. | ||
## Needn't mute? | ||
Create `no-silent.jpg` under `/sdcard/DCIM/Camera1/`, and it will play sounds. | ||
|
||
## release无法下载/gitee下载(gitee与github作者同id,同仓库名)?? | ||
在/app/release/app-release.apk,下载前请注意分支。 | ||
GitHub: https://github.com/w2016561536/android_virtual_cam/blob/master/app/release/app-release.apk | ||
gitee(中国大陆建议此点): https://gitee.com/w2016561536/android_virtual_cam/blob/master/app/release/app-release.apk | ||
|
||
# 请勿用于非法用途,所有后果自负。 | ||
# DO NOT USE FOR ANY ILLEAGLE INTENTION!!YOU NEED TO TAKE ALL RESPONSIBILITY AND CONSEQUENCE!!" | ||
|
||
[简体中文](./README.md) | [繁體中文](./README_tc.md) | [English](./README_en.md) | ||
|
||
基于Xposed的虚拟摄像头 | ||
|
||
# 请勿用于任何非法用途,所有后果自负。 | ||
|
||
## 支持平台: | ||
|
||
- 安卓5.0+ | ||
|
||
## 使用方法 | ||
|
||
1. 安装此模块,并在Xposed中启用此模块,Lsposed等包含作用域的框架需要选择目标app,无需选择系统框架。 | ||
|
||
2. 在系统设置中,授予目标应用读取本地存储的权限,并强制结束目标应用程序。若应用程序未申请此权限,请见步骤3。 | ||
|
||
3. 打开目标应用,若应用未能获得读取存储的权限,则会以气泡消息提示,`Camera1`目录被重定向至应用程序私有目录`/[内部存储]/Android/data/[应用包名]/files/Camera1/`。若未提示,则默认`Camera1`目录为`/[内部存储]/DCIM/Camera1/`。若目录不存在,请手动创建。 | ||
|
||
> 注意:私有目录下的`Camera1`仅对该应用单独生效。 | ||
4. 在目标应用中打开相机预览,会以气泡消息提示“宽:……高:……”,需要根据此分辨率数据制作替换视频,放置于`Camera1`目录下,并命名为`virtual.mp4`,若打开相机并无提示消息,则无需调整视频分辨率。 | ||
|
||
5. 若在目标应用中拍照却显示真实图片,且出现气泡消息`发现拍照`和分辨率,则需根据此分辨率数据准备一张照片,命名为`1000.bmp`,放入`Camera1`目录下(支持其它格式改后缀为bmp)。如果拍照时无气泡消息提示,则`1000.bmp`无效。 | ||
|
||
6. 如果需要播放视频的声音,需在`Camera1`目录下创建`no-silent.jpg`文件。 | ||
|
||
7. 如果需要临时停用视频替换,需在`Camera1`目录下创建`disable.jpg`。 | ||
|
||
|
||
## 常见问题 | ||
|
||
A1. 前置摄像头方向问题? | ||
Q1. 大多数情况下,替换前置摄像头的视频需要水平翻转并右旋90度,并且视频***处理后***的分辨率应与气泡消息内分辨率相同。但有时这并不需要,具体请根据实际情况判断。 | ||
|
||
|
||
Q2. 画面黑屏,相机启动失败? | ||
A2. 目前有些应用并不能成功替换(特别是系统相机),但剩下的大多是由于视频**编码格式**不正确(并非封装格式),目前仅支持`H.264`编码格式。或者时因为视频路径不对。 | ||
|
||
|
||
Q3. 画面花屏? | ||
A3. 视频分辨率不对。 | ||
|
||
## 反馈问题 | ||
|
||
请直接在issues中反馈,如果为BUG反馈,请附带日志信息。 | ||
|
||
|
||
## 致谢: | ||
|
||
提供HOOK思路: https://github.com/wangwei1237/CameraHook | ||
|
||
H264硬解码: https://github.com/zhantong/Android-VideoToImages | ||
|
||
JPEG转YUV: https://blog.csdn.net/jacke121/article/details/73888732 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# android_virtual_cam | ||
|
||
[简体中文](./README.md) | [繁體中文](./README_tc.md) | [English](./README_en.md) | ||
|
||
A virtual camera based on Xposed | ||
|
||
## DO NOT USE FOR ANY ILLEGAL PURPOSE, YOU NEED TO TAKE ALL RESPONSIBILITY AND CONSEQUENCE! | ||
|
||
## Supported platform | ||
|
||
- Android 5.0+ | ||
|
||
## Usage | ||
|
||
1. Install this module , enable it in Xposed . Lsposed and other framework which have a scope list, you need to choose target app instead of System Framework. | ||
|
||
2. In system Setting, authorize target to access local storage, and force stop the app. If the app does not request this permission, see step3. | ||
|
||
3. open target app, if the app does not have the permission to access local storage. There will be a toast message showing that `Camera1` directory has been redirect to app's private directory `/[INTERNEL_STORAGE]/Android/data/[package_name]/files/Camera1/`. If there isn't the message, the default `Camera1` directory is `/[INTERNEL_STORAGE]/DCIM/Camera1/`. If the directory doesn't exist. Please create it by yourself. | ||
|
||
> Attention: `Camera1` in the private directory only works for single app. | ||
4. Open the camera in target app. There will be a toast message showing the resolution (宽width: , 高height:) . And you need to adjust the replacing video's resolution to make them same. Name it as `virtual.mp4`, put it under `Camera1` directory. | ||
|
||
5. If there is a toast message when you take photoes in app ("发现拍照"),it shows the photo's resolution. You need to prepare a photo which has the same resolution. Name it as `1000.bmp` . Put it under `Camera1` directory. (it support other image format renamed to bmp ). If there isn't a toast message , `1000.bmp` will have nothing to do with replacing capture. | ||
|
||
6. If you need to play video's sound, create `no-silent.jpg` under `Camera1` directory. | ||
|
||
7. If you nedd to turn off the module temporarily, create `disable.jpg` under `Camera1` directory. | ||
|
||
## FAQ | ||
|
||
Q1. The problems of front camera? | ||
A1. In most cases , the video for replacing front camera need to be flipped horizontally and rotated right 90 degrees. The video's resolution **after being processed** need to same with that in toast message. But in some came, it dosen't need to make adjustment, so you need to judge it according to situation. | ||
|
||
Q2. Black screen ? Open camera fail ? | ||
A2. Till now ,there are a few apps that can't be hooked, especially the system camera. But most of it caused by wrong encoding format (only support `H.264`). Or it caused by wrong `Camera1` directory. | ||
|
||
Q3. Blurred screen? | ||
A3. The resolution of video is wrong. | ||
|
||
## Question report: | ||
|
||
raise it in issues directly. If it is a bug, please attach with Xposed log. | ||
|
||
## Credit | ||
|
||
Provide hook method: https://github.com/wangwei1237/CameraHook | ||
|
||
H.264 hardware decode: https://github.com/zhantong/Android-VideoToImages | ||
|
||
JPEG-YUV convert: https://blog.csdn.net/jacke121/article/details/73888732 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# android_virtual_cam | ||
|
||
[简体中文](./README.md) | [繁體中文](./README_tc.md) | [English](./README_en.md) | ||
|
||
基於Xposed的虛擬攝影機 | ||
|
||
# 請勿用於任何非法用途,所有後果自負。 | ||
|
||
## 支持平臺: | ||
|
||
- 安卓5.0+ | ||
|
||
## 使用方法 | ||
|
||
1. 安裝此模組,並在Xposed中啟用此模組,Lsposed等包含作用域的框架需要選擇目標app,無需選擇系統框架。 | ||
|
||
2. 在系統設定中,授予目標應用讀取本地存儲的許可權,並強制結束目標應用程序。 若應用程序未申請此許可權,請見步驟3。 | ||
|
||
3. 打開目標應用,若應用未能獲得讀取存儲的許可權,則會以氣泡消息提示,`Camera1`目錄被重定向至應用程序私有目錄`/[內部存儲]/Android/data/[應用包名]/files/Camera1/`。 若未提示,則默認`Camera1`目錄為`/[內部存儲]/DCIM/Camera1/`。 若目錄不存在,請手動創建。 | ||
|
||
> 注意:私有目錄下的`Camera1`僅對該應用單獨生效。 | ||
4. 在目標應用中打開相機預覽,會以氣泡消息提示“寬:……高:……”,需要根據此解析度數據製作替換影片,放置於`Camera1`目錄下,並命名為`virtual.mp4`,若打開相機並無提示消息,則無需調整影片解析度。 | ||
|
||
5. 若在目標應用中拍照卻顯示真實圖片,且出現氣泡消息`發現拍照`和解析度,則需根據此解析度數據準備一張照片,命名為`1000.bmp`,放入`Camera1`目錄下(支持其它格式改尾碼為bmp)。 如果拍照時無氣泡消息提示,則`1000.bmp`無效。 | ||
|
||
6. 如果需要播放影片的聲音,需在`Camera1`目錄下創建`no-silent.jpg`檔案。 | ||
|
||
7. 如果需要臨時停用影片替換,需在`Camera1`目錄下創建`disable.jpg`。 | ||
|
||
## 常見問題 | ||
|
||
A1. 前置攝影機方向問題? | ||
Q1.大多數情况下,替換前置攝影機的影片需要水准翻轉並右旋90度,並且影片***處理後***的解析度應與氣泡消息內解析度相同。 但有時這並不需要,具體請根據實際情況判斷。 | ||
|
||
Q2. 畫面黑屏,相機啟動失敗? | ||
A2. 現時有些應用並不能成功替換(特別是系統相機),但剩下的大多是由於影片**編碼格式**不正確(並非封裝格式),現時僅支持`H.264`編碼格式。 或者時因為影片路徑不對。 | ||
|
||
Q3. 畫面花屏? | ||
A3. 影片解析度不對。 | ||
|
||
## 迴響問題 | ||
|
||
請直接在issues中迴響,如果為BUG迴響,請附帶日誌資訊。 | ||
|
||
|
||
##致謝: | ||
|
||
提供HOOK思路: https://github.com/wangwei1237/CameraHook | ||
|
||
H264硬解碼: https://github.com/zhantong/Android-VideoToImages | ||
|
||
JPEG轉YUV: https://blog.csdn.net/jacke121/article/details/73888732 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.