Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,732,428 Members 47,164 Now Online
XDA Developers Android and Mobile Development Forum

Xposed - Legacy thread. Don't panic, Xposed is still here.

Tip us?
 
HD2Owner
Old
#9901  
HD2Owner's Avatar
Recognized Developer
Thanks Meter 2063
Posts: 2,088
Join Date: Oct 2009
Location: Neuhausen am Rheinfall

 
DONATE TO ME
looking for xposed module devs -> http://forum.xda-developers.com/show....php?t=2691910
 
nostromo76
Old
#9902  
Senior Member
Thanks Meter 22
Posts: 126
Join Date: Aug 2007
Thumbs up It Worked!!!

Quote:
Originally Posted by Vagelis1608 View Post
Go to Xposed Installer -> Settings -> Installation mode and choose recovery. Then go to Xposed Installer -> Framework -> Install/Update and reboot.
Thank you very much!

Have a nice weekend
The Following User Says Thank You to nostromo76 For This Useful Post: [ Click to Expand ]
 
rovo89
Old
#9903  
rovo89's Avatar
Senior Recognized Developer - OP
Thanks Meter 13654
Posts: 2,367
Join Date: Jan 2012
Quote:
Originally Posted by Bob1732 View Post
Sorry to bother again, after a few hours reading and trying i am still in need of a bit of assitance.

OnCreate wasnt working the way i intended so i switched to a loadlibrary hook, i intended to load my library after the last unique library is loaded from the application, i need to obviously add in the param result check to make sure lib is loaded successfully but at the moment i can see through catlog the lib is loaded without a problem.

The lib i am using is just the sample/hello-jni from NDK

Defined as:
jstring Java_com_example_hellojni_HelloJni_stringFromJNI( JNIEnv* env,
jobject thiz )

public native String stringFromJNI(); // should just return a simple string

so com.example.hellojni.HelloJni.stringFromJNI(); is what i wanna call, trying the following i always get a class not found exception.

Code:
try {
	Class<?> exampleclass = XposedHelpers.findClass("com.example.hellojni.HelloJni", (ClassLoader)lpparam.classLoader);

	if (exampleclass != null){
		XposedBridge.log("NativeCALL-Result: " + (String)exampleclass.getMethod("stringFromJNI").invoke(null));
	}

} catch (Exception e) {
	e.printStackTrace();
}
any clue ? i know the library is loaded successfully through cat log.
First of all, have you verified the your library is working fine in a "normal" app? Before that, I wouldn't try to do such calls in an Xposed module.
I believe a difficulty with this are the class loaders. You are looking for the HelloJni class in the app - is it defined in the app? Or your module? If it's in your module, then you should be able to avoid reflection completely, but you need to make sure that the library is loaded for the right classloader. System.loadLibrary() takes that caller's loader, whereas you look for the class in param.classLoader...
Tired of updating your mod for every new ROM release?
You want give users the possibility to combine different mods without creating tons of different files for all possible combinations?
Then have a look at my Xposed framework - modifications without APK changes!
 
Bob1732
Old
(Last edited by Bob1732; 23rd March 2014 at 06:20 PM.)
#9904  
Junior Member
Thanks Meter 1
Posts: 6
Join Date: Mar 2014
Quote:
Originally Posted by rovo89 View Post
First of all, have you verified the your library is working fine in a "normal" app? Before that, I wouldn't try to do such calls in an Xposed module.
I believe a difficulty with this are the class loaders. You are looking for the HelloJni class in the app - is it defined in the app? Or your module? If it's in your module, then you should be able to avoid reflection completely, but you need to make sure that the library is loaded for the right classloader. System.loadLibrary() takes that caller's loader, whereas you look for the class in param.classLoader...
Thanks again for your time.

The package i want to hook is called "com.test.test"

the package com.example.hellojni does not exist, i only have this function defined inside the shared library.. maybe this is a limitation or a misunderstanding from me.

The method and class would never exist inside the package, but the way i understood it was i could system.loadlibrary and that defined class would be added to the program.

Perhaps i need to rename my function to REALPACKAGE.CLASS.METHOD instead of com.example.hellojni, going to try this and keep trying.
 
rovo89
Old
#9905  
rovo89's Avatar
Senior Recognized Developer - OP
Thanks Meter 13654
Posts: 2,367
Join Date: Jan 2012
Quote:
Originally Posted by Bob1732 View Post
The method and class would never exist inside the package, but the way i understood it was i could system.loadlibrary and that defined class would be added to the program.

Perhaps i need to rename my function to REALPACKAGE.CLASS.METHOD instead of com.example.hellojni, going to try this and keep trying.
The Java class containing the native methods definitely needs to be loaded by any classloader, and then you must load the native library for the same classloader. During the initialization, the native library should then connect the C++ functions to the Java stub. Not sure if you need to do this manually for real JNI, at least the system libraries explicitely register their methods.

If com.example.hellojni.HelloJni isn't part of com.test.test, then you have to include it in your module or load it from another jar file. Renaming doesn't change anything about this, you can have two classes with the same name and package and yet they won't be the same unless they are also loaded by the same classloader.
Tired of updating your mod for every new ROM release?
You want give users the possibility to combine different mods without creating tons of different files for all possible combinations?
Then have a look at my Xposed framework - modifications without APK changes!
The Following User Says Thank You to rovo89 For This Useful Post: [ Click to Expand ]
 
