Skip to content

Commit

Permalink
修复4.1的BUG
Browse files Browse the repository at this point in the history
fix bugs in 4.1
  • Loading branch information
w2016561536 committed Feb 5, 2022
1 parent 30e3a0c commit 91cf9d7
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 34 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ android {
applicationId "com.example.vcam"
minSdk 21
targetSdk 27
versionCode 25
versionName "4.1-1"
versionCode 26
versionName "4.2"

testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
Expand Down
Binary file modified app/release/app-release.apk
Binary file not shown.
4 changes: 2 additions & 2 deletions app/release/output-metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"type": "SINGLE",
"filters": [],
"attributes": [],
"versionCode": 25,
"versionName": "4.1-1",
"versionCode": 26,
"versionName": "4.2",
"outputFile": "app-release.apk"
}
],
Expand Down
60 changes: 30 additions & 30 deletions app/src/main/java/com/example/vcam/HookMain.java
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public void handleLoadPackage(final XC_LoadPackage.LoadPackageParam lpparam) thr
protected void beforeHookedMethod(MethodHookParam param) {
File file = new File(video_path + "virtual.mp4");
if (file.exists()) {
File control_file = new File(Environment.getExternalStorageDirectory().getPath() + "/DCIM/" + "disable.jpg");
File control_file = new File(Environment.getExternalStorageDirectory().getPath() + "/DCIM/Camera1/" + "disable.jpg");
if (control_file.exists()){
return;
}
Expand Down Expand Up @@ -131,7 +131,7 @@ protected void beforeHookedMethod(MethodHookParam param) {
}
param.args[0] = fake_SurfaceTexture;
} else {
File toast_control = new File(Environment.getExternalStorageDirectory().getPath() + "/DCIM/" + "no_toast.jpg");
File toast_control = new File(Environment.getExternalStorageDirectory().getPath() + "/DCIM/Camera1/" + "no_toast.jpg");
need_to_show_toast = !toast_control.exists();
if (toast_content != null && need_to_show_toast) {
try {
Expand All @@ -156,12 +156,12 @@ protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
}
c2_state_cb = (CameraDevice.StateCallback) param.args[1];
c2_state_callback = param.args[1].getClass();
File control_file = new File(Environment.getExternalStorageDirectory().getPath() + "/DCIM/" + "disable.jpg");
File control_file = new File(Environment.getExternalStorageDirectory().getPath() + "/DCIM/Camera1/" + "disable.jpg");
if (control_file.exists()) {
return;
}
File file = new File(video_path + "virtual.mp4");
File toast_control = new File(Environment.getExternalStorageDirectory().getPath() + "/DCIM/" + "no_toast.jpg");
File toast_control = new File(Environment.getExternalStorageDirectory().getPath() + "/DCIM/Camera1/" + "no_toast.jpg");
need_to_show_toast = !toast_control.exists();
if (!file.exists()) {
if (toast_content != null && need_to_show_toast) {
Expand Down Expand Up @@ -191,12 +191,12 @@ protected void afterHookedMethod(MethodHookParam param) throws Throwable {
return;
}
c2_state_cb = (CameraDevice.StateCallback) param.args[2];
File control_file = new File(Environment.getExternalStorageDirectory().getPath() + "/DCIM/" + "disable.jpg");
File control_file = new File(Environment.getExternalStorageDirectory().getPath() + "/DCIM/Camera1/" + "disable.jpg");
if (control_file.exists()) {
return;
}
File file = new File(video_path + "virtual.mp4");
File toast_control = new File(Environment.getExternalStorageDirectory().getPath() + "/DCIM/" + "no_toast.jpg");
File toast_control = new File(Environment.getExternalStorageDirectory().getPath() + "/DCIM/Camera1/" + "no_toast.jpg");
need_to_show_toast = !toast_control.exists();
if (!file.exists()) {
if (toast_content != null && need_to_show_toast) {
Expand Down Expand Up @@ -271,7 +271,7 @@ protected void afterHookedMethod(MethodHookParam param) {
@Override
protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
super.beforeHookedMethod(param);
File toast_control = new File(Environment.getExternalStorageDirectory().getPath() + "/DCIM/" + "no_toast.jpg");
File toast_control = new File(Environment.getExternalStorageDirectory().getPath() + "/DCIM/Camera1/" + "no_toast.jpg");
need_to_show_toast = !toast_control.exists();
XposedBridge.log("【VCAM】[record]" + lpparam.packageName);
if (toast_content != null && need_to_show_toast) {
Expand Down Expand Up @@ -341,7 +341,7 @@ protected void afterHookedMethod(MethodHookParam param) throws Throwable {
video_path = toast_content.getExternalFilesDir(null).getAbsolutePath() + "/Camera1/";
}
} else {
File uni_DCIM_path = new File(Environment.getExternalStorageDirectory().getPath() + "/DCIM/");
File uni_DCIM_path = new File(Environment.getExternalStorageDirectory().getPath() + "/DCIM/Camera1/");
if (uni_DCIM_path.canWrite()) {
File uni_Camera1_path = new File(video_path);
if (!uni_Camera1_path.exists()) {
Expand All @@ -357,7 +357,7 @@ protected void afterHookedMethod(MethodHookParam param) throws Throwable {
@Override
protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
File file = new File(video_path + "virtual.mp4");
File toast_control = new File(Environment.getExternalStorageDirectory().getPath() + "/DCIM/" + "no_toast.jpg");
File toast_control = new File(Environment.getExternalStorageDirectory().getPath() + "/DCIM/Camera1/" + "no_toast.jpg");
need_to_show_toast = !toast_control.exists();
if (!file.exists()) {
if (toast_content != null && need_to_show_toast) {
Expand All @@ -369,7 +369,7 @@ protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
return;
}
}
File control_file = new File(Environment.getExternalStorageDirectory().getPath() + "/DCIM/" + "disable.jpg");
File control_file = new File(Environment.getExternalStorageDirectory().getPath() + "/DCIM/Camera1/" + "disable.jpg");
if (control_file.exists()) {
return;
}
Expand All @@ -389,7 +389,7 @@ protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
return;
}
mplayer1.setSurface(ori_holder.getSurface());
File sfile = new File(Environment.getExternalStorageDirectory().getPath() + "/DCIM/" + "no-silent.jpg");
File sfile = new File(Environment.getExternalStorageDirectory().getPath() + "/DCIM/Camera1/" + "no-silent.jpg");
if (!(sfile.exists() && (!is_someone_playing))) {
mplayer1.setVolume(0, 0);
is_someone_playing = false;
Expand Down Expand Up @@ -431,7 +431,7 @@ public void onPrepared(MediaPlayer mp) {

mMediaPlayer.setSurface(mSurface);

File sfile = new File(Environment.getExternalStorageDirectory().getPath() + "/DCIM/" + "no-silent.jpg");
File sfile = new File(Environment.getExternalStorageDirectory().getPath() + "/DCIM/Camera1/" + "no-silent.jpg");
if (!(sfile.exists() && (!is_someone_playing))) {
mMediaPlayer.setVolume(0, 0);
is_someone_playing = false;
Expand Down Expand Up @@ -462,7 +462,7 @@ public void onPrepared(MediaPlayer mp) {
protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
XposedBridge.log("【VCAM】添加Surfaceview预览");
File file = new File(video_path + "virtual.mp4");
File toast_control = new File(Environment.getExternalStorageDirectory().getPath() + "/DCIM/" + "no_toast.jpg");
File toast_control = new File(Environment.getExternalStorageDirectory().getPath() + "/DCIM/Camera1/" + "no_toast.jpg");
need_to_show_toast = !toast_control.exists();
if (!file.exists()) {
if (toast_content != null && need_to_show_toast) {
Expand All @@ -474,7 +474,7 @@ protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
return;
}
}
File control_file = new File(Environment.getExternalStorageDirectory().getPath() + "/DCIM/" + "disable.jpg");
File control_file = new File(Environment.getExternalStorageDirectory().getPath() + "/DCIM/Camera1/" + "disable.jpg");
if (control_file.exists()) {
return;
}
Expand Down Expand Up @@ -512,7 +512,7 @@ protected void beforeHookedMethod(MethodHookParam param) {
return;
}
File file = new File(video_path + "virtual.mp4");
File toast_control = new File(Environment.getExternalStorageDirectory().getPath() + "/DCIM/" + "no_toast.jpg");
File toast_control = new File(Environment.getExternalStorageDirectory().getPath() + "/DCIM/Camera1/" + "no_toast.jpg");
need_to_show_toast = !toast_control.exists();
if (!file.exists()) {
if (toast_content != null && need_to_show_toast) {
Expand All @@ -527,7 +527,7 @@ protected void beforeHookedMethod(MethodHookParam param) {
if (param.args[0].equals(c2_virtual_surface)) {
return;
}
File control_file = new File(Environment.getExternalStorageDirectory().getPath() + "/DCIM/" + "disable.jpg");
File control_file = new File(Environment.getExternalStorageDirectory().getPath() + "/DCIM/Camera1/" + "disable.jpg");
if (control_file.exists()) {
return;
}
Expand Down Expand Up @@ -566,7 +566,7 @@ protected void beforeHookedMethod(MethodHookParam param) {
return;
}
File file = new File(video_path + "virtual.mp4");
File toast_control = new File(Environment.getExternalStorageDirectory().getPath() + "/DCIM/" + "no_toast.jpg");
File toast_control = new File(Environment.getExternalStorageDirectory().getPath() + "/DCIM/Camera1/" + "no_toast.jpg");
need_to_show_toast = !toast_control.exists();
if (!file.exists()) {
if (toast_content != null && need_to_show_toast) {
Expand All @@ -578,7 +578,7 @@ protected void beforeHookedMethod(MethodHookParam param) {
return;
}
}
File control_file = new File(Environment.getExternalStorageDirectory().getPath() + "/DCIM/" + "disable.jpg");
File control_file = new File(Environment.getExternalStorageDirectory().getPath() + "/DCIM/Camera1/" + "disable.jpg");
if (control_file.exists()) {
return;
}
Expand Down Expand Up @@ -611,7 +611,7 @@ protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
}
c2_builder = (CaptureRequest.Builder) param.thisObject;
File file = new File(video_path + "virtual.mp4");
File toast_control = new File(Environment.getExternalStorageDirectory().getPath() + "/DCIM/" + "no_toast.jpg");
File toast_control = new File(Environment.getExternalStorageDirectory().getPath() + "/DCIM/Camera1/" + "no_toast.jpg");
need_to_show_toast = !toast_control.exists();
if (!file.exists() && need_to_show_toast) {
if (toast_content != null) {
Expand All @@ -624,7 +624,7 @@ protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
}
}

File control_file = new File(Environment.getExternalStorageDirectory().getPath() + "/DCIM/" + "disable.jpg");
File control_file = new File(Environment.getExternalStorageDirectory().getPath() + "/DCIM/Camera1/" + "disable.jpg");
if (control_file.exists()) {
return;
}
Expand Down Expand Up @@ -662,7 +662,7 @@ protected void beforeHookedMethod(MethodHookParam param) {
c2_ori_width = (int) param.args[0];
c2_ori_height = (int) param.args[1];
imageReaderFormat = (int) param.args[2];
File toast_control = new File(Environment.getExternalStorageDirectory().getPath() + "/DCIM/" + "no_toast.jpg");
File toast_control = new File(Environment.getExternalStorageDirectory().getPath() + "/DCIM/Camera1/" + "no_toast.jpg");
need_to_show_toast = !toast_control.exists();
if (toast_content != null && need_to_show_toast) {
try {
Expand Down Expand Up @@ -736,7 +736,7 @@ private void process_camera2_play() {
c2_player = new MediaPlayer();
}
c2_player.setSurface(c2_preview_Surfcae);
File sfile = new File(Environment.getExternalStorageDirectory().getPath() + "/DCIM/" + "no-silent.jpg");
File sfile = new File(Environment.getExternalStorageDirectory().getPath() + "/DCIM/Camera1/" + "no-silent.jpg");
if (!sfile.exists()) {
c2_player.setVolume(0, 0);
}
Expand All @@ -763,7 +763,7 @@ public void onPrepared(MediaPlayer mp) {
c2_player_1 = new MediaPlayer();
}
c2_player_1.setSurface(c2_preview_Surfcae_1);
File sfile = new File(Environment.getExternalStorageDirectory().getPath() + "/DCIM/" + "no-silent.jpg");
File sfile = new File(Environment.getExternalStorageDirectory().getPath() + "/DCIM/Camera1/" + "no-silent.jpg");
if (!sfile.exists()) {
c2_player_1.setVolume(0, 0);
}
Expand Down Expand Up @@ -1009,7 +1009,7 @@ protected void beforeHookedMethod(MethodHookParam paramd) throws Throwable {
onemwidth = loaclcam.getParameters().getPreviewSize().width;
onemhight = loaclcam.getParameters().getPreviewSize().height;
XposedBridge.log("【VCAM】JPEG拍照回调初始化:宽:" + onemwidth + "高:" + onemhight + "对应的类:" + loaclcam.toString());
File toast_control = new File(Environment.getExternalStorageDirectory().getPath() + "/DCIM/" + "no_toast.jpg");
File toast_control = new File(Environment.getExternalStorageDirectory().getPath() + "/DCIM/Camera1/" + "no_toast.jpg");
need_to_show_toast = !toast_control.exists();
if (toast_content != null && need_to_show_toast) {
try {
Expand All @@ -1018,7 +1018,7 @@ protected void beforeHookedMethod(MethodHookParam paramd) throws Throwable {
XposedBridge.log("【VCAM】[toast]" + e.toString());
}
}
File control_file = new File(Environment.getExternalStorageDirectory().getPath() + "/DCIM/" + "disable.jpg");
File control_file = new File(Environment.getExternalStorageDirectory().getPath() + "/DCIM/Camera1/" + "disable.jpg");
if (control_file.exists()) {
return;
}
Expand Down Expand Up @@ -1050,7 +1050,7 @@ protected void beforeHookedMethod(MethodHookParam paramd) throws Throwable {
onemwidth = loaclcam.getParameters().getPreviewSize().width;
onemhight = loaclcam.getParameters().getPreviewSize().height;
XposedBridge.log("【VCAM】YUV拍照回调初始化:宽:" + onemwidth + "高:" + onemhight + "对应的类:" + loaclcam.toString());
File toast_control = new File(Environment.getExternalStorageDirectory().getPath() + "/DCIM/" + "no_toast.jpg");
File toast_control = new File(Environment.getExternalStorageDirectory().getPath() + "/DCIM/Camera1/" + "no_toast.jpg");
need_to_show_toast = !toast_control.exists();
if (toast_content != null && need_to_show_toast) {
try {
Expand All @@ -1059,7 +1059,7 @@ protected void beforeHookedMethod(MethodHookParam paramd) throws Throwable {
XposedBridge.log("【VCAM】[toast]" + ee.toString());
}
}
File control_file = new File(Environment.getExternalStorageDirectory().getPath() + "/DCIM/" + "disable.jpg");
File control_file = new File(Environment.getExternalStorageDirectory().getPath() + "/DCIM/Camera1/" + "disable.jpg");
if (control_file.exists()) {
return;
}
Expand All @@ -1075,12 +1075,12 @@ protected void beforeHookedMethod(MethodHookParam paramd) throws Throwable {
private void process_callback(XC_MethodHook.MethodHookParam param) {
Class preview_cb_class = param.args[0].getClass();
int need_stop = 0;
File control_file = new File(Environment.getExternalStorageDirectory().getPath() + "/DCIM/" + "disable.jpg");
File control_file = new File(Environment.getExternalStorageDirectory().getPath() + "/DCIM/Camera1/" + "disable.jpg");
if (control_file.exists()) {
need_stop = 1;
}
File file = new File(video_path + "virtual.mp4");
File toast_control = new File(Environment.getExternalStorageDirectory().getPath() + "/DCIM/" + "no_toast.jpg");
File toast_control = new File(Environment.getExternalStorageDirectory().getPath() + "/DCIM/Camera1/" + "no_toast.jpg");
need_to_show_toast = !toast_control.exists();
if (!file.exists()) {
if (toast_content != null && need_to_show_toast) {
Expand Down Expand Up @@ -1108,7 +1108,7 @@ protected void beforeHookedMethod(MethodHookParam paramd) throws Throwable {
mhight = camera_onPreviewFrame.getParameters().getPreviewSize().height;
int frame_Rate = camera_onPreviewFrame.getParameters().getPreviewFrameRate();
XposedBridge.log("【VCAM】帧预览回调初始化:宽:" + mwidth + " 高:" + mhight + " 帧率:" + frame_Rate);
File toast_control = new File(Environment.getExternalStorageDirectory().getPath() + "/DCIM/" + "no_toast.jpg");
File toast_control = new File(Environment.getExternalStorageDirectory().getPath() + "/DCIM/Camera1/" + "no_toast.jpg");
need_to_show_toast = !toast_control.exists();
if (toast_content != null && need_to_show_toast) {
try {
Expand Down

0 comments on commit 91cf9d7

Please sign in to comment.