From fad8f995926a9e0ffd333edae4c231bc7f26faa1 Mon Sep 17 00:00:00 2001 From: Muntashir Al-Islam Date: Fri, 14 Mar 2025 15:25:53 -0700 Subject: [PATCH] Add front-end for ADL Signed-off-by: Muntashir Al-Islam --- .gitignore | 1 + browser/.gitignore | 1 + browser/README.md | 9 +++ browser/book.toml | 13 ++++ browser/custom.css | 34 +++++++++ scripts/browser_generator.php | 135 ++++++++++++++++++++++++++++++++++ 6 files changed, 193 insertions(+) create mode 100644 browser/.gitignore create mode 100644 browser/README.md create mode 100644 browser/book.toml create mode 100644 browser/custom.css create mode 100644 scripts/browser_generator.php diff --git a/.gitignore b/.gitignore index 969ed44..8e8d752 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ .idea/ .DS_Store build/ +browser/src diff --git a/browser/.gitignore b/browser/.gitignore new file mode 100644 index 0000000..7585238 --- /dev/null +++ b/browser/.gitignore @@ -0,0 +1 @@ +book diff --git a/browser/README.md b/browser/README.md new file mode 100644 index 0000000..5b12fe8 --- /dev/null +++ b/browser/README.md @@ -0,0 +1,9 @@ +# Welcome! + +This website acts as a front-end for the [Android Debloat List](https://github.com/MuntashirAkon/android-debloat-list) (ADL) project and is intended to serve as an always available wiki for the pre-installed applications on Android, commonly known as "bloatware". You can utilize the search button or the sidebar to navigate through the bloatware (requires JavaScript), or you can just append `/bloatware/.html` to the homepage URL to navigate to the desired bloatware if available. Each page also has an "Open in App Manager" link that you can follow to view the app info of the selected app (if installed). + +## Alternative Front-ends + +Here's a list of alternative front-ends that make use of the ADL project: + +- [App Manager](https://github.com/MuntashirAkon/AppManager) diff --git a/browser/book.toml b/browser/book.toml new file mode 100644 index 0000000..66b56e8 --- /dev/null +++ b/browser/book.toml @@ -0,0 +1,13 @@ +[book] +authors = ["Muntashir Al-Islam"] +language = "en" +multilingual = false +src = "src" +title = "Android Debloat List" + +[output.html] +preferred-dark-theme = "ayu" +additional-css = ["custom.css"] +smart-punctuation = true +no-section-label = true +site-url = "/android-debloat-list/" diff --git a/browser/custom.css b/browser/custom.css new file mode 100644 index 0000000..bca9daf --- /dev/null +++ b/browser/custom.css @@ -0,0 +1,34 @@ +.tags ul { + list-style-type: none; + padding: 0; + margin: 0; + display: flex; + gap: 10px; +} + +.tags ul > li { + border: 1px solid; + padding: 4px 16px; + border-radius: 16px; + font-size: small; +} + +.tags ul > li[data-tag=delete] { + color: green; +} + +.tags ul > li[data-tag=replace] { + color: purple; +} + +.tags ul > li[data-tag=caution] { + color: orange; +} + +.tags ul > li[data-tag=unsafe] { + color: red; +} + +.refs { + margin-block-start: unset; +} \ No newline at end of file diff --git a/scripts/browser_generator.php b/scripts/browser_generator.php new file mode 100644 index 0000000..059dfc8 --- /dev/null +++ b/scripts/browser_generator.php @@ -0,0 +1,135 @@ + $name) { + $summary .= "- [". $name ."](bloatware/". $id .".md)\n"; +} +file_put_contents(SUMMARY_FILE, $summary); + +# Create sitemap +$SITE_NAME = "https://muntashirakon.github.io/android-debloat-list"; +$urls = ''; +$urls .= <<{$SITE_NAME} +EOF; +foreach ($bloatware_list as $id => $name) { + $urls .= <<$SITE_NAME/bloatware/{$id}.html +EOF; +} +$urls .= ''; +file_put_contents(SITEMAP_FILE, $urls); + +exit(0); + +// Functions // + +function create_bloatware_item(string $type, array $item): string { + $id = $item["id"]; + $name = $item['label'] ?? $id; + $description = str_replace("\n", "\n\n", trim($item["description"])); + $warning = isset($item['warning']) ? << +{$item['warning']} + +EOF : ""; + $removal = $item['removal']; + $removal_name = removal_to_string($item['removal']); + $type_tag = type_to_string($type); + $web = ""; + if (isset($item["web"])) { + $web = "## References { .refs }\n"; + foreach ($item["web"] as $num => $link) { + $n = $num + 1; + $web .= "{$n}. <{$link}>\n"; + } + } + + return << +
    +
  • {$type_tag}
  • +
  • {$removal_name}
  • +
+ + +{$warning} + +{$description} + +{$web} + +Open in App Manager +EOF; +} + + +function type_to_string(string $type): string { + switch ($type) { + case "aosp": return ' AOSP'; + case "carrier": return ' Carrier'; + case "google": return ' Google'; + case "misc": return "Others"; + case "oem": return ' OEM'; + case "pending": return "Pending"; + default: throw new Exception("Invalid type: $type"); + } +} + + +function removal_to_string(string $removal_name): string { + switch ($removal_name) { + case "delete": return "Safe to delete"; + case "replace": return "Replace with alternative"; + case "caution": return "Exercise caution"; + case "unsafe": return "Unsafe"; + default: throw new Exception("Invaid removal: $removal_name"); + } +}