Revert "[core] FastNative (#467)" (#469)

Someone report keeping annotation on release build make some java methods call failed.

This reverts commit 65f387f429.
This commit is contained in:
LoveSy 2021-04-08 21:03:22 +08:00 committed by GitHub
parent 80646bfa3c
commit c56c89327b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 1 additions and 39 deletions

View File

@ -20,8 +20,6 @@
# hide the original source file name.
#-renamesourcefileattribute SourceFile
-keepattributes *Annotation*
-keep class de.robv.android.xposed.** {*;}
-keep class android.** { *; }
-keepclassmembers class * implements android.os.Parcelable {

View File

@ -22,12 +22,10 @@ package org.lsposed.lspd.nativebridge;
import java.lang.reflect.Executable;
import dalvik.annotation.optimization.FastNative;
import de.robv.android.xposed.PendingHooks;
public class ClassLinker {
@FastNative
public static native void setEntryPointsToInterpreter(Executable method);
public static void onPostFixupStaticTrampolines(Class<?> clazz) {

View File

@ -31,8 +31,6 @@ import java.util.TimeZone;
import org.lsposed.lspd.util.Utils;
import dalvik.annotation.optimization.FastNative;
public class ModuleLogger {
static SimpleDateFormat logDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.sss", Locale.getDefault());
static int fd = -1;
@ -44,7 +42,6 @@ public class ModuleLogger {
}
}
@FastNative
private static native void nativeLog(int fd, String logStr);
public static void log(String str, boolean isThrowable) {

View File

@ -20,9 +20,6 @@
package org.lsposed.lspd.nativebridge;
import dalvik.annotation.optimization.FastNative;
public class NativeAPI {
@FastNative
public static native void recordNativeEntrypoint(String library_name);
}

View File

@ -22,9 +22,6 @@ package org.lsposed.lspd.nativebridge;
import java.lang.reflect.Method;
import dalvik.annotation.optimization.FastNative;
public class PendingHooks {
@FastNative
public static native void recordPendingMethodNative(Method hookMethod, Class<?> clazz);
public static native void recordPendingMethodNative(Method hookMethod, Class clazz);
}

View File

@ -23,19 +23,13 @@ package org.lsposed.lspd.nativebridge;
import android.content.res.Resources;
import android.content.res.XResources;
import dalvik.annotation.optimization.FastNative;
public class ResourcesHook {
@FastNative
public static native boolean initXResourcesNative();
@FastNative
public static native boolean removeFinalFlagNative(Class<?> clazz);
@FastNative
public static native ClassLoader buildDummyClassLoader(ClassLoader parent, Class<?> resourceSuperClass, Class<?> typedArraySuperClass);
@FastNative
public static native void rewriteXmlReferencesNative(long parserPtr, XResources origRes, Resources repRes);
}

View File

@ -23,26 +23,18 @@ package org.lsposed.lspd.nativebridge;
import java.lang.reflect.Executable;
import java.lang.reflect.Method;
import dalvik.annotation.optimization.FastNative;
public class Yahfa {
@FastNative
public static native boolean backupAndHookNative(Executable target, Method hook, Method backup);
// JNI.ToReflectedMethod() could return either Method or Constructor
@FastNative
public static native Executable findMethodNative(Class<?> targetClass, String methodName, String methodSig);
@FastNative
public static native void init(int sdkVersion);
@FastNative
public static native void recordHooked(Executable member);
@FastNative
public static native boolean isHooked(Executable member);
@FastNative
public static native Class<?> buildHooker(ClassLoader appClassLoader, Class<?> returnType, Class<?>[] params, String methodName);
}

View File

@ -1,11 +0,0 @@
package dalvik.annotation.optimization;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Retention(RetentionPolicy.CLASS)
@Target(ElementType.METHOD)
public @interface FastNative {
}