app-updater

Specialist in self-hosted APK updates without Google Play.

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "app-updater" with this command: npx skills add dbobkov245-source/pwa-torserve/dbobkov245-source-pwa-torserve-app-updater

Self-Hosted App Updater

This skill handles updating the Android TV application (APK) directly from a private server or GitHub Releases, bypassing Google Play.

🔄 Update Workflow

  1. Check Version: Fetch version.json from your server on app launch.
  2. Prompt User: If remoteVersion > localVersion, show a modal: "Update Available".
  3. Download APK: Use CapacitorHttp to download the .apk file to a temporary location.
  4. Install: Trigger the Android Intent to install the package.

📱 Implementation Details

1. Version Manifest (version.json)

Host this file on your server (e.g., GitHub Pages or your API):

{
  "version": "1.2.3",
  "minVersion": "1.0.0", // Force update if critical
  "url": "https://example.com/app-release.apk",
  "notes": "Fixed critical bug with player."
}

2. Download & Install (Java/Native Plugin)

Since standard web APIs cannot trigger APK installation, you need a Native Plugin method (extend TVPlayer.java or create AppUpdater.java).

Required Permissions (AndroidManifest.xml):

<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

Java Implementation (Snippet):

// Download logic using DownloadManager or OkHttp...
// Then install:
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(apkUri, "application/vnd.android.package-archive");
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); // Critical for FileProvider
context.startActivity(intent);

3. FileProvider (Critical for Android 7+)

You cannot just expose file:// URIs. You MUST use a FileProvider in AndroidManifest.xml:

<provider
    android:name="androidx.core.content.FileProvider"
    android:authorities="${applicationId}.fileprovider"
    android:exported="false"
    android:grantUriPermissions="true">
    <meta-data
        android:name="android.support.FILE_PROVIDER_PATHS"
        android:resource="@xml/file_paths" />
</provider>

res/xml/file_paths.xml:

<paths>
    <external-path name="external_files" path="."/>
</paths>

⚠️ Safety First

  • Signature Verification: Android automatically verifies that the new APK signature matches the old one. If not, update fails. Ensure you sign with the SAME key.
  • HTTPS Only: Never download APKs over HTTP.
  • User Consent: Always ask the user before starting a download (bandwidth) and before installing.

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

tv-navigator

No summary provided by upstream source.

Repository SourceNeeds Review
General

resilience-core

No summary provided by upstream source.

Repository SourceNeeds Review
General

capacitor-bridge

No summary provided by upstream source.

Repository SourceNeeds Review
General

perf-virtual-lists

No summary provided by upstream source.

Repository SourceNeeds Review