{"id":13483808,"url":"https://github.com/azhon/AppUpdate","last_synced_at":"2025-03-27T15:30:32.960Z","repository":{"id":37664519,"uuid":"119366440","full_name":"azhon/AppUpdate","owner":"azhon","description":"Android App update library.  Android版本更新库，简单、轻量、可随意定制","archived":false,"fork":false,"pushed_at":"2025-01-08T15:35:45.000Z","size":40193,"stargazers_count":2361,"open_issues_count":0,"forks_count":343,"subscribers_count":43,"default_branch":"main","last_synced_at":"2025-03-27T01:05:30.012Z","etag":null,"topics":["android","apk","app-update","high-scalability","kotlin","kotlin-coroutines","simple"],"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/azhon.png","metadata":{"files":{"readme":"README-EN.md","changelog":null,"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,"dei":null,"publiccode":null,"codemeta":null},"funding":{"custom":["https://github.com/azhon/AppUpdate#%E8%B5%9E%E8%B5%8F"]}},"created_at":"2018-01-29T10:13:18.000Z","updated_at":"2025-03-23T14:58:49.000Z","dependencies_parsed_at":"2024-12-18T00:00:22.757Z","dependency_job_id":"1f27cee2-c529-4f88-9bf4-26a704098ecb","html_url":"https://github.com/azhon/AppUpdate","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/azhon%2FAppUpdate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/azhon%2FAppUpdate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/azhon%2FAppUpdate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/azhon%2FAppUpdate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/azhon","download_url":"https://codeload.github.com/azhon/AppUpdate/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245871682,"owners_count":20686246,"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","apk","app-update","high-scalability","kotlin","kotlin-coroutines","simple"],"created_at":"2024-07-31T17:01:15.476Z","updated_at":"2025-03-27T15:30:32.915Z","avatar_url":"https://github.com/azhon.png","language":"Kotlin","readme":"## [中文 文档](https://github.com/azhon/AppUpdate/blob/main/README.md)\n\n\u003cp align=\"center\"\u003e\u003cimg src=\"https://github.com/azhon/AppUpdate/blob/main/img/logo.png\"\u003e\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/miniSdk-16%2B-blue.svg\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/mavenCentral-4.3.6-brightgreen.svg\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/author-azhon-%23E066FF.svg\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/license-Apache2.0-orange.svg\"\u003e\n\u003c/p\u003e\n\n## The core logic of this library：\n#### 1、When `apkVersionCode()` is set the latest VersionCode, it will automatically judge whether to display the dialog, download and install\n- Adapt to Android 13 notification permission, and when set `showNotification(true)`, clicking the upgrade button will request notification permission, and the download will continue regardless of whether you agree or not\n- When set `forcedUpgrade(true)`，display dialog has progress bar\n#### 2、When `apkVersionCode()` is not set, it can be regarded as a downloader, which will only download and install\n#### 3、Since Android Q version restricts background apps from launching Activity, a notification will be sent to the notification bar when the download is complete (ignoring the showNotification value, you need to allow notifications to be sent)\n#### 4、[For more usage,click here](https://github.com/azhon/AppUpdate/blob/main/app/src/main/java/com/azhon/app/MainActivity.kt#L79)\n\n### Related Docs Links\n- [Activity background starts](https://developer.android.google.cn/guide/components/activities/background-starts)\n- [Adapt notification](https://developer.android.google.cn/guide/topics/ui/notifiers/notifications?hl=zh-cn)\n\n## Table of Contents\n\n* Rendering\n* Function introduction\n* Demo download experience\n* Steps for usage\n* Skills\n* Version update record\n* End\n\n### Rendering\n\n\u003cimg src=\"https://github.com/azhon/AppUpdate/blob/main/img/en/en_1.png\" width=\"300\"\u003e　\u003cimg src=\"https://github.com/azhon/AppUpdate/blob/main/img/en/en_2.png\" width=\"300\"\u003e\n\u003cimg src=\"https://github.com/azhon/AppUpdate/blob/main/img/en/en_3.png\" width=\"300\"\u003e　\u003cimg src=\"https://github.com/azhon/AppUpdate/blob/main/img/en/en_4.png\" width=\"300\"\u003e\n\u003cimg src=\"https://github.com/azhon/AppUpdate/blob/main/img/en/en_5.png\" width=\"300\"\u003e　\u003cimg src=\"https://github.com/azhon/AppUpdate/blob/main/img/en/en_6.png\" width=\"300\"\u003e\n\u003cimg src=\"https://github.com/azhon/AppUpdate/blob/main/img/en/en_7.png\" width=\"300\"\u003e\n\n### Function introduction\n\n* [x] Support Java、Kotlin\n* [x] Support AndroidX\n* [x] Support for custom download process\n* [x] Support Android 4.1 and above\n* [x] Support notification progress display, adapt to Android 13\n* [x] Support Chinese/Traditional/English \n* [x] Support for custom built-in dialog styles\n* [x] Support for canceling the download (if the notification bar message is sent, it will be removed)\n* [x] Support download completion Delete old APK file after opening new version\n* [x] Download using HttpURLConnection, no other third-party framework is integrated\n\n### [Demo download experience](https://github.com/azhon/AppUpdate/releases/tag/demo)\n\n### Steps for usage\n\n#### Step1：`app/build.gradle`\n\n```groovy\nimplementation 'io.github.azhon:appupdate:4.3.6'\n```\n\u003cdetails\u003e\n\u003csummary\u003eSince in-app updates are prohibited by GooglePlay policy, it can be handled in productFlavors\u003c/summary\u003e\n\n- [GooglePlay policy](https://support.google.com/googleplay/android-developer/answer/9888379?hl=en\u0026ref_topic=9877467)\n- Library provides a version without no operation[Click see more](https://github.com/azhon/AppUpdate/blob/main/app/build.gradle)\n```groovy\nandroid {\n    //...\n    productFlavors {\n        other {}\n        googlePlay {}\n    }\n}\n\ndependencies {\n    otherImplementation 'io.github.azhon:appupdate:latest-version'\n    googlePlayImplementation 'io.github.azhon:appupdate-no-op:latest-version'\n}\n```\n\u003c/details\u003e\n\n#### Step2：Create `DownloadManager`\n\n\u003cdetails open\u003e\n\u003csummary\u003eKotlin\u003c/summary\u003e\n\n```java\nval manager = DownloadManager.Builder(this).run {\n    apkUrl(\"your apk url\")\n    apkName(\"appupdate.apk\")\n    smallIcon(R.mipmap.ic_launcher)\n    //If this parameter is set, it will automatically determine whether to show dialog\n    apkVersionCode(2)\n    apkVersionName('v4.2.2')\n    apkSize(\"7.7MB\")\n    apkDescription(\"description...\")\n    //Optional parameters...\n    build()\n}\nmanager?.download()\n```\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eJava\u003c/summary\u003e\n\n```java\nDownloadManager manager = new DownloadManager.Builder(this)\n        .apkUrl(\"your apk url\")\n        .apkName(\"appupdate.apk\")\n        .smallIcon(R.mipmap.ic_launcher)\n        //If this parameter is set, it will automatically determine whether to show dialog\n        .apkVersionCode(2)\n        .apkVersionName(\"v4.2.2\")\n        .apkSize(\"7.7MB\")\n        .apkDescription(\"description...\")\n        //Optional parameters...\n        .build();\nmanager.download();\n```\n\u003c/details\u003e\n\n#### Step3：ProGuard Rules\n\n```groovy\n-keep public class * extends android.app.Activity\n-keep public class * extends android.app.Service\n```\n\n### Skills\n\n* Internationalization support, other languages only need to take the same name in the corresponding `string.xml`\n* To view the Log, you only need to filter the Tag at the beginning of `AppUpdate`\n* Download completed Delete old APK file after opening new version\n\n```java\n//Old version apk file save path\nval result = ApkUtil.deleteOldApk(this, \"${externalCacheDir?.path}/appupdate.apk\")\n```\n\n* Tips: The contents of the upgrade dialog can be swiped up and down！\n* If you need to implement your own set of download process, you only need to `extends` `BaseHttpDownloadManager`.\n\n```java\nclass MyDownload : BaseHttpDownloadManager() {}\n```\n\n### Version update record\n\n* v4.3.6（2024/10/22）\n\n  * [Opt] Change DownloadManager release() to public\n\n#### [More update records click here to view](https://github.com/azhon/AppUpdate/wiki/Home)\n\n### End\n\n* If you encounter problems during use, please feel free to ask Issues.\n* If you have any good suggestions, you can also mention Issues or send  email to: azhon.cn@gmail.com.\n","funding_links":["https://github.com/azhon/AppUpdate#%E8%B5%9E%E8%B5%8F"],"categories":["Kotlin"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fazhon%2FAppUpdate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fazhon%2FAppUpdate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fazhon%2FAppUpdate/lists"}