Coder Social home page Coder Social logo

hockulus / apple-privacy-report-converter Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 523 KB

Easy Way to block In-App-Ads with Apple App Privacy Report - Made for PiHole

License: GNU General Public License v3.0

PHP 100.00%
adblock appprivacyreport converter in-app-advertising ndjson pihole-ads-list pihole-blocklists php-tool php-tools self-hosted

apple-privacy-report-converter's Introduction

Apple-Privacy-Report-Converter

Easy Way to block In-App-Ads with Apple Privacy Report - Made for PiHole

form

Export a Privacy Report on your iPhone:

Open the Settings app on your iPhone.
Scroll down and tap on "Privacy & Security".
Scroll down and tap on "App Privacy Report".
Tap on "Share".
Choose a location to save the report (e.g. Files, Notes, etc.).
The report will be saved as a ndjson file.

Convert NDJSON to CSV:

Copy ndjson_to_csv.php on your Webserver
Browse to yourdomain.com/yourfolder/ndjson_to_csv.php
Upload App_Privacy_Report_vX_XXXX-XX-XXXXX_XX_XX.ndjson with the HTML Form shown on the Page
Open the ndjson.csv file and search for the domain/app you want to block on your PiHole

Convert NDJSON to PiHole BlockList:

Copy ndjson_to_pihole_blocklist.php on your Webserver
Browse to yourdomain.com/yourfolder/ndjson_to_pihole_blocklist.php
Upload App_Privacy_Report_vX_XXXX-XX-XXXXX_XX_XX.ndjson with the HTML Form shown on the Page
Open the blocklist.txt file and search for the domain/app you want to block on your PiHole

source result

How it works:

This is a PHP script that converts NDJSON (Newline Delimited JSON) data to CSV (Comma Separated Values) or to pihole blocklist format.
It first checks if an NDJSON file is uploaded via a form and if there are no errors in the upload.
It then reads the NDJSON file line by line, converts each line to a JSON object, and if the object has the necessary keys,
it adds the corresponding values to a multidimensional array.
Finally, it outputs the data in the right format by setting the appropriate headers.
If no file is uploaded or there is an error in the upload, it displays an HTML form again for file upload.

Please keep in mind:

This PHP script is not secure enough to run on public instances due to security vulnerabilities. It is important to ensure that the script has proper input validation and error handling to prevent malicious attacks such as SQL injection or cross-site scripting (XSS). Additionally, it is recommended to use the latest version of PHP and keep the script updated with security patches. Failure to do so could leave your application open to potential security risks and compromise sensitive data.

apple-privacy-report-converter's People

Contributors

hockulus avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.