Using Map.of here results in compiler optimization generating a class
`a.a` with a method `a` that returns the Map.
The class looks like this (jadx decompilation):
```java
package a;
import java.util.AbstractMap;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
/* loaded from: classes.dex */
public abstract /* synthetic */ class a {
public static /* synthetic */ Map a() {
Map.Entry[] entryArr = {new AbstractMap.SimpleEntry("arm", "armeabi-v7a"), new AbstractMap.SimpleEntry("arm64", "arm64-v8a"), new AbstractMap.SimpleEntry("x86", "x86"), new AbstractMap.SimpleEntry("x86_64", "x86_64")};
HashMap hashMap = new HashMap(4);
for (int i = 0; i < 4; i++) {
Map.Entry entry = entryArr[i];
Object key = entry.getKey();
Objects.requireNonNull(key);
Object value = entry.getValue();
Objects.requireNonNull(value);
if (hashMap.put(key, value) != null) {
throw new IllegalArgumentException("duplicate key: " + key);
}
}
return Collections.unmodifiableMap(hashMap);
}
}
```
For whatever ridiculous reason, on a moto g stylus 5G (2022), when this
method is called in `LSPAppComponentFactoryStub`, the app crashes with
`java.lang.NoSuchMethodError: No static method a()Ljava/util/Map; in
class La/a; or its super classes`. Using a normal HashMap here instead
prevents this optimization from occurring, which prevents the crash.
|
||
|---|---|---|
| .github | ||
| apkzlib | ||
| core@5666dca1e3 | ||
| gradle/wrapper | ||
| jar | ||
| manager | ||
| meta-loader | ||
| patch | ||
| patch-loader | ||
| share | ||
| .gitattributes | ||
| .gitignore | ||
| .gitmodules | ||
| LICENSE | ||
| README.md | ||
| build.gradle.kts | ||
| crowdin.yml | ||
| gradle.properties | ||
| gradlew | ||
| gradlew.bat | ||
| settings.gradle.kts | ||
README.md
LSPatch Framework
Introduction
Rootless implementation of LSPosed framework, integrating Xposed API by inserting dex and so into the target APK.
Supported Versions
- Min: Android 9
- Max: In theory, same with LSPosed
Download
For stable releases, please go to Github Releases page
For canary build, please check Github Actions
Note: debug builds are only available in Github Actions
Usage
- Through jar
- Download
lspatch.jar - Run
java -jar lspatch.jar
- Through manager
- Download and install
manager.apkon an Android device - Follow the instructions of the manager app
Translation Contributing
You can contribute translation here.
Credits
License
LSPatch is licensed under the GNU General Public License v3 (GPL-3) (http://www.gnu.org/copyleft/gpl.html).