{"id":17994650,"url":"https://github.com/noties/enhance","last_synced_at":"2025-09-07T12:34:55.081Z","repository":{"id":66296210,"uuid":"119560280","full_name":"noties/Enhance","owner":"noties","description":"Add API information (since/deprecation) to Android source code as javadoc tags","archived":false,"fork":false,"pushed_at":"2023-11-01T15:41:22.000Z","size":247,"stargazers_count":81,"open_issues_count":1,"forks_count":3,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-21T01:41:32.734Z","etag":null,"topics":["android","android-tools","source-code"],"latest_commit_sha":null,"homepage":"","language":"Java","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/noties.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","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":"2018-01-30T16:08:38.000Z","updated_at":"2024-04-20T13:26:12.000Z","dependencies_parsed_at":"2023-11-01T17:45:09.974Z","dependency_job_id":null,"html_url":"https://github.com/noties/Enhance","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noties%2FEnhance","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noties%2FEnhance/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noties%2FEnhance/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noties%2FEnhance/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/noties","download_url":"https://codeload.github.com/noties/Enhance/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245576528,"owners_count":20638125,"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-tools","source-code"],"created_at":"2024-10-29T20:15:56.752Z","updated_at":"2025-03-26T02:31:03.937Z","avatar_url":"https://github.com/noties.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Enhance!\n\n\u003cimg src=\"art/logo.png\" /\u003e\n\nCommand line utility to process Android source files distributed via SDK manager and add API version information as javadoc tags:\n\n```java\n/**\n * Called by the system when the activity changes from fullscreen mode to multi-window mode and\n * visa-versa.\n *\n * @see android.R.attr#resizeableActivity\n * @param isInMultiWindowMode True if the activity is in multi-window mode.\n * @deprecated Use {@link #onMultiWindowModeChanged(boolean, Configuration)} instead.\n * @since 7.0 Nougat (24)\n * @deprecated 8.0 Oreo (26)\n */\n@Deprecated\npublic void onMultiWindowModeChanged(boolean isInMultiWindowMode) {\n    // Left deliberately empty. There should be no side effects if a direct\n    // subclass of Activity does not call super.\n}\n```\n\nIronically allows to **actually format** processed code with **AOSP** code style specification (and as [google-java-format](https://github.com/google/google-java-format) is used - `GOOGLE` style is also supported).\n\n---\n\nPick the `jar` file from the latest [release](https://github.com/noties/Enhance/releases/latest/).\n\nThere are few configuration options:\n* `sdk`: (required) Android SDK version (for example 25)\n* `format`: Allows to format processed Java source files. Available options are: `aosp` and `google`. Everything else (including empty argument) won't format processed code\n* `sp`: path to Android SDK\n* `diff`: just generate statistics info/diff for specified SDK version\n\n```\nusage: Enhance\n -diff                  Emit diff\n -format \u003carg\u003e          Format sources. Accepts (aosp|google). Everything\n                        else would keep original formatting\n -h,--help              Prints help\n -sdk \u003carg\u003e             Specify which SDK version to process.\n -sp,--sdk-path \u003carg\u003e   Path to Android SDK. If not specified\n                        'ANDROID_HOME' system variable will be used\n```\n\nPlease note that you Android SDK folder must already contain sources for specified `sdk` version.\n\nSo, usage would be like that:\n\n```bash\n# just add api information to source code, no formatting\njava -jar enhance.jar -sdk 26\n\n# also format with AOSP\njava -jar enhance.jar -sdk 26 -format aosp\n\n# or GOOGLE\njava -jar enhance.jar -sdk 26 -format google\n\n# or with custom SDK path\njava -jar enhance.jar -sdk 26 -sp \"/Users/not_me/android/sdk\"\n```\n\nIf you would like to restore unmodified copy of source code you can find it: `{your-home-directory}/.enhance-backup/android-{sdk}`\n\n## Formatting on JDK 17\nFormatting is done with the [google-java-format](https://github.com/google/google-java-format) library\nwhich requires access to the internals of the JDK. This is why on JDK-17 in order to format\nthe sources additional commandline arguments are required:\n\n```bash\njava \\\n  --add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED \\\n  --add-exports=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED \\\n  --add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED \\\n  --add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED \\\n  --add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED \\\n  --add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED \\\n  -jar enhance-34-all.jar -sdk 34 -format google\n```\n\n## Thanks\n\nBig kudos to the maintainers of amazing [javaparser](https://github.com/javaparser/javaparser)!\n\n## License\n\n```\n  Copyright 2018 Dimitry Ivanov (legal@noties.io)\n\n  Licensed under the Apache License, Version 2.0 (the \"License\");\n  you may not use this file except in compliance with the License.\n  You may obtain a copy of the License at\n\n      http://www.apache.org/licenses/LICENSE-2.0\n\n  Unless required by applicable law or agreed to in writing, software\n  distributed under the License is distributed on an \"AS IS\" BASIS,\n  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  See the License for the specific language governing permissions and\n  limitations under the License.\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnoties%2Fenhance","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnoties%2Fenhance","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnoties%2Fenhance/lists"}