Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Thread Closed

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

OP rovo89

16th April 2013, 06:03 AM   |  #1001  
ddmitcyber's Avatar
Junior Member
Thanks Meter: 1
 
6 posts
Join Date:Joined: Feb 2013
Quote:

@Override
public void initZygote(IXposedHookZygoteInit.StartupParam startupParam) throws Throwable {
XResources.setSystemWideReplacement("android", "drawable", "clock_dial",(R.drawable.new_clock));
}

this not work for me

thanks for reply
Last edited by ddmitcyber; 16th April 2013 at 06:08 AM.
16th April 2013, 06:11 AM   |  #1002  
rovo89's Avatar
OP Senior Recognized Developer
Thanks Meter: 15,362
 
2,386 posts
Join Date:Joined: Jan 2012
More
You are trying to replace a drawable wih an integer? That can't work, neither for framework-res nor for SystemUI.

You can either use "new XResources.DrawableLoader { ... }" or the XModuleResources/modRes.fwd approach (as mentioned in the Github wiki page). If you bundle the new image with your module, the second option is probably better/easier.
The Following User Says Thank You to rovo89 For This Useful Post: [ View ]
16th April 2013, 06:29 AM   |  #1003  
ddmitcyber's Avatar
Junior Member
Thanks Meter: 1
 
6 posts
Join Date:Joined: Feb 2013
please example code setReplacement for change icon in framework-res.apk or settings.apk

I promise not to ask this stupid question again
The Following User Says Thank You to ddmitcyber For This Useful Post: [ View ]
16th April 2013, 03:23 PM   |  #1004  
Tungstwenty's Avatar
Recognized Contributor
Thanks Meter: 4,408
 
1,824 posts
Join Date:Joined: Nov 2011
Donate to Me
More
Quote:
Originally Posted by ddmitcyber

please example code setReplacement for change icon in framework-res.apk or settings.apk

If you want to change resources in the framework instead of a specific package, you need to do it in initZygote instead of handleInitPackageResources.

Here's an example that I'm using, to replace a dimension resource in the framework. You can do the same to fwd a drawable to a resource bundled in your module.
Code:
	public void initZygote(StartupParam startupParam) throws Throwable {
		prefs = new XSharedPreferences(MY_PACKAGE_NAME);
		modulePath = startupParam.modulePath;
		if (prefs.getBoolean("status_bar_180dpi", false)) {
			XModuleResources modRes = XModuleResources.createInstance(modulePath, null);
			XResources.setSystemWideReplacement("android", "dimen", "status_bar_height", modRes.fwd(R.dimen.status_bar_height));
			XResources.setSystemWideReplacement("android", "dimen", "status_bar_icon_size", modRes.fwd(R.dimen.status_bar_icon_size));
		}
	}
The Following 2 Users Say Thank You to Tungstwenty For This Useful Post: [ View ]
16th April 2013, 04:34 PM   |  #1005  
mtktauseef's Avatar
Member
Flag Kanpur
Thanks Meter: 100
 
32 posts
Join Date:Joined: Nov 2012
Donate to Me
More
Thats A good App
Can I change My 2.3 Style ????
16th April 2013, 06:21 PM   |  #1006  
rovo89's Avatar
OP Senior Recognized Developer
Thanks Meter: 15,362
 
2,386 posts
Join Date:Joined: Jan 2012
More
Quote:
Originally Posted by mtktauseef

Can I change My 2.3 Style ????

I don't understand the question. But if "2.3" refers to Android version 2.3 (Gingerbread), then this won't work for you. It requires 4.0 (ICS) or later (see FAQ in second post).
The Following User Says Thank You to rovo89 For This Useful Post: [ View ]
17th April 2013, 09:34 AM   |  #1007  
Member
Thanks Meter: 11
 
94 posts
Join Date:Joined: Aug 2011
The disabler works only for clockworkmod? What if I got TWRP recovery?
17th April 2013, 10:32 AM   |  #1008  
m1l4droid's Avatar
Senior Member
Flag Tehran
Thanks Meter: 1,054
 
10,561 posts
Join Date:Joined: Sep 2010
More
Quote:
Originally Posted by apex88

The disabler works only for clockworkmod? What if I got TWRP recovery?

Doesn't matter.

Sent from my GT-I9300 using Tapatalk 2
17th April 2013, 02:00 PM   |  #1009  
paulobrien's Avatar
Senior Member
Flag Norwich
Thanks Meter: 5,685
 
4,437 posts
Join Date:Joined: Nov 2003
A follow up to the issue I was having with /mnt/asec installation.

I've actually worked around it by getting the module itself to check the app's sourceDir (via pm.getApplicationInfo) and if it's /mnt/asec, then to pop up an alert to the user followed by initiating an installation of the module's own APK which i'm bundling in the module itself.

Not ideal arguably, but it works pretty smoothly from a user perspective.

P
The Following 2 Users Say Thank You to paulobrien For This Useful Post: [ View ]
17th April 2013, 07:36 PM   |  #1010  
rovo89's Avatar
OP Senior Recognized Developer
Thanks Meter: 15,362
 
2,386 posts
Join Date:Joined: Jan 2012
More
Ok, so it's basically the same APK that you are delivering inside itself? Probably with a different package name as it has to be unique? Or is the app basically the installer for your module, maybe with some additional options?

Thread Closed Subscribe to Thread

Tags
don't ask questions about modules here!!!, framework, xposed
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes