Skip to content

Commit 3c9f638

Browse files
author
DerGoogler
committed
Fixes
1 parent eb3c776 commit 3c9f638

File tree

3 files changed

+43
-17
lines changed

3 files changed

+43
-17
lines changed

Website/src/activitys/ViewModuleActivity.tsx

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import Video from "@Components/dapi/Video";
1616
import DiscordWidget from "@Components/dapi/DiscordWidget";
1717
import LinkManager from "@Native/LinkManager";
1818
import Log from "@Builders/Log";
19+
import PackageManager from "@Native/PackageManager";
1920

2021
interface Props {
2122
extra?: any;
@@ -219,8 +220,24 @@ class ViewModuleActivity extends React.Component<Props, States> {
219220
if (minMagisk != (null || undefined)) {
220221
return (
221222
<tr>
222-
<td style={{ width: "100%" }}>Min. Magisk</td>
223-
<td>{minMagisk}</td>
223+
<td
224+
style={{
225+
width: "100%",
226+
}}
227+
>
228+
Min. Magisk
229+
</td>
230+
<td
231+
style={{
232+
color: Constants.isAndroid
233+
? PackageManager.parseMagisk(minMagisk) > PackageManager.getMagiskVersionCode
234+
? "red"
235+
: ""
236+
: "",
237+
}}
238+
>
239+
{minMagisk}
240+
</td>
224241
</tr>
225242
);
226243
} else {

Website/src/components/ExploreModule.tsx

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -204,20 +204,21 @@ class ExploreModule extends React.Component<Props, States> {
204204
}}
205205
>
206206
{props.name}
207+
208+
{(() => {
209+
if (isVerified) {
210+
return (
211+
<>
212+
{" "}
213+
<VerifiedIcon color="#4a148c" />
214+
</>
215+
);
216+
} else {
217+
return null;
218+
}
219+
})()}
207220
</span>
208221
</item-module-name>
209-
{(() => {
210-
if (isVerified) {
211-
return (
212-
<>
213-
{" "}
214-
<VerifiedIcon color="#4a148c" />
215-
</>
216-
);
217-
} else {
218-
return null;
219-
}
220-
})()}
221222
</item-title>
222223
<div className="content">
223224
<item-version-author

Website/src/native/PackageManager.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ class PackageManager {
2727
}
2828
}
2929

30-
public static get getMagiskVersionCode(): string {
30+
public static get getMagiskVersionCode(): number {
3131
if (Constants.isAndroid) {
32-
return Shell.cmd("su -V").result();
32+
return parseInt(Shell.cmd("su -V").result());
3333
} else {
34-
return "0";
34+
return 0;
3535
}
3636
}
3737
public static get getMagiskVersionName(): string {
@@ -41,6 +41,14 @@ class PackageManager {
4141
return "0:MAGISKSU";
4242
}
4343
}
44+
public static parseMagisk(version: string): number {
45+
const i = version.indexOf(".");
46+
if (i == -1) {
47+
return parseInt(version);
48+
} else {
49+
return parseInt(version.substring(0, i)) * 1000 + parseInt(version.substring(i + 1)) * 100;
50+
}
51+
}
4452
}
4553

4654
export default PackageManager;

0 commit comments

Comments
 (0)