Skip to content

Commit b2a5c03

Browse files
committed
move installer in modfs to top
1 parent 98cd842 commit b2a5c03

File tree

4 files changed

+50
-64
lines changed

4 files changed

+50
-64
lines changed

Website/src/activitys/MainApplication.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,6 @@ const MainApplication = () => {
5252
}
5353
}, [modules]);
5454

55-
const hasInstallTools = SuFile.exist(`${modFS("MMRLINI")}/module.prop`);
56-
5755
const renderTabs = (): TabbarRenderTab[] => {
5856
return [
5957
{
@@ -72,7 +70,7 @@ const MainApplication = () => {
7270
modules={localModules}
7371
renderItem={(module, key) => <DeviceModule key={key} module={module} />}
7472
renderFixed={() => {
75-
if (os.isAndroid && (Shell.isMagiskSU() || Shell.isKernelSU() || Shell.isAPatchSU()) && hasInstallTools) {
73+
if (os.isAndroid && (Shell.isMagiskSU() || Shell.isKernelSU() || Shell.isAPatchSU())) {
7674
return (
7775
<Fab
7876
sx={{

Website/src/activitys/ModFSActivity.tsx

Lines changed: 43 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,49 @@ function ModFSActivity() {
4848

4949
const items: ModFSSections[] = React.useMemo<ModFSSections[]>(
5050
() => [
51+
{
52+
sectionText: "Installer",
53+
items: [
54+
{
55+
text: "Explore install script",
56+
multiline: true,
57+
maxRows: 10,
58+
dialogDesc: (
59+
<>
60+
<Typography>
61+
Check the{" "}
62+
<Anchor href="https://github.com/DerGoogler/MMRL/tree/master/docs" noIcon>
63+
ModFS documentations
64+
</Anchor>{" "}
65+
for more informations!
66+
<br />
67+
<code>{"<URL>"}</code> and <code>{"<MODID>"}</code> can also be used, shell supported.
68+
</Typography>
69+
</>
70+
),
71+
confKey: "EXPLORE_INSTALL",
72+
},
73+
{
74+
text: "Local install script",
75+
multiline: true,
76+
maxRows: 10,
77+
dialogDesc: (
78+
<>
79+
<Typography>
80+
Check the{" "}
81+
<Anchor href="https://github.com/DerGoogler/MMRL/tree/master/docs" noIcon>
82+
ModFS documentations
83+
</Anchor>{" "}
84+
for more informations!
85+
<br />
86+
<code>{"<ZIPFILE>"}</code> can also be used, shell supported.
87+
</Typography>
88+
</>
89+
),
90+
confKey: "LOCAL_INSTALL",
91+
},
92+
],
93+
},
5194
{
5295
sectionText: "Command line interfaces",
5396
items: [
@@ -214,53 +257,6 @@ function ModFSActivity() {
214257
},
215258
],
216259
},
217-
{
218-
sectionText: "Others",
219-
items: [
220-
{
221-
text: "MMRL Install Tools",
222-
confKey: "MMRLINI",
223-
},
224-
{
225-
text: "Explore install script",
226-
multiline: true,
227-
maxRows: 10,
228-
dialogDesc: (
229-
<>
230-
<Typography>
231-
Check the{" "}
232-
<Anchor href="https://github.com/DerGoogler/MMRL/tree/master/docs" noIcon>
233-
ModFS documentations
234-
</Anchor>{" "}
235-
for more informations!
236-
<br />
237-
<code>{"<URL>"}</code> and <code>{"<MODID>"}</code> can also be used, shell supported.
238-
</Typography>
239-
</>
240-
),
241-
confKey: "EXPLORE_INSTALL",
242-
},
243-
{
244-
text: "Local install script",
245-
multiline: true,
246-
maxRows: 10,
247-
dialogDesc: (
248-
<>
249-
<Typography>
250-
Check the{" "}
251-
<Anchor href="https://github.com/DerGoogler/MMRL/tree/master/docs" noIcon>
252-
ModFS documentations
253-
</Anchor>{" "}
254-
for more informations!
255-
<br />
256-
<code>{"<ZIPFILE>"}</code> can also be used, shell supported.
257-
</Typography>
258-
</>
259-
),
260-
confKey: "LOCAL_INSTALL",
261-
},
262-
],
263-
},
264260
],
265261
[]
266262
);

Website/src/activitys/ModuleViewActivity/index.tsx

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,7 @@ const ModuleViewActivity = () => {
124124
);
125125
};
126126

127-
const { modFS } = useModFS();
128127
const [isNameVisible, setIsNameVisible] = React.useState(true);
129-
const hasInstallTools = SuFile.exist(`${modFS("MMRLINI")}/module.prop`);
130128

131129
const boxRef = React.useRef<HTMLDivElement | null>(null);
132130
const [value, setValue] = React.useState(0);
@@ -328,12 +326,8 @@ const ModuleViewActivity = () => {
328326
)}
329327
</Stack>
330328

331-
{/* <Typography sx={{ display: "flex", justifyContent: "flex-start", alignItems: "center" }} color="text.secondary">
332-
({versionCode})
333-
</Typography> */}
334-
335329
<Stack direction="row" justifyContent="center" alignItems="center" spacing={1}>
336-
{os.isAndroid && (Shell.isMagiskSU() || Shell.isKernelSU() || Shell.isAPatchSU()) && hasInstallTools && (
330+
{os.isAndroid && (Shell.isMagiskSU() || Shell.isKernelSU() || Shell.isAPatchSU()) && (
337331
<Button
338332
color="secondary"
339333
sx={{

Website/src/hooks/useModFS.tsx

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,7 @@ export interface ModFS {
4444
MODCONF_PLAYGROUND: string;
4545
MODCONF_PLAYGROUND_MODID: string;
4646

47-
// others
48-
MMRLINI: string;
47+
// Installer
4948
EXPLORE_INSTALL: string;
5049
LOCAL_INSTALL: string;
5150
}
@@ -89,10 +88,9 @@ export const INITIAL_MOD_CONF: ModFS = {
8988
MODCONF_PLAYGROUND: "<ADB>/mmrl/modconf-playground.jsx",
9089
MODCONF_PLAYGROUND_MODID: "playground",
9190

92-
// others
93-
MMRLINI: "<MODULES>/mmrl_install_tools",
94-
EXPLORE_INSTALL: "sh <MMRLINI>/system/usr/share/mmrl/bin/mmrl_explore_install_v8.sh",
95-
LOCAL_INSTALL: "sh <MMRLINI>/system/usr/share/mmrl/bin/mmrl_local_install_v8.sh",
91+
// Installer
92+
EXPLORE_INSTALL: 'mmrl install -y "<URL>"',
93+
LOCAL_INSTALL: 'mmrl install local -y "<ZIPFILE>"',
9694
};
9795

9896
export interface ModConfContext {
@@ -116,7 +114,7 @@ export const useModFS = () => {
116114
};
117115

118116
export const ModFSProvider = (props: React.PropsWithChildren) => {
119-
const [modFS, setModFS] = useNativeFileStorage("/data/adb/mmrl/modfs.v7.json", INITIAL_MOD_CONF, { loader: "json" });
117+
const [modFS, setModFS] = useNativeFileStorage("/data/adb/mmrl/modfs.v8.json", INITIAL_MOD_CONF, { loader: "json" });
120118

121119
const contextValue = React.useMemo(
122120
() => ({

0 commit comments

Comments
 (0)