{"id":15029735,"url":"https://github.com/eleme/amigo","last_synced_at":"2025-10-24T12:55:53.501Z","repository":{"id":145526781,"uuid":"66541104","full_name":"eleme/Amigo","owner":"eleme","description":"A hotfix library for Android platform, and not just this...","archived":false,"fork":false,"pushed_at":"2020-03-21T17:19:30.000Z","size":743,"stargazers_count":1363,"open_issues_count":11,"forks_count":213,"subscribers_count":65,"default_branch":"master","last_synced_at":"2025-05-16T07:07:16.249Z","etag":null,"topics":["android","hotfix"],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eleme.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}},"created_at":"2016-08-25T08:43:36.000Z","updated_at":"2025-04-12T04:27:10.000Z","dependencies_parsed_at":"2023-10-20T20:51:02.633Z","dependency_job_id":null,"html_url":"https://github.com/eleme/Amigo","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eleme%2FAmigo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eleme%2FAmigo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eleme%2FAmigo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eleme%2FAmigo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eleme","download_url":"https://codeload.github.com/eleme/Amigo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254485065,"owners_count":22078767,"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","hotfix"],"created_at":"2024-09-24T20:11:31.269Z","updated_at":"2025-10-24T12:55:53.412Z","avatar_url":"https://github.com/eleme.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n[中文版](https://github.com/eleme/Amigo/blob/master/README_zh.md#amigo)\n\n[wiki](https://github.com/eleme/Amigo/wiki) (deprecated)\n\n[changelog](https://github.com/eleme/Amigo/blob/master/CHANGELOG.md)\n\n~~Amigo Service Platform~~ (Amigo backend service is **no longer supported**)\n\n![amigo.png](http://amigotheband.com/wp-content/uploads/2015/02/logo_amigo-yellow.png)  \n\nAmigo is a hotfix library which can fix everything for your Android app\n\n## How to use\n### Download\nIn your project's `build.gradle`\n\n```groovy\nbuildscript {\n    repositories {\n        jcenter()\n    }\n\n    dependencies {\n        classpath 'me.ele:amigo:0.6.8'\n    }\n}\n```\n\nIn your module's `build.gradle`\n\n```groovy\napply plugin: 'me.ele.amigo'\n\nandroid {\n...\n}\n\ndependencies {\n    ...\n    compile 'me.ele:amigo-lib:0.6.7'\n}\n\n//if you don't want use amigo in dev, set this value to true\n//you can define this extension in your mybuild.gradle as to distinguish debug \u0026 release build\namigo {\n    disable false //default false\n    autoDisableInInstantRunMode true // default false\n}\n\n```\n\n\n### Compatibility\n\n- Supports All Devices From ECLAIR `2.1` to Nougat `7.1`\n- Even support next Android version, no matter small or big change. So Cool, Aha :v:\n- Android 3.0 isn't supported\n\n### Customize loading page(optional)\nSome time-consuming tasks are handled in a separate process to avoid ANR, you can customize the loading activity by add the follow code into your AndroidManifest.xml:\n\n```xml\n\u003cmeta-data\n    android:name=\"amigo_layout\"\n    android:value=\"{your-layout-name}\" /\u003e\n\n\u003cmeta-data\n    android:name=\"amigo_theme\"\n    android:value=\"{your-theme-name}\" /\u003e\n\n\u003cmeta-data\n    android:name=\"amigo_orientation\"\n    android:value=\"{your-custom-orientation}\"/\u003e\n```\n\n**Note**:\n\n- These three `meta-data` is defined in your personal `AndroidManifest.xml` of app module if necessary\n- orientation's value must be in [screenOrientation](https://developer.android.com/guide/topics/manifest/activity-element.html#screen)\n\n### Make hotfix work\nThere are two ways to make hotfix work.\n\n* if you don't need hotfix work immediately\n\n  you just need to download new apk file, hotfix apk will be loaded as fresh as new when app restarts next time\n\n\t```java\n    Amigo.workLater(context, patchApkFile, callback);\n    ```\n\n* work immediately, App will restart immediately\n\n\t```java\n\tAmigo.work(context, patchApkFile);\n\t```\n\n### Remove patch\n\n```java\nAmigo.clear(context);\n```\n\n**note**：All patch files would be deleted on the next start up.\n\n## Demo\nAnd there is an Demo page in the app demonstrating how to apply patch apk.\nRun the task `./gradlew runHost preparePatch`, and navigate to the `demo` page.\n\n## Development\n\n### Amigo gradle plugin\nThe plugin was put into buildSrc directory, which means the plugin code change will work immediately each time you build.\n\n### Amigo lib\nThe amigo plugin will select the right amigo lib automatically.\n\n### Run tests\nThere are two gradle tasks provided in the app/build.gradle, `:app:runHost`, `:app:preparePatch`, which can accelerate development.\n\n* `./gradlew runHost`, launch the host app\n* `./gradlew preparePatch`, build and push the patch apk to the device\n* apply the patch apk in the Demo page\n\n## Limits\n - have to change the way using a content provider\n    * declare a new provider: the authorities string must start with \"**${youPackageName}.provider**\"\n\n        ```xml\n        \u003cprovider\n            android:name=\"me.ele.demo.provider.StudentProvider\"\n            android:authorities=\"${youPackageName}.provider.student\" /\u003e\n        ```\n\n    * change the uri used to do the query, insert, delete operations:\n\n        ```java\n        // 1. inside your app process, no modifications need:\n        Cursor cursor = getContentResolver().query(Uri.parse(\"content://\" + getPackageName() + \".provider.student?id=0\"), null, null, null, null);\n        // 2. in another process, have to change the authorities uri like the following :\n        Cursor cursor = getContentResolver().query(Uri.parse(\"content://\" + targetPackageName + \".provider/student?id=0\"), null, null, null, null);\n        ```\n\n -  Instant Run conflicts with Amigo, so disable Instant Run when used with amigo(Or use `autoDisableInInstantRunMode` to auto disable amigo in instant run mode)\n\n -  Amigo doesn't support Honeycomb `3.0`\n    * Android 3.0 is a version with full of bugs, \u0026 Google has closed Android 3.0 Honeycomb.\n\n - `RemoteViews`'s layout change in `notification` \u0026 `widget`is not support   \n    * any resource id in here should be used with ```java RCompat.getHostIdentifier(Context context, int id) ```\n\n## Retrieve hotfix file\n\n- make it simple, you just need a fully new apk\n\n- to save the internet traffic, you may just want to download a diff file\n  [bspatch](https://github.com/eleme/bspatch) (`support whole apk diff \u0026 fine-grained diff in apk`)is an option for you\n\n\n## Inspired by\n\n[Android Patch 方案与持续交付](http://dev.qq.com/topic/57a31921ac3a1fb613dd40f3)\n\n[DroidPlugin](https://github.com/DroidPluginTeam/DroidPlugin)\n\n\n## License\n\n\n\t  Copyright 2016 ELEME Inc.\n\n\t  Licensed under the Apache License, Version 2.0 (the \"License\");\n\t  you may not use this file except in compliance with the License.\n\t  You may obtain a copy of the License at\n\n\t     http://www.apache.org/licenses/LICENSE-2.0\n\n\t  Unless required by applicable law or agreed to in writing, software\n\t  distributed under the License is distributed on an \"AS IS\" BASIS,\n\t  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n\t  See the License for the specific language governing permissions and\n\t  limitations under the License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feleme%2Famigo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feleme%2Famigo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feleme%2Famigo/lists"}