FORUMS
Remove All Ads from XDA

[TUTORIAL]Xposed module devlopment

1,658 posts
Thanks Meter: 2,002
 
Post Reply Email Thread
17th April 2014, 04:05 PM |#31  
hamzahrmalik's Avatar
OP Senior Member
Thanks Meter: 2,002
 
Donate to Me
More
Quote:
Originally Posted by a.vandelay

how did you know to use "com.android.systemui" here and not "com.android" or "com.android.systemui.statusbar", etc.?

com.android.systemui is the package name for SystemUI.apk
Not sure what will happen if you use com.android.systemui.statusbar might work, never tried
 
 
17th April 2014, 06:06 PM |#32  
CNexus's Avatar
Senior Member
Flag ~/android
Thanks Meter: 14,045
 
Donate to Me
More
Quote:
Originally Posted by a.vandelay

how did you know to use "com.android.systemui" here and not "com.android" or "com.android.systemui.statusbar", etc.?

You can check the AndroidManifest.xml of an app to get it's package name

If you use anything but com.android.systemui, it won't catch it when the system loads that package (aka the SystemUI app)
The Following 2 Users Say Thank You to CNexus For This Useful Post: [ View ] Gift CNexus Ad-Free
18th April 2014, 08:57 PM |#33  
neXus PRIME's Avatar
Senior Member
Flag Lahore, Pakistan
Thanks Meter: 4,469
 
More
i want to be ROM specific.
i have modified the res/layout/status_bar.xml
i have copied it in xposed project structure under res/layout.

It belongs to com.android.systemui.... and i want it to use my xml on runtime.

Can i simply replace it using initpackageresources and initzygote like we did for dimens??? its an xml file so im not sure.

Just let me know the function to achieve this. Thanks in advance
19th April 2014, 10:07 AM |#34  
hamzahrmalik's Avatar
OP Senior Member
Thanks Meter: 2,002
 
Donate to Me
More
Quote:
Originally Posted by neXus PRIME

i want to be ROM specific.
i have modified the res/layout/status_bar.xml
i have copied it in xposed project structure under res/layout.

It belongs to com.android.systemui.... and i want it to use my xml on runtime.

Can i simply replace it using initpackageresources and initzygote like we did for dimens??? its an xml file so im not sure.

Just let me know the function to achieve this. Thanks in advance

If you want to be ROM specific, make a flash able zip. If you really want to use Xposed wait until tutorial 8 (later today) which covers modifying layouts


Sent from my iPod touch using Tapatalk
19th April 2014, 04:49 PM |#35  
neXus PRIME's Avatar
Senior Member
Flag Lahore, Pakistan
Thanks Meter: 4,469
 
More
Quote:
Originally Posted by hamzahrmalik

If you want to be ROM specific, make a flash able zip. If you really want to use Xposed wait until tutorial 8 (later today) which covers modifying layouts


Sent from my iPod touch using Tapatalk

I want to be able to toggle it... and in case something goes wrong, easily recover.... and that needs xposed framework. Systemui crashing is a pain if it goes wrong.

ANyways, i have done the hard part and resolved all the ids/styles etc etc but in the end, there was some clash between replacement of systemui layout and at the same time changing dimens in android framework.
It wasnt accepting the dimens change witht he layout change of systemui.

I separated the code into two modules. one for layout and one for dimens. THey seem to work on their own, but not together.

One of them changes dimens correctly... other changes the layout correctly. When both modules run together,,, only layout module works.


Maybe my understanding of Zygote/Xposed/Java is flawed at some level.... hopefully ur new tutorial will help me clear my doubts.

Thanks
19th April 2014, 04:52 PM |#36  
hamzahrmalik's Avatar
OP Senior Member
Thanks Meter: 2,002
 
Donate to Me
More
Quote:
Originally Posted by neXus PRIME

I want to be able to toggle it... and in case something goes wrong, easily recover.... and that needs xposed framework. Systemui crashing is a pain if it goes wrong.

ANyways, i have done the hard part and resolved all the ids/styles etc etc but in the end, there was some clash between replacement of systemui layout and at the same time changing dimens in android framework.
It wasnt accepting the dimens change witht he layout change of systemui.

I separated the code into two modules. one for layout and one for dimens. THey seem to work on their own, but not together.

One of them changes dimens correctly... other changes the layout correctly. When both modules run together,,, only layout module works.


Maybe my understanding of Zygote/Xposed/Java is flawed at some level.... hopefully ur new tutorial will help me clear my doubts.

Thanks

If they work separately but not together then combine all code into ome module that should work

Sent from my GP-KEON using Tapatalk
19th April 2014, 08:59 PM |#37  
neXus PRIME's Avatar
Senior Member
Flag Lahore, Pakistan
Thanks Meter: 4,469
 
More
Even when code combined. It doesnt work. only layout works...
Please have a look at below:
Quote:

