{"id":32307198,"url":"https://github.com/rhymelph/r_upgrade","last_synced_at":"2025-10-30T23:47:04.265Z","repository":{"id":50282478,"uuid":"205358590","full_name":"rhymelph/r_upgrade","owner":"rhymelph","description":"🆙🚀  Flutter application upgrade/ Flutter App Upgrade /Flutter App Update/Flutter Update / download Plug-in (with notice bar progress), supports full upgrade, hot update and incremental upgrade","archived":false,"fork":false,"pushed_at":"2023-12-26T07:51:44.000Z","size":79605,"stargazers_count":438,"open_issues_count":26,"forks_count":94,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-10-23T07:25:40.059Z","etag":null,"topics":["app","app-downloader","app-upgrade","application","download","flutter","flutter-plugin","flutter-update-apk","flutter-update-version","upgrade","version","version-control","version-manager"],"latest_commit_sha":null,"homepage":"http://rhyme95.win/r_upgrade/","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/rhymelph.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":null,"patreon":"rhymelph","open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":"https://mydata-1252536312.cos.ap-guangzhou.myqcloud.com/12805100-52683624d1fca6d9.png"}},"created_at":"2019-08-30T10:20:56.000Z","updated_at":"2025-10-15T08:29:58.000Z","dependencies_parsed_at":"2023-01-23T07:01:07.586Z","dependency_job_id":"d50eabfb-7859-47c8-86fb-a2baad6fa2bd","html_url":"https://github.com/rhymelph/r_upgrade","commit_stats":{"total_commits":103,"total_committers":3,"mean_commits":"34.333333333333336","dds":0.4271844660194175,"last_synced_commit":"99b828228e931158fa960d0d79f3034af2ff0ab8"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/rhymelph/r_upgrade","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhymelph%2Fr_upgrade","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhymelph%2Fr_upgrade/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhymelph%2Fr_upgrade/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhymelph%2Fr_upgrade/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rhymelph","download_url":"https://codeload.github.com/rhymelph/r_upgrade/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhymelph%2Fr_upgrade/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281026273,"owners_count":26431753,"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","status":"online","status_checked_at":"2025-10-25T02:00:06.499Z","response_time":81,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["app","app-downloader","app-upgrade","application","download","flutter","flutter-plugin","flutter-update-apk","flutter-update-version","upgrade","version","version-control","version-manager"],"created_at":"2025-10-23T07:15:15.357Z","updated_at":"2025-10-30T23:47:04.260Z","avatar_url":"https://github.com/rhymelph.png","language":"Java","funding_links":["https://patreon.com/rhymelph","https://mydata-1252536312.cos.ap-guangzhou.myqcloud.com/12805100-52683624d1fca6d9.png"],"categories":[],"sub_categories":[],"readme":"# r_upgrade\n[![pub package](https://img.shields.io/pub/v/r_upgrade.svg)](https://pub.dartlang.org/packages/r_upgrade)\n\n![](screen/r_upgrade.png)\n\n## [中文点此](README_CN.md)\n\nAndroid and IOS upgrade plugin.\n\n- [✔] Jump link mode upgrade\n- [✔] `Android` Get user installed android stores.\n- [✔] `Android` Get version from android stores（only support GooglePlay、XiaoMi、Tencent）\n- [✔] `Android` Jump to store mode upgrade\n- [✔] `Android` Download APK using download link\n    - [✔] Monitor download information\n    - [✔] cancel/pause/continue download\n    - [✔] Get download status according to ID\n    - [✔] Install app according to ID\n    - [✔] Get the last download ID (based on the version name and version number)\n    - [✔] Modify the information displayed in the notification bar\n- [✔] `Android` hot upgrade\n- [✔] `Android` increment upgrade\n- [✔] `IOS` Jump to Appstore upgrade according to appid\n- [✔] `IOS` Get the current online version of Appstore according to appid\n\n\u003e For the development of this plug-in, I haven't had a good meal for a long time. I hope you can click on the sponsor and give a little bit of money. Thank you!\n\n## List\n- [r_upgrade](#r_upgrade)\n  - [中文点此](#中文点此)\n  - [List](#list)\n  - [Getting Started](#getting-started)\n    - [1. Use Plugin:](#1-use-plugin)\n    - [2. Upgrade from your website ( Android or IOS )](#2-upgrade-from-your-website--android-or-ios-)\n  - [Android Platform](#android-platform)\n    - [1.Get android store list.](#1get-android-store-list)\n    - [2.Get version from android store.](#2get-version-from-android-store)\n    - [3. App upgrade from store.](#3-app-upgrade-from-store)\n    - [4. App upgrade from download link.](#4-app-upgrade-from-download-link)\n      - [1. Add Upgrade Download Listener](#1-add-upgrade-download-listener)\n      - [2. Upgrade your application](#2-upgrade-your-application)\n      - [3. Cancel Download](#3-cancel-download)\n      - [4. Install Apk](#4-install-apk)\n      - [5. Pause Download](#5-pause-download)\n      - [6. Continue Download](#6-continue-download)\n      - [7. Get the last upgrade id](#7-get-the-last-upgrade-id)\n      - [8. Get the download status from id](#8-get-the-download-status-from-id)\n      - [9. Increment Upgrade](#9-increment-upgrade)\n      - [10. Hot Upgrade](#10-hot-upgrade)\n  - [Android Platform Notification Bar](#android-platform-notification-bar)\n  - [IOS Platform](#ios-platform)\n    - [1.Go to the AppStore Upgrade](#1go-to-the-appstore-upgrade)\n    - [2.Get the last version form AppStore](#2get-the-last-version-form-appstore)\n  - [LICENSE](#license)\n\n\n## Getting Started\n\n### 1. Use Plugin:\n- add this code in `pubspec.yaml`\n\n```yaml\ndependencies:\n  r_upgrade: last version\n```\n\n### 2. Upgrade from your website ( Android or IOS )\n```dart\n    void upgradeFromUrl()async{\n        bool isSuccess =await RUpgrade.upgradeFromUrl(\n                    'https://www.google.com',\n                  );\n        print(isSuccess);\n    }\n```\n\n## Android Platform\n\n### 1.Get android store list.\n```dart\n    void getAndroidStores() async {\n       final stores = await RUpgrade.androidStores;\n    }\n```\n\n### 2.Get version from android store.\n```dart\n    void getVersionName() async {\n       final versionName = await RUpgrade.getVersionFromAndroidStore(AndroidStore.GOOGLE_PLAY);\n    }\n```\n\n### 3. App upgrade from store.\n```dart\n    void upgradeFromAndroidStore(){\n       bool isSuccess = await RUpgrade.upgradeFromAndroidStore(AndroidStore.GOOGLE_PLAY);\n       print('${isSuccess?'jump success':'jump error'}');\n    }\n```\n\n### 4. App upgrade from download link.\n\n\u003e make sure your application had this permission and request dynamic permission.\n\n```xml\n    \u003c!--(if you want to upload google store,can not add this permission)--\u003e\n    \u003cuses-permission android:name=\"android.permission.REQUEST_INSTALL_PACKAGES\" /\u003e\n     \u003c!--(if you want to use silent install，need to add this permission,and app is system app--\u003e\n    \u003cuses-permission android:name=\"android.permission.INSTALL_PACKAGES\" tools:ignore=\"ProtectedPermissions\"/\u003e\n\n    \u003cuses-permission android:name=\"android.permission.INTERNET\"/\u003e\n    \u003cuses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\"/\u003e\n```\n\n#### 1. Add Upgrade Download Listener\n```dart\nRUpgrade.stream.listen((DownloadInfo info){\n  ///...\n});\n```\ninfo:\n\n| param | desc |\n| - | - |\n| (int) id | download id |\n| (int) max_length | download max bytes length (bytes) |\n| (int) current_length | download current bytes length (bytes) |\n| (double) percent | download percent 0-100 |\n| (double) planTime | download plan time /s (X.toStringAsFixed(0)) |\n| (String) path | download file path |\n| (double) speed | download speed kb/s |\n| (DownloadStatus) status | download status \u003cbr\u003e `STATUS_PAUSED` \u003cbr\u003e `STATUS_PENDING` \u003cbr\u003e `STATUS_RUNNING` \u003cbr\u003e `STATUS_SUCCESSFUL` \u003cbr\u003e `STATUS_FAILED` \u003cbr\u003e `STATUS_CANCEL`|\n\n#### 2. Upgrade your application\nThis upgrade have two part.\n`useDownloadManager`:\n- `true`: Use system `DownloadManager`to download\n    - advantage：Simple, use system.\n    - Inferiority：can not use http download , can not click the notification pause downloading, can not pause and continue download by network status etc...\n    - support: `RUpgrade.stream`、`install`、`cancel`\n- `false`: Use `Service` download（default use）\n    - advantage：Power, support http/https download, support auto pause and continue download by network status etc..\n    - Inferiority：No bugs found yet. If you find a bug, you are welcome to issue\n    - support: `RUpgrade.stream`、`install`、`cancel`\n```dart\n    // [installType] downloaded finish will use install type to install apk.\n    // [apkName] apk name (such as `release.apk`)\n    // [notificationVisibility] notification visibility.\n    // [notificationStyle] download notification show style about content text, only support [useDownloadManager]==false.\n    // [useDownloadManager] if true will use DownloadManager,false will use my service ,\n    //         if true will no use [pause] , [upgradeWithId] , [getDownloadStatus] , [getLastUpgradedId] methods.\n    // [upgradeFlavor] you can use [RUpgradeFlavor.normal] , [RUpgradeFlavor.hotUpgrade] , [RUpgradeFlavor.incrementUpgrade] flavor\n    void upgrade() async {\n      int id = await RUpgrade.upgrade(\n                 'https://raw.githubusercontent.com/rhymelph/r_upgrade/master/apk/app-release.apk',\n                 apkName: 'app-release.apk', installType: RUpgradeInstallType.normal,);\n    }\n```\nNew upgraded flavor：(no support use DownloadManager)\n```dart\nenum RUpgradeFlavor {\n  normal, // full upgrade\n  hotUpgrade, // hot upgrade\n  incrementUpgrade, // increment upgrade\n}\n```\n\n#### 3. Cancel Download\n```dart\n    void cancel() async {\n      bool isSuccess=await RUpgrade.cancel(id);\n    }\n```\n\n#### 4. Install Apk\n\n- use download id install\n```dart\n    void install() async {\n      bool isSuccess=await RUpgrade.install(id);\n    }\n```\n- use file path install\n```dart\n    void installByPath(String path) async {\n      bool isSuccess=await RUpgrade.installByPath(path);\n     }\n```\n- install type\n```dart\n/// [RUpgrade.upgradeWithId]、[RUpgrade.upgrade]、[RUpgrade.install]、[RUpgrade.installByPath]\nenum RUpgradeInstallType {\n  normal,//normal install\n  silent,//silent install\n  none,// not install\n}\n```\n\n#### 5. Pause Download\n```dart\n    void pause() async {\n      bool isSuccess=await RUpgrade.pause(id);\n    }\n```\n\n#### 6. Continue Download\n```dart\n    void pause() async {\n      bool isSuccess=await RUpgrade.upgradeWithId(id);\n      /// return true.\n      /// * if download status is [STATUS_PAUSED] or [STATUS_FAILED] or [STATUS_CANCEL], will restart running.\n      /// * if download status is [STATUS_RUNNING] or [STATUS_PENDING], nothing happened.\n      /// * if download status is [STATUS_SUCCESSFUL] , will install apk.\n      ///\n      /// return false.\n      /// * if not found the id , will return [false].\n    }\n```\n\n#### 7. Get the last upgrade id\n```dart\n    void getLastUpgradeId() async {\n     int id = await RUpgrade.getLastUpgradedId();\n    }\n```\n\n#### 8. Get the download status from id\n```dart\n    void getDownloadStatus()async{\n    DownloadStatus status = await RUpgrade.getDownloadStatus(id);\n   }\n```\n#### 9. Increment Upgrade\n- 1.Download [bsdiff](https://github.com/rhymelph/r_upgrade/releases/download/v0.3.0/bsdiff) to local.\n- 2.Prepare two installation packages, one is the one to be upgraded（ old.apk ）, an installation package that you need to update（ new.apk )\n- 3.Switch to the 'bsdiff' directory downloaded above on the command line, and run the command`./bsdiff old.apk new.apk increment.patch`\n- 4.Put the` increment.patch `Upload to server\n- 5.use `RUpgrade.upgrade（...,upgradeFlavor:RUpgradeFlavor.incrementUpgrade）`download file\n- 6.use `RUpgrade.install(id)` install apk.\n\nThe code is as follows：\n```dart\n    int id;\n    void incrementUpgrade(){\n        id = await RUpgrade.upgrade(\n                'https://mydata-1252536312.cos.ap-guangzhou.myqcloud.com/r_upgrade.patch',\n                fileName: 'r_upgrade.patch',\n                useDownloadManager: false,\n                installType: RUpgradeInstallType.none,\n                upgradeFlavor: RUpgradeFlavor.incrementUpgrade,\n              );\n    }\n\n    void install(){\n        try {\n            await RUpgrade.install(id);\n        } catch (e) {\n            _state.currentState\n                .showSnackBar(SnackBar(content: Text('failure!')));\n        }\n    }\n```\n\n#### 10. Hot Upgrade\n- you can use this id to hot upgrade,but download file is zip. include three file [isolate_snapshot_data]、[kernel_blob.bin]、[vm_snapshot_data].Your can use `flutter build bundle` generate.\n```\n flutter build bundle\n```\n\n- generate file path form ./build/flutter_assets and packaged into zip.\n\n```\n|- AssetManifest.json\n|- FontManifest.json\n|- fonts\n    |- ...\n|- isolate_snapshot_data *\n|- kernel-blob.bin       *\n|- LICENSE\n|- packages\n    |- ...\n|- vm_snapshot_data      *\n```\n\n- use `RUpgrade.upgrade（...,upgradeFlavor:RUpgradeFlavor.hotUpgrade）`download file.\n- download complete you can use download `id` to hot upgrade\n\n```dart\n          bool isSuccess = await RUpgrade.install(id);\n           if (isSuccess) {\n              _state.currentState\n                    .showSnackBar(SnackBar(content: Text('Hot update succeeded, exit the application after 3S, please enter again')));\n                Future.delayed(Duration(seconds: 3)).then((_){\n                  SystemNavigator.pop(animated: true);\n                });\n           }else{\n              _state.currentState\n                    .showSnackBar(SnackBar(content: Text('Hot update failed, please wait for update package download to complete')));\n              }\n```\n\u003e At present, the hot update is still in the testing stage, only supporting the change of the flutter code, not supporting the resource file, etc. the author of the plug-in is not responsible for all the consequences caused by the hot update, and the user is responsible for it.\n\n## Android Platform Notification Bar\nIf you want to customize the content displayed in the download notification bar, you can do so, modify or add files `project/android/app/main/res/values/r_upgrade_value.xml`，add the following code\n```xml\n\u003c?xml version=\"1.0\" encoding=\"utf-8\"?\u003e\n\u003cresources\u003e\n    \u003cstring name=\"r_upgrade_download_speech\"\u003e%.0f kb/s\u003c/string\u003e\n    \u003cstring name=\"r_upgrade_download_planTime\"\u003e%.0fs left\u003c/string\u003e\n    \u003cstring name=\"r_upgrade_download_finish\"\u003eDownload finished\u003c/string\u003e\n    \u003cstring name=\"r_upgrade_download_paused\"\u003eDownload paused\u003c/string\u003e\n    \u003cstring name=\"r_upgrade_download_failed\"\u003eDownload failed\u003c/string\u003e\n\u003c/resources\u003e\n```\nAnd then.When you use `upgrade` method,you should set the `notificationStyle` param.\n```dart\n/// Notification show style about content text\nenum NotificationStyle {\n  speechAndPlanTime, // 100kb/s 1s left\n  planTimeAndSpeech, // 1s left 100kb/s\n  speech,// 100kb/s\n  planTime, // 1s left\n  none, //\n}\n```\n\n## IOS Platform\n\n### 1.Go to the AppStore Upgrade\n```dart\n    void upgradeFromAppStore() async {\n        bool isSuccess =await RUpgrade.upgradeFromAppStore(\n                 'your AppId',//such as:WeChat AppId:414478124\n                 false\n              );\n        print(isSuccess);\n    }\n```\n\n### 2.Get the last version form AppStore\n```dart\n    void getVersionFromAppStore() async {\n        String versionName = await RUpgrade.getVersionFromAppStore(\n                'your AppId',//such as:WeChat AppId:414478124\n                false\n               );\n        print(versionName);\n    }\n```\n\n## LICENSE\n    Copyright 2021 rhymelph\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%2Frhymelph%2Fr_upgrade","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frhymelph%2Fr_upgrade","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frhymelph%2Fr_upgrade/lists"}