Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,804,274 Members 38,584 Now Online
XDA Developers Android and Mobile Development Forum

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

Tip us?
 
ddmitcyber
Old
(Last edited by ddmitcyber; 16th April 2013 at 05:08 AM.)
#1001  
ddmitcyber's Avatar
Junior Member
Thanks Meter 1
Posts: 6
Join Date: 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
 
rovo89
Old
#1002  
rovo89's Avatar
Senior Recognized Developer - OP
Thanks Meter 14,068
Posts: 2,367
Join Date: Jan 2012
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.
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 ]
 
ddmitcyber
Old
#1003  
ddmitcyber's Avatar
Junior Member
Thanks Meter 1
Posts: 6
Join Date: 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: [ Click to Expand ]
 
Tungstwenty
Old
#1004  
Tungstwenty's Avatar
Recognized Contributor
Thanks Meter 4,379
Posts: 1,811
Join Date: Nov 2011

 
DONATE TO ME
Quote:
Originally Posted by ddmitcyber View Post
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));
		}
	}

Device: Xperia Z (C6603)
ROM: Stock 4.4.2 10.5.A.0.230
Locked bootloader, rooted, XZDualRecovery
Retired device: Samsung Galaxy S2 (GT-I9100)

My threads that you might find useful:

SUPERCOMPUTER: what it sounded like before you bought it
The Following 2 Users Say Thank You to Tungstwenty For This Useful Post: [ Click to Expand ]
 
mtktauseef
Old
#1005  
mtktauseef's Avatar
Member
Thanks Meter 92
Posts: 30
Join Date: Nov 2012
Location: Kanpur
Default Thats A good App

Can I change My 2.3 Style ????
 
rovo89
Old
#1006  
rovo89's Avatar
Senior Recognized Developer - OP
Thanks Meter 14,068
Posts: 2,367
Join Date: Jan 2012
Quote:
Originally Posted by mtktauseef View Post
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).
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 ]
 
apex88
Old
#1007  
Member
Thanks Meter 11
Posts: 94
Join Date: Aug 2011
The disabler works only for clockworkmod? What if I got TWRP recovery?
 
m1l4droid
Old
#1008  
m1l4droid's Avatar
Senior Member
Thanks Meter 1,051
Posts: 10,514
Join Date: Sep 2010
Location: Tehran
Quote:
Originally Posted by apex88 View Post
The disabler works only for clockworkmod? What if I got TWRP recovery?
Doesn't matter.

Sent from my GT-I9300 using Tapatalk 2
 
paulobrien
Old
#1009  
paulobrien's Avatar
Senior Member
Thanks Meter 5,683
Posts: 4,437
Join Date: Nov 2003
Location: Norwich
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
Follow me on Twitter - http://twitter.com/paulobrien

Follow MoDaCo Android on Twitter - http://twitter.com/modaco

Want to donate? MoDaCo is raising money for the Multiple Sclerosis society.

The Following 2 Users Say Thank You to paulobrien For This Useful Post: [ Click to Expand ]
 
rovo89
Old
#1010  
rovo89's Avatar
Senior Recognized Developer - OP
Thanks Meter 14,068
Posts: 2,367
Join Date: Jan 2012
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?
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