public class Meizuclock implements IXposedHookZygoteInit, IXposedHookInitPackageResources {
public static String MODULE_PATH = null;

@Override
public void initZygote(StartupParam startupParam) throws Throwable {
// TODO Auto-generated method stub
MODULE_PATH = startupParam.modulePath;
XResources.setSystemWideReplacement("android", "bool", "config_unplugTurnsOnScreen", false);
XResources.setSystemWideReplacement("android", "bool", "config_allowAllRotations", true);


XModuleResources modRes = XModuleResources.createInstance(MODULE_PATH, null);
XResources.setSystemWideReplacement("android", "dimen", "navigation_bar_height", modRes.fwd(R.dimen.navbarh));
XResources.setSystemWideReplacement("android", "dimen", "navigation_bar_height_landscape", modRes.fwd(R.dimen.navbarhl));
XResources.setSystemWideReplacement("android", "dimen", "navigation_bar_width", modRes.fwd(R.dimen.navbarw));

}
@Override
public void handleInitPackageResources(InitPackageResourcesPar am resparam) throws Throwable {
if (!resparam.packageName.equals("com.android.systemu i"))
return;

XModuleResources modRes = XModuleResources.createInstance(MODULE_PATH, resparam.res);

resparam.res.setReplacement("com.android.systemui" , "layout", "status_bar", modRes.fwd(R.layout.status_bar))
;
}



}



---------- Post added at 11:59 PM ---------- Previous post was at 11:57 PM ----------

RED doesnt work
BLUE works

Single module. Separate modules. Both times, the red part doest seem to work....

However.... when ONLY the red part module is ALONE activated... it works.,
20th April 2014, 03:55 PM |#38  
hamzahrmalik's Avatar
OP Senior Member
Thanks Meter: 2,002
 
Donate to Me
More
Quote:
Originally Posted by neXus PRIME

Even when code combined. It doesnt work. only layout works...
Please have a look at below:


---------- Post added at 11:59 PM ---------- Previous post was at 11:57 PM ----------

RED doesnt work
BLUE works

Single module. Separate modules. Both times, the red part doest seem to work....

However.... when ONLY the red part module is ALONE activated... it works.,

Check the updated tutorial 6. Sorry it was my fault i made a mistake. Use this code

Code:
public class Meizuclock implements IXposedHookZygoteInit, IXposedHookInitPackageResources {
public static String MODULE_PATH = null;

@Override
public void initZygote(StartupParam startupParam) throws Throwable {
// TODO Auto-generated method stub
MODULE_PATH = startupParam.modulePath;
XResources.setSystemWideReplacement("android", "bool", "config_unplugTurnsOnScreen", false);
XResources.setSystemWideReplacement("android", "bool", "config_allowAllRotations", true);

XModuleResources modRes = XModuleResources.createInstance(MODULE_PATH, null);

}
@Override
public void handleInitPackageResources(InitPackageResourcesPar am resparam) throws Throwable {
if (!resparam.packageName.equals("com.android.systemu i"))
return;

XModuleResources modRes = XModuleResources.createInstance(MODULE_PATH, resparam.res);

resparam.res.setReplacement("com.android.systemui" , "layout", "status_bar", modRes.fwd(R.layout.status_bar));

resparam.res.setReplacement("android", "dimen", "navigation_bar_height", modRes.fwd(R.dimen.navbarh));
resparam.res.setReplacement("android", "dimen", "navigation_bar_height_landscape", modRes.fwd(R.dimen.navbarhl));
resparam.res.setReplacement("android", "dimen", "navigation_bar_width", modRes.fwd(R.dimen.navbarw));
}



}
The Following 2 Users Say Thank You to hamzahrmalik For This Useful Post: [ View ] Gift hamzahrmalik Ad-Free
23rd April 2014, 05:35 AM |#39  
neXus PRIME's Avatar
Senior Member
Flag Lahore, Pakistan
Thanks Meter: 4,469
 
More
Got it... Ill try again tonight. Thanks.
28th April 2014, 06:50 PM |#40  
neXus PRIME's Avatar
Senior Member
Flag Lahore, Pakistan
Thanks Meter: 4,469
 
More
MODE_WORLD_READABLE is deprecated in 4.3 and 4.4 API.
How else can i share data between activities? I have done the main activity and the xposed module activity. Shared preferences are working for the launcher activity. Now i just need to pass the data to the xposed java class. Any help appreciated.

Regards
Yasir
The Following User Says Thank You to neXus PRIME For This Useful Post: [ View ] Gift neXus PRIME Ad-Free
29th April 2014, 04:26 AM |#41  
bkertz's Avatar
Member
Flag St. Louis
Thanks Meter: 8
 
More
Quote:
Originally Posted by neXus PRIME

MODE_WORLD_READABLE is deprecated in 4.3 and 4.4 API.
How else can i share data between activities? I have done the main activity and the xposed module activity. Shared preferences are working for the launcher activity. Now i just need to pass the data to the xposed java class. Any help appreciated.

Regards
Yasir

I second this. I am in the same spot and wondering the best way to handle this.

Sent from my LG-LS980 using Tapatalk
Post Reply Subscribe to Thread

Tags
beginner, development, mod, tutorial, xposed

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes