Skip to content

Commit

Permalink
Android version broken
Browse files Browse the repository at this point in the history
  • Loading branch information
Der_Googler committed Jun 11, 2022
1 parent dc2b61a commit 090ef78
Show file tree
Hide file tree
Showing 13 changed files with 66 additions and 64 deletions.
4 changes: 2 additions & 2 deletions Android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ apply plugin: 'com.android.application'
apply plugin: 'com.github.node-gradle.node'

android {
compileSdk 33
compileSdk 32

defaultConfig {
applicationId 'com.dergoogler.mmrl'
minSdk 26
targetSdk 33
targetSdk 32
versionName "1.4.0@alpha-3"
versionCode "140".toInteger()
}
Expand Down
5 changes: 3 additions & 2 deletions Android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

<application
android:allowBackup="false"
android:allowBackup="true"
android:hardwareAccelerated="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme"
tools:ignore="GoogleAppIndexingWarning">
tools:ignore="GoogleAppIndexingWarning"
tools:targetApi="33">
<activity
android:name="com.dergoogler.mmrl.MainActivity"
android:configChanges="orientation|screenSize"
Expand Down
10 changes: 0 additions & 10 deletions Android/app/src/main/java/com/dergoogler/component/ModuleView.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,11 @@
import android.webkit.WebView;
import android.widget.Toast;

import androidx.annotation.Keep;

import com.dergoogler.core.BuildConfigNative;
import com.dergoogler.core.BuildNative;
import com.dergoogler.core.FileSystemNative;
import com.dergoogler.core.OSNative;
import com.dergoogler.core.SharedPreferencesNative;
import com.dergoogler.core.ShellNative;

import java.io.IOException;
import java.io.InputStream;
import java.io.StringReader;
import java.util.Map;

@Keep
public class ModuleView extends WebView {
private final WebSettings webSettings;
private final Context ctx;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,7 @@ public Object VERSION() {
class retn {
@JavascriptInterface
public String SECURITY_PATCH() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
return Build.VERSION.SECURITY_PATCH;
} else {
return "Unsupported";
}
return VERSION.SECURITY_PATCH;
}

@JavascriptInterface
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ public void requestStoargePermission() {
((Activity) this.ctx).requestPermissions(new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, 1000);
}
}
// Others

@JavascriptInterface
public void open(String link) {
Expand Down
36 changes: 14 additions & 22 deletions Android/app/src/main/java/com/dergoogler/mmrl/Page.java
Original file line number Diff line number Diff line change
@@ -1,19 +1,13 @@
package com.dergoogler.mmrl;

import android.content.Context;
import android.util.Log;

import com.dergoogler.component.ModuleView;
import com.dergoogler.core.FileSystemNative;

import java.io.InputStream;

public class Page {
private final FileSystemNative fs;
private final Context ctx;

public Page(Context ctx) {
this.ctx = ctx;
this.fs = new FileSystemNative(ctx);
}

Expand All @@ -27,21 +21,19 @@ private String loadCss() {
}

public String load() {
StringBuilder sb = new StringBuilder();
sb.append("<!DOCTYPE html>");
sb.append("<html>");
sb.append("<head>");
sb.append("<link rel=\"stylesheet\" type=\"text/css\" href=\"bundle/vendor.bundle.css\"/>");
sb.append("<link rel=\"stylesheet\" type=\"text/css\" href=\"bundle/app.bundle.css\"/>");
sb.append("<meta charset=\"utf-8\" />");
sb.append("</head>");
sb.append("<body>");
sb.append("<app></app>");
sb.append("<script src=\"bundle/vendor.bundle.js\"></script>");
sb.append("<script src=\"bundle/app.bundle.js\"></script>");
sb.append("<script>const styles = `").append(this.loadCss()).append("`;const styleSheet = document.createElement(\"style\");styleSheet.innerText = styles; document.head.appendChild(styleSheet)</script>");
sb.append("</body>");
sb.append("</html>");
return sb.toString();
return "<!DOCTYPE html>" +
"<html>" +
"<head>" +
"<link rel=\"stylesheet\" type=\"text/css\" href=\"bundle/vendor.bundle.css\"/>" +
"<link rel=\"stylesheet\" type=\"text/css\" href=\"bundle/app.bundle.css\"/>" +
"<meta charset=\"utf-8\" />" +
"</head>" +
"<body>" +
"<app></app>" +
"<script src=\"bundle/vendor.bundle.js\"></script>" +
"<script src=\"bundle/app.bundle.js\"></script>" +
"<script>const styles = `" + this.loadCss() + "`;const styleSheet = document.createElement(\"style\");styleSheet.innerText = styles; document.head.appendChild(styleSheet)</script>" +
"</body>" +
"</html>";
}
}
36 changes: 36 additions & 0 deletions Android/app/src/main/res/xml/data_extraction_rules.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Sample data extraction rules file; uncomment and customize as necessary.
See https://developer.android.com/about/versions/12/backup-restore#xml-changes
for details.
-->
<data-extraction-rules>
<cloud-backup>
<!--
TODO: Use <include> and <exclude> to control what is backed up.
The domain can be file, database, sharedpref, external or root.
Examples:
<include domain="file" path="file_to_include"/>
<exclude domain="file" path="file_to_exclude"/>
<include domain="file" path="include_folder"/>
<exclude domain="file" path="include_folder/file_to_exclude"/>
<exclude domain="file" path="exclude_folder"/>
<include domain="file" path="exclude_folder/file_to_include"/>
<include domain="sharedpref" path="include_shared_pref1.xml"/>
<include domain="database" path="db_name/file_to_include"/>
<exclude domain="database" path="db_name/include_folder/file_to_exclude"/>
<include domain="external" path="file_to_include"/>
<exclude domain="external" path="file_to_exclude"/>
<include domain="root" path="file_to_include"/>
<exclude domain="root" path="file_to_exclude"/>
-->
</cloud-backup>
<!--
<device-transfer>
<include .../>
<exclude .../>
</device-transfer>
-->
</data-extraction-rules>
5 changes: 0 additions & 5 deletions Android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,3 @@ allprojects {
google()
}
}

task makedev(type:Exec) {
workingDir './../Website'
commandLine 'make dev'
}
6 changes: 3 additions & 3 deletions Android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Tue Oct 13 08:15:32 CEST 2020
#Sat Jun 11 19:47:22 CEST 2022
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip
zipStoreBase=GRADLE_USER_HOME
2 changes: 1 addition & 1 deletion Website/src/activitys/MainApplication.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class MainApplication extends AppCompatActivity<Props> {
<div
className="center"
onClick={() => {
ons.notification.toast("My gf left me ... :(");
ons.notification.toast("My gf left me ... :(", { timeout: 1000, animation: "fall" });
}}
>
Magisk Module Repo Loader
Expand Down
14 changes: 3 additions & 11 deletions Website/src/activitys/fragments/ExploreModuleFragment.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import { Component, LegacyRef } from "react";
import { Button, Page, SearchInput, ProgressCircular } from "react-onsenui";
import { Button, SearchInput, ProgressCircular } from "react-onsenui";
import axios from "axios";
import { toast } from "react-toastify";
import ExploreModule from "@Components/ExploreModule";
import SharedPreferences from "@Native/SharedPreferences";
import { PushProps } from "@Activitys/MainActivity";
import { SearchRounded } from "@mui/icons-material";
import { os } from "@Native/os";
import ons from "onsenui";

interface Props {
pushPage(...arg: any): PushProps;
Expand Down Expand Up @@ -39,15 +40,7 @@ class ExploreModuleFragment extends Component<Props, States> {
public componentDidMount = () => {
const moduels = os.getSchemeParam("module");
if (moduels != (null || undefined || "")) {
toast.info("Please wait 2 seconds after the loading screen is gone", {
position: "top-center",
autoClose: 1500,
hideProgressBar: true,
closeOnClick: true,
pauseOnHover: true,
draggable: true,
progress: undefined,
});
ons.notification.toast("Please wait 2 seconds after the loading screen is gone", { timeout: 2000, animation: "fall" });
}

setTimeout(() => {
Expand Down Expand Up @@ -128,7 +121,6 @@ class ExploreModuleFragment extends Component<Props, States> {
}}
>
<SearchInput
// @ts-ignore
placeholder={"Search modules"}
ref={this.searchBar}
style={{
Expand Down
4 changes: 2 additions & 2 deletions Website/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ class Bootloader {
os.requestStoargePermission();
}

// Prevent context menu on Android browsers.
if (os.isAndroid || isMobile) window.addEventListener("contextmenu", (e: Event) => e.preventDefault());
// Prevent context menu on browsers.
window.addEventListener("contextmenu", (e: Event) => e.preventDefault());

this.log.i("Selecting platform: Android");
ons.platform.select("android");
Expand Down
1 change: 1 addition & 0 deletions Website/src/typings/declaration.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,7 @@ declare module "react-onsenui" {

export class SearchInput extends Component<
{
placeholder?: string
modifier?: string | undefined;
disabled?: boolean | undefined;
onChange?(e: Event): void;
Expand Down

0 comments on commit 090ef78

Please sign in to comment.