{"id":17880783,"url":"https://github.com/2bab/scratchpaper","last_synced_at":"2025-03-22T08:31:13.028Z","repository":{"id":43086174,"uuid":"59648564","full_name":"2BAB/ScratchPaper","owner":"2BAB","description":"A Gradle Plugin for adding variant/version/git-commit-id/etc information to APK launcher icon.","archived":false,"fork":false,"pushed_at":"2023-12-28T07:45:12.000Z","size":1010,"stargazers_count":74,"open_issues_count":0,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-14T22:35:55.437Z","etag":null,"topics":["android","android-gradle-plugin","badge","icon","launcher","variant"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/2BAB.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-05-25T09:10:05.000Z","updated_at":"2025-03-05T16:45:00.000Z","dependencies_parsed_at":"2024-10-28T12:55:40.121Z","dependency_job_id":"b82da8b4-5dc3-4089-bdfe-9624c6218106","html_url":"https://github.com/2BAB/ScratchPaper","commit_stats":null,"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/2BAB%2FScratchPaper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/2BAB%2FScratchPaper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/2BAB%2FScratchPaper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/2BAB%2FScratchPaper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/2BAB","download_url":"https://codeload.github.com/2BAB/ScratchPaper/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244931481,"owners_count":20534008,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","android-gradle-plugin","badge","icon","launcher","variant"],"created_at":"2024-10-28T12:28:36.256Z","updated_at":"2025-03-22T08:31:10.794Z","avatar_url":"https://github.com/2BAB.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg src=\"./sp-banner.png\" alt=\"ScratchPaper\" width=\"771px\"\u003e\n\n[![Maven Central](https://maven-badges.herokuapp.com/maven-central/me.2bab/scratchpaper/badge.svg)](https://search.maven.org/artifact/me.2bab/scratchpaper) \n[![Actions Status](https://github.com/2bab/ScratchPaper/workflows/CI/badge.svg)](https://github.com/2bab/ScratchPaper/actions) \n[![Apache 2](https://img.shields.io/badge/License-Apache%202-brightgreen.svg)](https://www.apache.org/licenses/LICENSE-2.0)\n\n[English][[中文说明]](./README_zh.md)\n\nScratchPaper is a Gradle Plugin helps distinguish the variant/version/git-commit-id by adding a launcher icon overlay, powered by [New Variant/Artifact API](https://developer.android.com/studio/build/extend-agp) \u0026 [Polyfill](https://github.com/2BAB/Polyfill). Accepted by [Google Dev Library](https://devlibrary.withgoogle.com/products/android/repos/2BAB-ScratchPaper).\n\n\n## How does it work?\n\n![](./images/launcher_icons.png)\n\n\u003e If you install both debug\u0026release Apps on one device, you can not distinguish which one you is your target for testing.\n\n\u003e If you have more than one staging Apps for QAs, when they found some issues you may don't know how to match the App version to your code base (branch/commit/etc..), because all of them share the same version like \"2.1.0-SNAPSHOT\".\n\nScratchPaper can add an overlay on your launcher icon, and put given information on it.\n\n- Support regular \u0026 round Icons \n- Support adaptive-icon\n- Support AAPT2\n- Support custom text of multiple lines with some built-in content\n\nIn addition, the plugin can be enabled/disabled for per variant respectively.\n\n\n## Why choose ScratchPaper?\n\nWe can find some similar solutions from Github, but the pain points of them are: most of them do not support latest AAPT2/AGP. ScratchPaper supports latest AAPT2/AGP, adaptive icons, and use new Variant API / Gradle lazy properties to gain a better performance. Apart from that, [usefulness/easylauncher-gradle-plugin](https://github.com/usefulness/easylauncher-gradle-plugin) is one of the most popular solution that is still under maintained, it supports fancy filters and additional pngs to add on badges. If you don't need multiple lines text, that is a great choice as well.\n\n\n## Usage\n\n**0x01. Add the plugin to classpath:**\n\n```gradle\n// Option 1.\n// Add `mavenCentral` to `pluginManagement{}` on `settings.gradle.kts` (or the root `build.gradle.kts`),\n// and scratchpaper plugin id.\npluginManagement {\n\trepositories {\n        ...\n        mavenCentral()\n    }\n    plugins {\n    \t...\n    \tid(\"me.2bab.scratchpaper\") version \"3.3.0\" apply false\n    }\n}\n\n\n// Option 2.\n// Using classic `buildscript{}` block in root build.gradle.kts.\nbuildscript {\n    repositories {\n        ...\n        mavenCentral()\n    }\n    dependencies {\n    \t...\n        classpath(\"me.2bab:scratchpaper:3.3.0\")\n    }\n}\n```\n\n\n**0x02. Apply Plugin:**\n\n``` gradle\n// On Application's build.gradle.kts (do not use in Library project)\nplugin {\n    ...\n    id(\"me.2bab.scratchpaper\")\n}\n```\n\n**0x03. Advanced Configurations**\n\n``` kotlin\nscratchPaper {\n    // Main feature flags. Mandatory field.\n    // Can not be lazily set, it's valid only before \"afterEvaluate{}\".\n    // In this way, only \"FullDebug\" variant will get icon overlays\n    enableByVariant { variant -\u003e\n        variant.name.contains(\"debug\", true)\n                \u0026\u0026 variant.name.contains(\"full\", true)\n    }\n\n    // Mandatory field.\n    // Can be lazily set even after configuration phrase.\n    iconNames.set(\"ic_launcher, ic_launcher_round\")\n\n    // Some sub-feature flags\n    enableXmlIconsRemoval.set(false) // Can be lazily set even after configuration phrase.\n    forceUpdateIcons = true // Can not be lazily set, it's valid only before \"afterEvaluate{}\".\n\n    // ICON_OVERLAY styles, contents.\n    style {\n        textSize.set(9)\n        textColor.set(\"#FFFFFFFF\") // Accepts 3 kinds of format: \"FFF\", \"FFFFFF\", \"FFFFFFFF\".\n        lineSpace.set(4)\n        backgroundColor.set(\"#99000000\") // Same as textColor.\n    }\n\n    content {\n        showVersionName.set(true)\n        showVariantName.set(true)\n        showGitShortId.set(true)\n        showDateTime.set(true)\n        extraInfo.set(\"For QA\")\n    }\n}\n```\n\n**0x04. Build your App and Enjoy!**\n\nCheck screenshots on the top.\n\n\n## Compatible\n\nScratchPaper is only supported \u0026 tested on LATEST ONE Minor versions of Android Gradle Plugin. Since `2.5.4`, the publish repository has been shifted from Jcenter to **Maven Central**.\n\nAGP Version|Latest Support Version\n-----------|-----------------\n8.1.x | [![Maven Central](https://maven-badges.herokuapp.com/maven-central/me.2bab/scratchpaper/badge.svg)](https://search.maven.org/artifact/me.2bab/scratchpaper)\n8.0.x | [![Maven Central](https://maven-badges.herokuapp.com/maven-central/me.2bab/scratchpaper/badge.svg)](https://search.maven.org/artifact/me.2bab/scratchpaper)\n7.2.x | 3.2.1\n7.1.x | 3.2.1\n7.0.x | 3.0.0\n4.2.x | 2.6.0\n4.1.x | 2.5.4\n4.0.x | 2.5.3\n3.6.x | 2.5.1\n3.5.x | 2.4.2\n3.4.x | 2.4.1\n3.3.x | 2.4.1\n3.2.x | 2.4.0\n3.1.x | 2.4.0\n3.0.x (Aapt2) | Support\n2.3.x (Aapt2) | Never Tested\n2.3.x (Aapt1) | Not Support\n\n\n## Git Commit Check\n\nCheck this [link](https://medium.com/walmartlabs/check-out-these-5-git-tips-before-your-next-commit-c1c7a5ae34d1) to make sure everyone will make a **meaningful** commit message.\n\nSo far we haven't added any hook tool, but follow the regex below:\n\n```\n(chore|feat|docs|fix|refactor|style|test|hack|release)(:)( )(.{0,80})\n```\n\n\n## v1.x (Deprecated)\n\nThe v1.x `IconCover` forked from [icon-version@akonior](https://github.com/akonior/icon-version). It provided icon editor functions that compatible with `Aapt1`, and I added some little enhancement like hex color support, custom text support. As time goes by, we have to move to `Aapt2` sooner or later. So I decide to revamp the whole project and add more fancy features. **If you are still using `Aapt1` with `IconCover`, now is the time to consider moving into the new one.**\n\n\n## License\n\n\u003e\n\u003e Copyright Since 2016 2BAB\n\u003e\n\u003eLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\u003e\n\u003e   http://www.apache.org/licenses/LICENSE-2.0\n\u003e\n\u003e Unless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F2bab%2Fscratchpaper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F2bab%2Fscratchpaper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F2bab%2Fscratchpaper/lists"}