Skip to content

Commit

Permalink
2.4.3
Browse files Browse the repository at this point in the history
  • Loading branch information
DerGoogler committed Jun 30, 2024
1 parent 3b12a65 commit 16a7ed5
Show file tree
Hide file tree
Showing 16 changed files with 81 additions and 76 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/module.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Make
shell: bash
run: |
zip -r "module.zip" * -x ".git" -x "README.md"
zip -r "module.zip" * -x ".git" -x "README.md" -x "assets/*"
- name: Publish
uses: softprops/action-gh-release@v1
Expand Down
8 changes: 5 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<divider textAlign="left"><h1>2.3.2</h1></divider>
<divider textAlign="left"><h1>2.4.3</h1></divider>

- Removed toolbar coloring
- Added ability to view saved bluetooth devices
> MMRL v2.19.18 is required to use this version!
- Fixed bluetooth tab
- Fixed imports
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ This project is also a example to show how powerful MMRL's ModConf feature is.
Using `DOMParser` to extract local saved wifi passwords

> [!IMPORTANT]
> This project requires MMRL above 2.14.10!
> This project requires MMRL above 2.19.18!
```js
const wifiXmlParser = new DOMParser();
Expand Down
Binary file added assets/1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions common/repo.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,9 @@
"Tweaks and Hacks",
"Miscellaneous"
],
"screenshots": [
"https://raw.githubusercontent.com/Googlers-Repo/wpd/master/assets/1.png",
"https://raw.githubusercontent.com/Googlers-Repo/wpd/master/assets/2.png"
],
"readme": "https://raw.githubusercontent.com/Googlers-Repo/wpd/master/README.md"
}
4 changes: 2 additions & 2 deletions module.prop
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
id=mmrl_wpd
name=WiFi Password Viewer for MMRL
version=2.3.2
versionCode=232
version=2.4.3
versionCode=243
author=Der_Googler, veez21 @ xda-developers
description=View all your WiFi passwords and bluetooth devices inside MMRL
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React from "react";
import { Box } from "@mui/material";

export default (props) => {
const CenterBox = (props) => {
return (
<Box
component="h4"
Expand All @@ -17,3 +16,5 @@ export default (props) => {
/>
);
};

export { CenterBox }
17 changes: 0 additions & 17 deletions system/usr/share/mmrl/config/mmrl_wpd/components/RenderToolbar.jsx

This file was deleted.

47 changes: 31 additions & 16 deletions system/usr/share/mmrl/config/mmrl_wpd/hooks/useBackHandler.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,38 @@
import { useActivity, useConfirm } from "@mmrl/hooks";

export default () => {
const useBackHandler = () => {
const { context } = useActivity();
const confirm = useConfirm();

return (e) => {
confirm({
title: "Leaving?",
description: "Are you sure that you want leave this config?",
confirmationText: "Yes",
cancellationText: "No",
})
.then(() => {
if (typeof e.callParentHandler === "function") {
e.callParentHandler();
} else {
context.popPage();
}
const [index, setIndex] = React.useState(0);

const backHandler = React.useCallback((e) => {
if (index === 0) {
confirm({
title: "Leaving?",
description: "Are you sure that you want leave this config?",
confirmationText: "Yes",
cancellationText: "No",
})
.catch(() => {});
};
.then(() => {
if (typeof e.callParentHandler === "function") {
e.callParentHandler();
} else {
context.popPage();
}
})
.catch(() => { });
} else {
setIndex(0)
}
}, [index])

return {
handleBack: backHandler,
index: index,
setIndex: setIndex
}

};

export { useBackHandler }
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import React from "react";

const isBlueMac = (mac) => mac.match(/([0-9a-fA-F]{2}[:]){5}([0-9a-fA-F]{2})/)


export default () => {
const useBluetoothConfig = () => {
const [config, setConfig] = React.useState([]);

React.useEffect(() => {
Expand All @@ -20,3 +17,5 @@ export default () => {

return config;
};

export { useBluetoothConfig }
6 changes: 3 additions & 3 deletions system/usr/share/mmrl/config/mmrl_wpd/hooks/useConfigStore.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import React from "react";

export default () => {
const useConfigStore = () => {
const [store, setStore] = React.useState(null);

React.useEffect(() => {
Expand All @@ -18,3 +16,5 @@ export default () => {

return store;
};

export { useConfigStore }
8 changes: 4 additions & 4 deletions system/usr/share/mmrl/config/mmrl_wpd/hooks/useNetworks.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import React from "react";
import { useConfigStore } from "./hooks/useConfigStore.js";

const useConfigStore = include("hooks/useConfigStore.js")

export default () => {
const useNetworks = () => {
const [networks, setNetworks] = React.useState(null);
const config = useConfigStore();

Expand Down Expand Up @@ -38,3 +36,5 @@ export default () => {

return networks;
};

export { useNetworks }
29 changes: 17 additions & 12 deletions system/usr/share/mmrl/config/mmrl_wpd/index.jsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
import { withRequireNewVersion } from "@mmrl/hoc";
import { Page, Tabbar } from "@mmrl/ui";
import React from "react";
import { Page, Tabbar, Toolbar } from "@mmrl/ui";

const BluetoothTab = include("tabs/BluetoothTab.jsx");
const WLANTab = include("tabs/WLANTab.jsx");
const RenderToolbar = include("components/RenderToolbar.jsx");
const useBackHandler = include("hooks/useBackHandler.js")
import { BluetoothTab } from "./tabs/BluetoothTab";
import { WLANTab } from "./tabs/WLANTab";
import { useBackHandler } from "./hooks/useBackHandler";

import { useActivity } from "@mmrl/hooks";

function App() {
const handleBack = useBackHandler()
const [index, setIndex] = React.useState(0);
const { handleBack, index, setIndex } = useBackHandler()

const renderTabs = () => {
return [
Expand All @@ -21,12 +19,19 @@ function App() {
{
content: <BluetoothTab />,
tab: <Tabbar.Tab label="Bluetooth" />,
},
}
];
};

return (
<Page onDeviceBackButton={handleBack} renderToolbar={RenderToolbar} modifier="noshadow">
<Page onDeviceBackButton={handleBack} renderToolbar={() => (
<Toolbar modifier="noshadow">
<Toolbar.Left>
<Toolbar.BackButton onClick={handleBack} />
</Toolbar.Left>
<Toolbar.Center>WiFi Password Viewer</Toolbar.Center>
</Toolbar>
)} modifier="noshadow" >
<Tabbar
modifier="noshadow"
position="top"
Expand All @@ -38,11 +43,11 @@ function App() {
}}
renderTabs={renderTabs}
/>
</Page>
</Page >
);
}

export default withRequireNewVersion({
versionCode: 21510,
versionCode: 21918,
component: App,
});
9 changes: 4 additions & 5 deletions system/usr/share/mmrl/config/mmrl_wpd/tabs/BluetoothTab.jsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { useNativeStorage } from "@mmrl/hooks";
import { CodeBlock, Page } from "@mmrl/ui";
import { Divider, List, ListItem, ListItemText, ListSubheader, Switch, Typography } from "@mui/material";
import React from "react";

const CenterBox = include("components/CenterBox.jsx");
const useBluetoothConfig = include("hooks/useBluetoothConfig.js")
import { CenterBox } from "./components/CenterBox";
import { useBluetoothConfig } from "./hooks/useBluetoothConfig";


function BluetoothTab() {
Expand All @@ -30,7 +29,6 @@ function BluetoothTab() {
<Divider />
<List subheader={<ListSubheader>Devices</ListSubheader>}>
{devices.map((device, index, arr) => {
// const stats = Object.entries(device).flatMap((d) => `${d[0]}: ${d[1]}`).join("\n")
const stats = JSON.stringify(device, null, 2)
return (<>
<ListItem>
Expand All @@ -50,9 +48,10 @@ function BluetoothTab() {
{index + 1 !== arr.length && <Divider variant="middle" />}
</>)
})}

</List>
</Page>
);
}

export default BluetoothTab
export { BluetoothTab }
9 changes: 3 additions & 6 deletions system/usr/share/mmrl/config/mmrl_wpd/tabs/WLANTab.jsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
import { useNativeStorage } from "@mmrl/hooks";
import { CodeBlock, Page } from "@mmrl/ui";
import { Divider, List, ListItem, ListItemText, ListSubheader, Switch, Typography } from "@mui/material";
import React from "react";

const RenderToolbar = include("components/RenderToolbar.jsx");
const CenterBox = include("components/CenterBox.jsx");

const useNetworks = include("hooks/useNetworks.js");
import { CenterBox } from "./components/CenterBox";
import { useNetworks } from "./hooks/useNetworks";


function WLANTab() {
Expand Down Expand Up @@ -53,4 +50,4 @@ function WLANTab() {
);
}

export default WLANTab
export { WLANTab }

0 comments on commit 16a7ed5

Please sign in to comment.