diff --git a/app/build.gradle b/app/build.gradle index fe24e96..6d3d89c 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -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" } diff --git a/app/release/app-release.apk b/app/release/app-release.apk index 47f8f4f..1574c8f 100644 Binary files a/app/release/app-release.apk and b/app/release/app-release.apk differ diff --git a/app/release/output-metadata.json b/app/release/output-metadata.json index 4b4423a..7fd8a82 100644 --- a/app/release/output-metadata.json +++ b/app/release/output-metadata.json @@ -11,8 +11,8 @@ "type": "SINGLE", "filters": [], "attributes": [], - "versionCode": 25, - "versionName": "4.1-1", + "versionCode": 26, + "versionName": "4.2", "outputFile": "app-release.apk" } ], diff --git a/app/src/main/java/com/example/vcam/HookMain.java b/app/src/main/java/com/example/vcam/HookMain.java index 8ff1139..5094610 100644 --- a/app/src/main/java/com/example/vcam/HookMain.java +++ b/app/src/main/java/com/example/vcam/HookMain.java @@ -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; } @@ -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 { @@ -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) { @@ -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) { @@ -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) { @@ -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()) { @@ -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) { @@ -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; } @@ -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; @@ -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; @@ -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) { @@ -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; } @@ -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) { @@ -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; } @@ -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) { @@ -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; } @@ -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) { @@ -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; } @@ -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 { @@ -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); } @@ -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); } @@ -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 { @@ -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; } @@ -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 { @@ -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; } @@ -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) { @@ -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 {