View Single Post
Old 02-24-2021, 02:34 PM   #33
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,808
Karma: 7423683
Join Date: May 2016
Location: Ontario, Canada
Device: Kobo Mini, Aura Edition 2 v1, Clara HD
Quote:
Originally Posted by Pam R View Post
Thank you for you trouble, it worked beautifully once then went back to the referring me to kobo privacy.
That was intentional. If you want a permanent one, I've attached it below.

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

QString (*kpp_hook_orig)(void*);

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

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 = false},
    {0},
};

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

NickelHook(
    .init  = nullptr,
    .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
override KOBOROOT += src/use_old_privacy_settings:/mnt/onboard/.kobo/use_old_privacy_settings

include NickelHook/NickelHook.mk
Code:
Delete this file to go back to the default privacy settings.
Attached Files
File Type: zip KoboPrivacyPermissionsPermanent.zip (11.7 KB, 496 views)

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