MgudFrn
Old
(Last edited by MgudFrn; 23rd March 2014 at 07:01 PM.)
#9906  
MgudFrn's Avatar
Member
Thanks Meter 9
Posts: 69
Join Date: Oct 2013
Location: Kathmandu

 
DONATE TO ME
Quote:
Originally Posted by rovo89 View Post
This is Xposed version 2.5 (final). The main new features and fixes in this version are:
  • Rewritten framework installation/uninstallation
    • Uses interactive su (via libsuperuser) to provide improved compatibility with different Superuser apps
    • Better feedback when root access fails (doesn't freeze the app anymore)
    • Offers installation via custom recovery (CWM/TWRP), either flashing the file automatically or manually
  • Safemode to disable Xposed with hardware keys to get out of (most) bootloops
  • Compatibility with Sony/LG ROMs (4.3 and 4.4), Meizu ROMs (4.4)
  • Debug setting to disable resource hooking as a temporary workaround for incompatibilities with some theming engines (not all modules can be used in this mode)
There are also other improvements and fixes, especially many translations updates.
I'm getting Segmentation Fault in this version. I tried installing using all three methods but there is same problem.
Previous version works fine.

Quote:
Originally Posted by rovo89 View Post
In case you get a message "Segmentation fault" during installation, you can now download an additional app which provides statically compiled versions of BusyBox (a lot bigger, but should work with every ROM). It's not needed otherwise.
Where is that additional app? Please see my attachment for actual error message:

Click image for larger version

Name:	uploadfromtaptalk1395597492356.jpg
Views:	2171
Size:	27.8 KB
ID:	2645989

Sent from my Karbonn A1* using xda app-developers app
The Following User Says Thank You to MgudFrn For This Useful Post: [ Click to Expand ]
 
Bob1732
Old
#9907  
Junior Member
Thanks Meter 1
Posts: 6
Join Date: Mar 2014
Quote:
Originally Posted by rovo89 View Post
The Java class containing the native methods definitely needs to be loaded by any classloader,
There is the problem then, I assumed the loaded library added the method automatically but when I think about it, it can't add the method when the class doesn't exist makes sense now. All a little over my head at the moment, need to learn a lot more about how java works.

For now I will just use jni_onload to set up the hooks but I look forward to being able to learn a more advanced way.

Really many thanks for your time.
 
hamzahrmalik
Old
#9908  
hamzahrmalik's Avatar
Senior Member
Thanks Meter 964
Posts: 762
Join Date: May 2013
Default I need help editing dimens.xml in framework-res.apk using Xposed

I am trying to make a very simple module which will simply replace navigation_bar_height property with a user defined value. At the moment, since the module is in early development, it simply sets it to 20 (no configurable option). The default is 48 on my phone so I think I should be seeing a difference, but I'm not. I'm not sure if it is failing to replace the resource, or if it is replacing but then ignoring the new value. Here is the code

Code:
import android.content.res.XResources;
import de.robv.android.xposed.IXposedHookZygoteInit;
import de.robv.android.xposed.XposedBridge;

public class Main implements IXposedHookZygoteInit{

	@Override
	public void initZygote(IXposedHookZygoteInit.StartupParam startupParam) throws Throwable {
		XposedBridge.log("LOADED");
		try {
			XResources.setSystemWideReplacement("android", "dimen", "navigation_bar_height", 20.0);
		
	} catch (Throwable t) { XposedBridge.log(t); }
	}

}
Any help is appreciated
 
rovo89
Old
#9909  
rovo89's Avatar
Senior Recognized Developer - OP
Thanks Meter 13654
Posts: 2,367
Join Date: Jan 2012
Quote:
Originally Posted by MgudFrn View Post
I'm getting Segmentation Fault in this version. I tried installing using all three methods but there is same problem.
Previous version works fine.

Where is that additional app? Please see my attachment for actual error message:

Attachment 2645989
Here it is. I wanted to know how frequently this error occurs - not too often as it seems.
Just as a reminder: This file is only needed when you get "Segmentation fault" errors.
Attached Files
File Type: apk XposedInstallerStaticBusyBox_v1.apk - [Click for QR Code] (279.3 KB, 20291 views)
Tired of updating your mod for every new ROM release?
You want give users the possibility to combine different mods without creating tons of different files for all possible combinations?
Then have a look at my Xposed framework - modifications without APK changes!
The Following 45 Users Say Thank You to rovo89 For This Useful Post: [ Click to Expand ]
 
rovo89
Old
#9910  
rovo89's Avatar
Senior Recognized Developer - OP
Thanks Meter 13654
Posts: 2,367
Join Date: Jan 2012
Quote:
Originally Posted by hamzahrmalik View Post
I am trying to make a very simple module which will simply replace navigation_bar_height property with a user defined value. At the moment, since the module is in early development, it simply sets it to 20 (no configurable option). The default is 48 on my phone so I think I should be seeing a difference, but I'm not. I'm not sure if it is failing to replace the resource, or if it is replacing but then ignoring the new value.
At the moment, it's not possible to replace dimension resources with variables/literals. You can only forward it to your module's resources: https://github.com/rovo89/XposedBrid...plex-resources
Tired of updating your mod for every new ROM release?
You want give users the possibility to combine different mods without creating tons of different files for all possible combinations?
Then have a look at my Xposed framework - modifications without APK changes!

Tags
don't ask questions about modules here!!!, framework, xposed
THREAD CLOSED
Subscribe
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes