Skip to content

Commit

Permalink
修复bug
Browse files Browse the repository at this point in the history
  • Loading branch information
w2016561536 committed Aug 26, 2021
1 parent 4645c1e commit 7a82360
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Binary file modified app/release/app-release.apk
Binary file not shown.
6 changes: 3 additions & 3 deletions app/src/main/java/com/example/vcam/HookMain.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;

import de.robv.android.xposed.IXposedHookLoadPackage;
Expand Down Expand Up @@ -157,7 +158,7 @@ protected void afterHookedMethod(MethodHookParam param) throws Throwable {
protected void beforeHookedMethod(MethodHookParam param) {
File file = new File("/sdcard/DCIM/Camera/virtual.mp4");
File control_file = new File("/sdcard/DCIM/disable.jpg");
if (control_file.exists() && (!control_file.exists())) {
if (file.exists() && (!control_file.exists())) {

if (HookMain.c2_builder != null && HookMain.c2_builder.equals(param.thisObject)) {
param.args[0] = HookMain.c2_image_reader.getSurface();
Expand Down Expand Up @@ -222,7 +223,6 @@ protected void beforeHookedMethod(MethodHookParam param) {
return;
}
Camera thiscam = (Camera) param.thisObject;
//XposedBridge.log("创建缓冲区"+String.valueOf(((byte[])param.args[0]).length));
param.args[0] = new byte[thiscam.getParameters().getPreviewSize().width*thiscam.getParameters().getPreviewSize().height*3/2];
}
});
Expand Down Expand Up @@ -306,7 +306,7 @@ protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
if (HookMain.c2_image_reader == null) {
HookMain.c2_image_reader = ImageReader.newInstance(1280, 720, ImageFormat.YUV_420_888, 5);
}
param.args[0] = Arrays.asList(HookMain.c2_image_reader.getSurface());
param.args[0] = Collections.singletonList(HookMain.c2_image_reader.getSurface());
}
});
}
Expand Down

0 comments on commit 7a82360

Please sign in to comment.