{"id":18750711,"url":"https://github.com/cafebazaar/bazaarupdater","last_synced_at":"2025-08-04T07:10:27.516Z","repository":{"id":250462119,"uuid":"833223881","full_name":"cafebazaar/BazaarUpdater","owner":"cafebazaar","description":null,"archived":false,"fork":false,"pushed_at":"2025-07-04T20:58:33.000Z","size":895,"stargazers_count":9,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-04T21:35:34.858Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/cafebazaar.png","metadata":{"files":{"readme":"README.md","changelog":null,"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,"zenodo":null}},"created_at":"2024-07-24T15:43:12.000Z","updated_at":"2024-12-21T12:58:26.000Z","dependencies_parsed_at":"2025-04-12T23:32:33.093Z","dependency_job_id":"6eaa2bac-da34-4c94-8db9-1bf4d7a87a84","html_url":"https://github.com/cafebazaar/BazaarUpdater","commit_stats":null,"previous_names":["hamid97m/bazaarupdater","cafebazaar/bazaarupdater"],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/cafebazaar/BazaarUpdater","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cafebazaar%2FBazaarUpdater","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cafebazaar%2FBazaarUpdater/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cafebazaar%2FBazaarUpdater/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cafebazaar%2FBazaarUpdater/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cafebazaar","download_url":"https://codeload.github.com/cafebazaar/BazaarUpdater/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cafebazaar%2FBazaarUpdater/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268660142,"owners_count":24286028,"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-08-04T02:00:09.867Z","response_time":79,"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":[],"created_at":"2024-11-07T17:12:52.802Z","updated_at":"2025-08-04T07:10:27.496Z","avatar_url":"https://github.com/cafebazaar.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# BazaarUpdater Android SDK\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"./images/dark.png\" alt=\"gif\" width=\"700\"\u003e\n\u003c/p\u003e\n\n[![GitHub License](https://img.shields.io/github/license/cafebazaar/BazaarPay)](https://www.apache.org/licenses/LICENSE-2.0)\n[![Download](https://jitpack.io/v/cafebazaar/BazaarUpdater.svg)](https://jitpack.io/#cafebazaar/BazaarUpdater)\n\n\nBazaarUpdater is an Android library that simplifies checking for updates and managing the update process for your application on Bazaar.\n\n## Setup\n\nTo get started with BazaarUpdater, you need to add the JitPack repository to your project and include the library dependency.\n\n### Adding JitPack Repository\n\n**Kotlin DSL**\n\n```kotlin\nrepositories {\n    maven { url = uri(\"https://jitpack.io\") }\n}\n```\n\n**groovy**\n```groovy\nrepositories {\n    maven { url 'https://jitpack.io' }\n}\n```\n\n## Adding Dependency\n\n**Kotlin DSL**\n\n```kotlin\ndependencies {\n    implementation(\"com.github.cafebazaar:bazaarUpdater:1.1.0\")\n}\n```\n\n**groovy**\n\n```groovy\ndependencies {\n    implementation 'com.github.cafebazaar:bazaarUpdater:1.1.0'\n}\n```\n## Usage\n\n### Checking for Updates\n\nTo check if there are any updates available for your application on Bazaar, use the following code:\n\n\n```kotlin\nBazaarUpdater.getLastUpdateState(context = context) { result -\u003e\n    when(result) {\n        UpdateResult.AlreadyUpdated -\u003e {\n            // Handle the case where the app is already updated\n        }\n        is UpdateResult.Error -\u003e {\n            // Handle the error case\n            val errorMessage = result.getError()?.message\n        }\n        is UpdateResult.NeedUpdate -\u003e {\n            // Handle the case where an update is needed\n            val targetVersion = result.getTargetVersionCode()\n        }\n    }\n}\n```\n\n\u003cdetails\u003e\u003csummary\u003e\u003cb\u003eJava Usage\u003c/b\u003e\u003c/summary\u003e\n\n```java\nBazaarUpdater.getLastUpdateState(context, result -\u003e {\n    if (result.isAlreadyUpdated()) {\n        // Handle the case where the app is already updated\n    } else if (result.isUpdateNeeded()) {\n        // Handle the case where an update is needed\n        long targetVersion = result.getTargetVersionCode();\n    } else {\n        // Handle the error case\n        String errorMessage = result.getError().getMessage();\n    }\n});\n```\n\u003c/details\u003e\n\n#### Update Result States\n\n##### 1. AlreadyUpdated: Indicates that your application is up-to-date.\n\n##### 2. Error: Indicates an error occurred. Use `result.message` to get the error message.\n\n##### 3. NeedUpdate: Indicates that a new update is available. Use `result.getTargetVersionCode()` to get the version code of the update.\n\n### Updating the Application\n\nTo update your application when a new version is available on Bazaar, simply call:\n\n```kotlin\nBazaarUpdater.updateApplication(context = context)\n```\n## Auto Update\n\nThis feature allows you to enable automatic updates for your apps in Bazaar. Once enabled, Bazaar will check for application updates daily. If an update is available and Bazaar is the update owner of your app, it will automatically download and install the update.\n\n\u003e ⚠️ Note: This feature requires Bazaar version 26.2.0 or higher.\n\n\u003e ⚠️ Package Name : Ensure the package name (also known as the application ID in Android) in your source code exactly matches the one used in the already published app. This is typically defined in your app's AndroidManifest.xml file.\n\n\u003e ⚠️ Signature : The app must be signed with the same key as the published version. Make sure you’re using the correct keystore and alias that were used for the original app.\n\n### Checking for Auto Update\n\nTo check whether Auto Update is enabled for your application in Bazaar, use the following code:\n\n```kotlin\nBazaarAutoUpdater.getLastAutoUpdateState(context = this) { result -\u003e\n    when (result) {\n        is AutoUpdateResult.Error -\u003e {\n            // Handle the error case\n            val errorMessage = result.getError()?.message\n        }\n        is AutoUpdateResult.Result -\u003e {\n            val isEnabled = result.isEnable()\n        }\n    }\n}\n```\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eJava Usage\u003c/strong\u003e\u003c/summary\u003e\n\n```java\nBazaarAutoUpdater.getLastAutoUpdateState(context, result -\u003e {\n    if (result.getError() != null) {\n        // Handle the error case\n        String errorMessage = result.getError().getMessage();\n    } else {\n        Boolean isEnabled = result.isEnable();\n    }\n});\n```\n\n\u003c/details\u003e\n\n### Enable Auto Update\n\nTo enable Auto Update for your application, simply call the following method:\n\n```kotlin\nBazaarAutoUpdater.enableAutoUpdate(context = context)\n```\n\n## Contributing\n\nContributions are welcome! If you have suggestions or improvements, please open an issue or submit a pull request.\n\n\n## License\n\nThis project is licensed under the Apache License 2.0 - see the [LICENSE](LICENSE) file for details.\n\n\u003cbr/\u003e\n\u003cbr/\u003e\n\n\u003cp align=\"center\"\u003e\nMade with 💚 in Bazaar Hackathon 1403\n\u003c/p\u003e\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcafebazaar%2Fbazaarupdater","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcafebazaar%2Fbazaarupdater","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcafebazaar%2Fbazaarupdater/lists"}