View Single Post
Old 02-24-2021, 01:51 AM   #31
geek1011
Wizard
geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.
 
Posts: 2,824
Karma: 7424433
Join Date: May 2016
Location: Ontario, Canada
Device: Kobo Mini, Aura Edition 2 v1, Clara HD, Clara BW, Libra Colour
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();
}
Code:
include NickelHook/NickelHook.mk

override LIBRARY  := libkoboprivacypermissions.so
override SOURCES  += src/koboprivacypermissions.cc 
override CFLAGS   += -Wall -Wextra -Werror
override CXXFLAGS += -Wall -Wextra -Werror -Wno-missing-field-initializers

include NickelHook/NickelHook.mk
Attached Files
File Type: zip KoboPrivacyPermissions.zip (11.8 KB, 117 views)

Last edited by geek1011; 02-24-2021 at 03:34 PM.
geek1011 is offline   Reply With Quote