Skip to content

Commit

Permalink
Repair function is inlined.
Browse files Browse the repository at this point in the history
Android 11 file path repair.
  • Loading branch information
sanfengAndroid committed Mar 1, 2021
1 parent a85ce0c commit 21c8401
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# FakeXposed
![License](https://img.shields.io/badge/License-Apache2-blue)

Chinese document click [here](README_CN.md)
中文文档点击 [这里](README_CN.md)

## 公众号
**关注我的公众号可以第一时间收到我的最新原创技术文章分享**
Expand Down
2 changes: 1 addition & 1 deletion app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@
}

-keep public class com.sanfengandroid.datafilter.ui.fragments.MainFragment{
private boolean isActive();
public static boolean isActive();
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import android.os.AsyncTask;
import android.os.Build;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
Expand Down Expand Up @@ -79,6 +80,9 @@ public static boolean isActive() {
LogUtil.d("Prevent inlining");
LogUtil.d("Prevent inlining");
LogUtil.d("Prevent inlining");
if (TextUtils.equals(XpApplication.getInstance().getString(R.string.set_gid), "123")){
return true;
}
return false;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ public static void initLibraryPath(Context context, int targetSdk) throws Packag

private static String findLibraryPath() throws Exception {
ClassLoader loader = NativeHook.class.getClassLoader();
Object pathList = ReflectUtil.getField(loader.getClass().getSuperclass(), loader, "pathList");
Object pathList = ReflectUtil.getField(Class.forName("dalvik.system.BaseDexClassLoader"), loader, "pathList");
Object[] dexElements = (Object[]) ReflectUtil.getFieldInstance(pathList, "dexElements");
File apkPath = null;
for (Object element : dexElements) {
Expand All @@ -539,6 +539,9 @@ private static String findLibraryPath() throws Exception {
break;
}
}
if (apkPath == null){
return null;
}
File base = new File(apkPath.getParent(), "lib");
File library = null;
if (FileInstaller.isRunning64Bit()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ protected void onCreate(Bundle savedInstanceState) {
setContentView(R.layout.native_test_activity);
if (MainFragment.isActive()) {
findViewById(R.id.tv_plugin).setVisibility(View.GONE);
}else {
findViewById(R.id.btn_local_load).setVisibility(View.VISIBLE);
}
findViewById(R.id.btn_test_maps).setOnClickListener(this);
findViewById(R.id.btn_local_load).setOnClickListener(this);
Expand Down
2 changes: 1 addition & 1 deletion fake-linker

0 comments on commit 21c8401

Please sign in to comment.