Skip to content

Fix provider config crash after 1.0.17 migration - #226

Open
vallembreuse wants to merge 18 commits into
Davidona:masterfrom
vallembreuse:fix/provider-config-migration-crash
Open

Fix provider config crash after 1.0.17 migration#226
vallembreuse wants to merge 18 commits into
Davidona:masterfrom
vallembreuse:fix/provider-config-migration-crash

Conversation

@vallembreuse

Copy link
Copy Markdown

Summary

Fixes a startup crash affecting provider configurations migrated by the 1.0.17 typed-provider migration.

Observed exception:

java.lang.IllegalArgumentException: Configuration payload does not match stored provider type

Root cause

The 1.0.17 provider migration stores the provider type in the provider_configs.type column, while migrated encrypted_config_json payloads can omit the corresponding type field.

When Gson deserializes one of these migrated payloads into a Kotlin provider configuration class, the body-property initializer for type may not run. The existing codec then compares this value with the stored provider type and throws.

Fix

  • Detect migrated payloads that do not contain an explicit type.
  • Reconstruct the decoded data class with copy() so its Kotlin type property is initialized normally.
  • Keep strict validation for payloads that explicitly contain a type: a real mismatch still throws.
  • Preserve the existing credential encryption/decryption behavior.

Tests

Added a regression test covering migrated payloads without embedded type for:

  • Xtream Codes
  • M3U
  • Stalker Portal
  • Jellyfin

The targeted provider configuration tests pass.

Device validation

A debug build containing the patch was tested on a Redmi Pad 2 Pro running Android 16 / HyperOS 3.

Validated successfully:

  • application startup
  • IPTV provider creation
  • application restart
  • channel playback
  • EPG loading

The debug build uses a separate application data sandbox, so the historical migrated database scenario is covered by the regression test rather than direct access to the official app's private database.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant