mirror of
				https://github.com/gtxaspec/wz_mini_hacks.git
				synced 2025-10-31 20:51:59 +00:00 
			
		
		
		
	add night drop feature
This commit is contained in:
		
										
											Binary file not shown.
										
									
								
							| @@ -76,6 +76,7 @@ ENABLE_CIFS="false" | ||||
| DISABLE_FW_UPGRADE="false" | ||||
| AUDIO_PROMPT_VOLUME="50" | ||||
| ENABLE_MP4_WRITE="false" | ||||
| NIGHT_DROP_DISABLE="false" | ||||
|  | ||||
| #####DEBUG##### | ||||
| #drops you to a shell via serial, doesn't load app_init.sh | ||||
|   | ||||
							
								
								
									
										38
									
								
								src/libcallback_wz_mod/night_drop.c
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										38
									
								
								src/libcallback_wz_mod/night_drop.c
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,38 @@ | ||||
| #define _GNU_SOURCE | ||||
| #include <dlfcn.h> | ||||
| #include <stdio.h> | ||||
| #include <unistd.h> | ||||
| #include <stdint.h> | ||||
| #include <fcntl.h> | ||||
|  | ||||
| static uint32_t (*real_local_sdk_video_set_fps)(int encChn); | ||||
|  | ||||
| int local_sdk_video_set_fps(int encChn) { | ||||
|  | ||||
|         const char *nd_enable="/opt/wz_mini/tmp/.nd"; | ||||
|         const char *product_T31="/opt/wz_mini/tmp/.T31"; | ||||
|         const char *product_T20="/opt/wz_mini/tmp/.T20"; | ||||
|  | ||||
|         if( access( nd_enable, F_OK ) != -1 ) { | ||||
|                 printf("[command] [night_drop.c] Night Drop Enabled\n"); | ||||
|         if( encChn == 15 && access( product_T31, F_OK ) != -1 ) { | ||||
|                 printf("[command] [night_drop.c] T31 detected\n"); | ||||
|                 fprintf(stderr, "[command] [night_drop.c] Night Time Requested FPS Drop Value: %d\n", encChn); | ||||
|                 printf("[command] [night_drop.c] Night FPS Drop Stopped\n"); | ||||
|         } else if ( encChn >= 15 && access( product_T20, F_OK ) != -1 ) { | ||||
|                 printf("[command] [night_drop.c] T20 detected\n"); | ||||
|                 fprintf(stderr, "[command] [night_drop.c] Night Time Requested FPS Drop Value: %d\n", encChn); | ||||
|                 printf("[command] [night_drop.c] Night FPS Drop Stopped\n"); | ||||
|         } else { | ||||
|                 fprintf(stderr, "[command] [night_drop.c] Requested FPS Value: %d\n", encChn); | ||||
|                 fprintf(stderr, "[command] [night_drop.c] Calling local_sdk_video_set_fps to: %d\n", encChn); | ||||
|                 real_local_sdk_video_set_fps(encChn); | ||||
|         } | ||||
|  | ||||
|         } | ||||
| } | ||||
|  | ||||
|  | ||||
| static void __attribute ((constructor)) nigh_drop_init(void) { | ||||
|   real_local_sdk_video_set_fps = dlsym(dlopen("/system/lib/liblocalsdk.so", RTLD_LAZY), "local_sdk_video_set_fps"); | ||||
| } | ||||
		Reference in New Issue
	
	Block a user
	 Alfonso Gamboa
					Alfonso Gamboa