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

help #109

Open
chuangdi opened this issue Oct 18, 2024 · 1 comment
Open

help #109

chuangdi opened this issue Oct 18, 2024 · 1 comment

Comments

@chuangdi
Copy link

Can I call the relinker.loadlibrary method from a class? I have an Xposed module, but I can't get the context of the MainActivity. Please help. before this, i use system.loadlibray. no context, I have tried many methods but none of them work.

@chuangdi
Copy link
Author

code:
MainActivity
import android.app.Activity;
import android.content.Context;
import java.lang.reflect.Method;
import android.content.Intent;
import android.os.Bundle;
public class MainActivity extends Activity {
private File mLibDir;
private File mWorkaroundDir;
private EditText version;
@OverRide
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
protected void onResume() {
super.onResume();
mLibDir = new File(getApplicationInfo().nativeLibraryDir);
mWorkaroundDir = getDir("lib", Context.MODE_PRIVATE);
updateTree();
findViewById(R.id.call).setOnClickListener(new View.OnClickListener() {
@OverRide
public void onClick(View v) {
String number = "**"
call(number);
}
});
private void call(String num) {
ReLinker.loadLibrary(MainActivity.this, "phoneloc-jni");
((TextView) findViewById(R.id.tree)).setText(builder.toString());
}
}

other class
public class SmartDialXposed implements IXposedHookLoadPackage {
String result = "";
String location = "";
String wife = "761";
String number = "";
public String compare(String num) {
ReLinker.loader(context, "phoneloc-jni");
// i want loadlibrary in here, need context, how to write code?
}
}

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

1 participant