Skip to content
This repository has been archived by the owner on Jun 23, 2024. It is now read-only.

Commit

Permalink
Check versionCode
Browse files Browse the repository at this point in the history
  • Loading branch information
SanmerDev committed Aug 31, 2023
1 parent 297d3a3 commit 0433d6f
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion sync/model/MagiskUpdateJson.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import re
from pathlib import Path

from .AttrDict import AttrDict
Expand All @@ -24,4 +23,12 @@ def load(cls, path):
else:
raise ValueError(f"unsupported type {type(path).__name__}")

try:
obj["versionCode"] = int(obj["versionCode"])
except ValueError:
msg = f"wrong type of versionCode, expected int but got {type(obj['versionCode']).__name__}"
raise ValueError(msg)
except TypeError:
raise ValueError("versionCode does not exist in module.prop")

return MagiskUpdateJson(obj)

0 comments on commit 0433d6f

Please sign in to comment.