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

Commit 0433d6f

Browse files
committed
Check versionCode
1 parent 297d3a3 commit 0433d6f

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

Diff for: sync/model/MagiskUpdateJson.py

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import re
21
from pathlib import Path
32

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

26+
try:
27+
obj["versionCode"] = int(obj["versionCode"])
28+
except ValueError:
29+
msg = f"wrong type of versionCode, expected int but got {type(obj['versionCode']).__name__}"
30+
raise ValueError(msg)
31+
except TypeError:
32+
raise ValueError("versionCode does not exist in module.prop")
33+
2734
return MagiskUpdateJson(obj)

0 commit comments

Comments
 (0)