#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <stdio.h>
#include <errno.h>

#define REAL_PROVIDER "/data/adb/modules/camera-hook/camera-provider-real"
#define HOOK_LIB "/data/adb/modules/camera-hook/libcamera_hook.so"

int main(int argc, char *argv[]) {
    setenv("LD_PRELOAD", HOOK_LIB, 1);
    execv(REAL_PROVIDER, argv);
    fprintf(stderr, "CameraHook: execv(%s) failed: %s\n", REAL_PROVIDER, strerror(errno));
    return 1;
}
