View Single Post
Old 02-24-2021, 01:40 PM   #32
Pam R
Connoisseur
Pam R began at the beginning.
 
Posts: 55
Karma: 10
Join Date: Dec 2019
Device: Kobo Clara HD
Quote:
Originally Posted by geek1011 View Post
Download the attached zip file and extract it into the hidden .kobo folder on the device. The old privacy settings will be temporarily available after the device reboots.

Spoiler:
Code:
#include <QString>
#include <fcntl.h>
#include <NickelHook.h>

QString (*kpp_hook_orig)(void*);

static struct nh_info KoboPrivacyPermissions = {
    .name           = "KoboPrivacyPermissions",
    .desc           = "Switches back to the old privacy settings for the next boot.",
    .uninstall_flag = "/mnt/onboard/kpp_uninstall",
};

static struct nh_hook KoboPrivacyPermissionsHook[] = {
    {.sym = "_ZN23OneStoreServiceSettings18privacySettingsUrlEv", .sym_new = "_kpp_hook", .lib = "libnickel.so.1.0.0", .out = nh_symoutptr(kpp_hook_orig), .desc = "[OneStoreServices] kobo_privacyCentre_url", .optional = true},
    {0},
};

static struct nh_dlsym KoboPrivacyPermissionsDlsym[] = {
    {0},
};

static int kpp_init() {
    if (!kpp_hook_orig)
        nh_log("failed to hook privacySettingsUrl");
    creat(KoboPrivacyPermissions.uninstall_flag, 0644);
    return 0;
}

NickelHook(
    .init  = kpp_init,
    .info  = &KoboPrivacyPermissions,
    .hook  = KoboPrivacyPermissionsHook,
    .dlsym = KoboPrivacyPermissionsDlsym,
)

extern "C" __attribute__((visibility("default"))) QString _kpp_hook(void*) {
    return QString();
}

Thank you for you trouble, it worked beautifully once then went back to the referring me to kobo privacy.
Pam R is offline   Reply With Quote