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

不支持安卓13吗 #1153

Open
xxy123456 opened this issue Feb 3, 2023 · 4 comments
Open

不支持安卓13吗 #1153

xxy123456 opened this issue Feb 3, 2023 · 4 comments

Comments

@xxy123456
Copy link

闪退

@taitaking
Copy link

我的也是13也是直接闪退

@badboy-tian
Copy link

 public Object call(Object who, Method method, Object... args) throws Throwable {
            String pkg = (String) args[0];
            int flags = 0;
            try{
                flags = (int) args[1];
            } catch (Throwable e) {
                flags = Integer.parseInt(args[1].toString());
            }

MethodProxies的call里面改成这样就行了 integer can not cast to Long

但是新问题又出来了

W/System.err: java.lang.ExceptionInInitializerError
W/System.err:     at com.lody.virtual.helper.compat.PackageParserCompat.createParser(PackageParserCompat.java:51)
W/System.err:     at com.lody.virtual.server.pm.parser.PackageParserEx.parsePackage(PackageParserEx.java:56)
W/System.err:     at com.lody.virtual.server.pm.VAppManagerService.installPackage(VAppManagerService.java:155)
W/System.err:     at com.lody.virtual.server.pm.VAppManagerService.installPackage(VAppManagerService.java:141)
W/System.err:     at com.lody.virtual.server.IAppManager$Stub.onTransact(IAppManager.java:116)
W/System.err:     at android.os.Binder.execTransactInternal(Binder.java:1285)
W/System.err:     at android.os.Binder.execTransact(Binder.java:1249)
W/System.err: Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Object mirror.RefConstructor.newInstance()' on a null object reference
W/System.err:     at com.lody.virtual.helper.compat.PackageParserCompat.<clinit>(PackageParserCompat.java:47)
W/System.err: 	... 7 more

@cloudslsw
Copy link

我安卓13也是闪退,希望开发者能更新支持下

@alberto-lazari
Copy link

但是新问题又出来了

This is due to the fact that the class android.content.pm.PackageUserState has been removed in Android 13 and later, so it cannot be loaded in lib/src/main/java/mirror/android/content/pm/PackageUserState.java:

package mirror.android.content.pm;

import mirror.RefClass;
import mirror.RefConstructor;

public class PackageUserState {
    public static Class<?> TYPE = RefClass.load(PackageUserState.class, "android.content.pm.PackageUserState");
    public static RefConstructor<Object> ctor;
}

On Android > 12 both TYPE and ctor will be null

Android 13 introduced a similar class android.content.pm.pkg.FrameworkPackageUserStateDefault that could be exploited to get the Contructor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants