Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
mywalkb committed Jan 16, 2023
2 parents e5093d1 + 5666dca commit 58c76df
Show file tree
Hide file tree
Showing 14 changed files with 42 additions and 311 deletions.
7 changes: 1 addition & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,7 @@ Android 8.1 ~ 13
2. (For Riru flavor) Install [Riru](https://github.com/RikkaApps/Riru/releases) v25+ from Magisk repo
3. [Download](#download) and install LSPosed_mod in Magisk app
4. Reboot
5. Follow the prompt to add LSPosed shortcut to launcher
- Some launchers won't show a prompt but silently add the shortcut
- If the shortcut cannot be added, you can install the manager located at `/data/adb/lspd/manager.apk` manually
- If you accidentally deleted the shortcut, reboot your device or install the manager manually to add the shortcut again
- If you don't need a shortcut, install the manager manually and you can disable future shortcut being added in the settings
- In any case, you can dial `*#*#5776733#*#*` (aka LSPosed) to launch the manager if you have a dialer
5. Open LSPosed manager from notification
6. Have fun :)

## Download
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.core.view.ScrollingView;
import androidx.viewpager2.widget.ViewPager2;
import androidx.recyclerview.widget.RecyclerView;

import rikka.widget.borderview.BorderRecyclerView;

public class ScrollWebView extends WebView {
public ScrollWebView(@NonNull Context context) {
Expand Down Expand Up @@ -61,7 +62,7 @@ public boolean onTouchEvent(MotionEvent event) {

@Override
protected void onOverScrolled(int scrollX, int scrollY, boolean clampedX, boolean clampedY) {
if (clampedX || clampedY) {
if (clampedX) {
var viewParent = findViewParentIfNeeds(this);
if (viewParent != null) viewParent.requestDisallowInterceptTouchEvent(false);
}
Expand All @@ -71,7 +72,7 @@ protected void onOverScrolled(int scrollX, int scrollY, boolean clampedX, boolea
private static ViewParent findViewParentIfNeeds(View v) {
var parent = v.getParent();
if (parent == null) return null;
if (parent instanceof ViewPager2 || parent instanceof ScrollingView) {
if (parent instanceof RecyclerView && !(parent instanceof BorderRecyclerView)) {
return parent;
} else if (parent instanceof View) {
return findViewParentIfNeeds((View) parent);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import java.util.zip.ZipEntry;

import sun.net.www.ParseUtil;
import sun.net.www.protocol.jar.Handler;

final class ClassPathURLStreamHandler extends Handler {
private final String fileUri;
Expand Down Expand Up @@ -41,7 +42,7 @@ protected URLConnection openConnection(URL url) throws IOException {
}

@Override
protected void finalize() throws Throwable {
protected void finalize() throws IOException {
jarFile.close();
}

Expand Down
192 changes: 0 additions & 192 deletions core/src/main/java/org/lsposed/lspd/util/Handler.java

This file was deleted.

40 changes: 0 additions & 40 deletions core/src/main/java/org/lsposed/lspd/util/InstallerVerifier.java

This file was deleted.

21 changes: 9 additions & 12 deletions core/src/main/java/org/lsposed/lspd/util/LspModuleClassLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
import java.util.List;
import java.util.Objects;
import java.util.jar.JarFile;
import java.util.stream.Collectors;
import java.util.zip.ZipEntry;

import hidden.ByteBufferDexClassLoader;
import sun.misc.CompoundEnumeration;

@SuppressWarnings("ConstantConditions")
public final class LspModuleClassLoader extends ByteBufferDexClassLoader {
Expand Down Expand Up @@ -135,7 +135,12 @@ public String getLdLibraryPath() {
protected URL findResource(String name) {
try {
var urlHandler = new ClassPathURLStreamHandler(apk);
return urlHandler.getEntryUrlOrNull(name);
var url = urlHandler.getEntryUrlOrNull(name);
if (url == null) {
// noinspection FinalizeCalledExplicitly
urlHandler.finalize();
}
return url;
} catch (IOException e) {
return null;
}
Expand Down Expand Up @@ -171,16 +176,8 @@ public Enumeration<URL> getResources(String name) throws IOException {
@NonNull
@Override
public String toString() {
if (apk == null) {
return "LspModuleClassLoader[instantiating]";
}
var nativeLibraryDirsString = nativeLibraryDirs.stream()
.map(File::getPath)
.collect(Collectors.joining(", "));
return "LspModuleClassLoader[" +
"module=" + apk + ", " +
"nativeLibraryDirs=" + nativeLibraryDirsString + ", " +
super.toString() + "]";
if (apk == null) return "LspModuleClassLoader[instantiating]";
return "LspModuleClassLoader[module=" + apk + ", " + super.toString() + "]";
}

public static ClassLoader loadApk(String apk,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ public ManagerGuard guardSnapshot() {

private void ensureWebViewPermission(File f) {
if (!f.exists()) return;
SELinux.setFileContext(f.getAbsolutePath(), "u:object_r:privapp_data_file:s0");
SELinux.setFileContext(f.getAbsolutePath(), "u:object_r:magisk_file:s0");
try {
Os.chown(f.getAbsolutePath(), BuildConfig.MANAGER_INJECTED_UID, BuildConfig.MANAGER_INJECTED_UID);
} catch (ErrnoException e) {
Expand Down
5 changes: 5 additions & 0 deletions hiddenapi/stubs/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,8 @@
plugins {
`java-library`
}

java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

This file was deleted.

Loading

0 comments on commit 58c76df

Please sign in to comment.