Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.9.5 #48

Merged
merged 53 commits into from
Nov 11, 2023
Merged

1.9.5 #48

merged 53 commits into from
Nov 11, 2023

Conversation

DerGoogler
Copy link
Member

@DerGoogler DerGoogler commented Oct 26, 2023

Breaking changes

Due to the nativeProperties system change you'll require a new way to gather properties.
Use the following snippet to get your props

function getconf {
  /system/bin/getprop "$1" "$2" | sed 's/^"\(.*\)"$/\1/'
}

Main

  • Design improvements

  • Screenshots are now bigger

  • Screenshots can now viewed in full screen

  • Added support for verified modules

  • Added support for modules to use their update.json

  • The module language are now displayed in the About tab

  • Modules display now their require of other modules

  • Low quality modules are now more hovered

  • Added many new categories
    • Magisk
    • KernelSU
    • Zygisk
    • LSPosed
    • Xposed
    • Performance Optimization
    • Battery Life
    • Customization
    • Audio Enhancements
    • Security
    • Camera Enhancements
    • SystemUI Mods
    • Tweaks and Hacks
    • Modifications for Root Apps
    • System Fonts and Emojis
    • Miscellaneous
    • ROM-Specific Modules
    • Gamepad and Controller Support
    • App Additions and Features
    • Adblocking and Hosts Files
    • Navigation Bar and Gesture Customization
    • Advanced Audio Mods
    • Custom Kernels
    • Boot Animation
    • Privacy Enhancements
  • The verified and hidden system are back

  • Updated strings

  • File choosing has been fixed

  • Couldn't exit Terminal has been fixed

  • Added two new filter

  • Some filter may not available in certain pages

Configure

  • Cleaned up the source code
  • useActivity can now imported or required from @mmrl/hooks
  • SuFile is now available import { read, write } from "@mmrl/sufile"
    • SuFile has also support for browsers
  • Some other removal of unused things

New APIs

Small list about upcoming Configure API changes

Read files and import files

import React from "react";
import { Markdown, Page, Tabbar } from "@mmrl/ui";
import { useNativeProperties, useNativeStorage } from "@mmrl/hooks";
import { read, write } from "@mmrl/sufile";

null, write(confpath("comp.jsx"), \\\`import React from "react";
import { Page } from "@mmrl/ui"

function MyConfig() {
  return (
    <Page>
      My first config
    </Page>
  )
}

export default  MyConfig\\\`)

// This will be imported from "/data/adb/modules/<MODID>/system/usr/share/mmrl/config/<MODID>/comp.jsx"
import Comp from "!conf/comp.jsx"

function ToolsConfig() {
  return (
    <Page>
      <Comp />
    </Page>
  );
}

export default ToolsConfig

Paths

declare const modpath = (path: string) => "/data/adb/modules/<MODID>/"
declare const confpath = (path: string) => "/data/adb/modules/<MODID>/system/usr/share/mmrl/config/<MODID>/"

Create activitys

import React from "react";
import { Page, Toolbar } from "@mmrl/ui";
import { Button, ListItem, ListItemIcon } from '@mui/material';
import { CloudUpload, Folder } from '@mui/icons-material';
import { useActivity } from "@mmrl/hooks";

function PickerActivity() {
  const { context, extra } = useActivity();

  const renderToolbar = () => {
    return (
      <Toolbar modifier="noshadow">
        <Toolbar.Left>
          <Toolbar.BackButton onClick={context.popPage} />
        </Toolbar.Left>
        <Toolbar.Center>{extra.title}</Toolbar.Center>
      </Toolbar>
    );
  };

  return (
    <Page renderToolbar={renderToolbar}>
      <List>
        {Array.from(Array(10).keys()).map((k) => (
          <ListItem>
            <ListItemIcon>
              <Folder />
            </ListItemIcon>
            <ListItemText primary={\\\`File ${k}\\\`} />
          </ListItem>
        ))}
      </List>
    </Page>
  )
}

function ActivityExample() {
  const { context } = useActivity();

  const handleOpenFilePicker = () => {
    context.pushPage({
      component: PickerActivity,
      // Activitys should have a unique key, otherwise React would cry 
      key: "YouShouldDefineAKey",
      // You also can put extras into the activity
      extra: {
        title: "Pick a file"
      }
    })
  }

  return (
    <Page>
      <Button variant="contained" startIcon={<CloudUpload />} onClick={handleOpenFilePicker}>
        Upload file
      </Button>
    </Page>
  )
}

export default ActivityExample;

Access properties for module settings

ListItemDialogEditText is default imported.

import React from "react";
import { Page } from "@mmrl/ui";
import { useNativeProperties } from "@mmrl/hooks";

function GeneralTab(props) {
  const [curl, setCurl] = useNativeProperties("persist.mmrlini.curl", "/system/usr/share/mmrl/bin/curl");
 
  return (
    <Page sx={{ p: 0 }}>
      <List subheader={<ListSubheader>Settings</ListSubheader>}>
        <ListItemDialogEditText
          onSuccess={(val) => {
            if (val) setCurl(val);
          }}
          inputLabel="Path"
          type="text"
          title="Change curl bin path"
          initialValue={curl}
        >
          <ListItemText primary="Change curl bin path" secondary={curl} />
        </ListItemDialogEditText>
      </List>
    </Page>
  );
}

export default GeneralTab

Make locales

import React from "react";
import { Page } from "@mmrl/ui";
import { StringsProvider } from "@mmrl/providers";
import { useStrings } from "@mmrl/hooks";

const strs = {
  en: {
    hello: "Hello"
  },
  de: {
    hello: "Hallo"
  }
}


const Config = () => {
  const { strings } = useStrings();
  return (
    <Page>{strings("hello")}</Page>
  )
}

const Main = () => {
  return (
    <StringsProvider data={strs}>
      <Config />
    </StringsProvider>
  )
}

export default Main

@DerGoogler DerGoogler added android This label targets specifically MMRL on Android devices browser This label targets specifically MMRL on Browsers labels Oct 26, 2023
@DerGoogler DerGoogler changed the title Update 1.9.5 Oct 31, 2023
@DerGoogler DerGoogler marked this pull request as ready for review November 11, 2023 15:37
@DerGoogler DerGoogler merged commit 57dd47e into master Nov 11, 2023
@DerGoogler DerGoogler deleted the update branch November 11, 2023 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
android This label targets specifically MMRL on Android devices browser This label targets specifically MMRL on Browsers
Projects
None yet
1 participant