Post Reply

Making "Stock" Custom ROMs Defunct (XposedFramework) - Tweaks for any ROM Version

OP pulser_g2

23rd February 2013, 02:28 AM   |  #851  
Member
Flag Los Angeles
Thanks Meter: 7
 
51 posts
Join Date:Joined: Nov 2012
More
Quote:
Originally Posted by Froid

The modules are apk's but certain browsers download as a zip. Just rename from .zip to .apk and install normally.

Weird... I've downloaded other apks on my phone using Chrome and they downloaded fine. That's for clearing that up though.
23rd February 2013, 03:26 AM   |  #852  
Senior Member
Flag Bangalore
Thanks Meter: 139
 
958 posts
Join Date:Joined: Oct 2010
More
Re: Making "Stock" Custom ROMs Defunct (XposedFramework) - Tweaks for any ROM Version
Quote:
Originally Posted by RabidMonkeyOnCrack

Weird... I've downloaded other apks on my phone using Chrome and they downloaded fine. That's for clearing that up though.

Just happens sometimes :P happens with media fire sometime too

Sent from my GT-N7100 using xda premium
The Following User Says Thank You to knightrocker For This Useful Post: [ View ]
23rd February 2013, 09:13 AM   |  #853  
geovas77's Avatar
Member
Thanks Meter: 14
 
56 posts
Join Date:Joined: Aug 2012
Re: Making "Stock" Custom ROMs Defunct (XposedFramework) - Tweaks for any ROM Version
This is an amazing mod with huge potential for the future. I installed it recently to play with per app settings and it is just wonderful to have so much customisation power at my fingertips.

I am sure there are more awesome modules I will get to try and limitless possibilities for future modules.

Sent from my Galaxy Note II using Tapatalk 2
24th February 2013, 01:12 AM   |  #854  
Darkshado's Avatar
Senior Member
Montréal
Thanks Meter: 464
 
993 posts
Join Date:Joined: Apr 2011
Donate to Me
More
Has anyone considered implementing Openpdroid through this? Is it even possible?
24th February 2013, 08:14 AM   |  #855  
rovo89's Avatar
Senior Recognized Developer
Thanks Meter: 14,474
 
2,371 posts
Join Date:Joined: Jan 2012
More
AW: Making "Stock" Custom ROMs Defunct (XposedFramework) - Tweaks for any ROM Version
I think it should get possible, at least to a certain extent. However, I assume that many modifications are necessary, which means it will be quite some effort. Probably many of the changes have to be implemented differently in an Xposed module than when modifying the source code directly. Sometimes, this will make it easier, but in other places you might need more code to do the same. Definitely not an easy project. If someone wants to give it a try, go ahead. I can assist a bit with specific implementation questions, but you should already be an experienced developer.
24th February 2013, 04:53 PM   |  #856  
Scalee's Avatar
Senior Member
Thanks Meter: 245
 
184 posts
Join Date:Joined: Aug 2009
Donate to Me
Hi guys,

Today i got a request of somebody wanting to mod the multiwindow bar to 240DPI. But doing this will make the bar not fill fullscreen.
So spent pretty much my whole sunday, on this and pretty much came up empty.

Question time, so looked into the resources and found a table of dimensions. (dimens.xml)
So i tried overwriting all which have height in them, to a smaller value and see if anything changes.

But nothing happens at all, The only thing i can think of is that i am using the wrong datatype somehow.
Either that or application doesn't use it's resources for sizes, but then why did they even make the resources.

So before i spend tons more hours fumbling about, Is it the application or am i replacing the resources incorrectly?

Code:
	@Override
	public void handleInitPackageResources(InitPackageResourcesParam resparam) throws Throwable {
		if (!resparam.packageName.equals("com.sec.android.app.FlashBarService"))
			return;
		
		XposedBridge.log("Found flashbar");
		
		resparam.res.setReplacement("com.sec.android.app.FlashBarService", "dimen", "full_height", 10);
		resparam.res.setReplacement("com.sec.android.app.FlashBarService", "dimen", "applist_flashbar_full_height", 10);
		resparam.res.setReplacement("com.sec.android.app.FlashBarService", "dimen", "applist_scroll_view_height", 10);
		resparam.res.setReplacement("com.sec.android.app.FlashBarService", "dimen", "applist_flash_bar_height", 10);
		resparam.res.setReplacement("com.sec.android.app.FlashBarService", "dimen", "applist_appicon_item_height", 10);
	}
Code:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <dimen name="center_bar_width">360.0dip</dimen>
    <dimen name="center_bar_height">20.0dip</dimen>
    <dimen name="center_bar_focus_width">16.0dip</dimen>
    <dimen name="center_bar_focus_height">15.0dip</dimen>
    <dimen name="center_bar_button_width">42.0dip</dimen>
    <dimen name="center_bar_button_height">42.0dip</dimen>
    <dimen name="center_bar_button_margin">12.0dip</dimen>
    <dimen name="center_combination_width">360.0dip</dimen>
    <dimen name="center_combination_height">224.0dip</dimen>
    <dimen name="center_bar_fling_first_left">0.0dip</dimen>
    <dimen name="center_bar_fling_first_top">66.0dip</dimen>
    <dimen name="center_bar_fling_first_right">360.0dip</dimen>
    <dimen name="center_bar_fling_first_bottom">82.0dip</dimen>
    <dimen name="center_bar_fling_second_left">0.0dip</dimen>
    <dimen name="center_bar_fling_second_top">582.0dip</dimen>
    <dimen name="center_bar_fling_second_right">360.0dip</dimen>
    <dimen name="center_bar_fling_second_bottom">602.0dip</dimen>
    <dimen name="center_bar_docking_margin">30.0dip</dimen>
    <dimen name="full_width">360.0dip</dimen>
    <dimen name="full_height">640.0dip</dimen>
    <dimen name="applist_indicator_space">25.0dip</dimen>
    <dimen name="applist_bar_text_size">6.0dip</dimen>
    <dimen name="applist_move_button_width">82.5dip</dimen>
    <dimen name="applist_move_button_height">27.0dip</dimen>
    <dimen name="applist_move_button_margin">75.0dip</dimen>
    <dimen name="applist_drawer_move">78.0dip</dimen>
    <dimen name="applist_scroll_view_bg_margin">24.0dip</dimen>
    <dimen name="applist_scroll_view_margin">27.0dip</dimen>
    <dimen name="applist_scroll_view_height">75.0dip</dimen>
    <dimen name="applist_scroll_view_padding">21.0dip</dimen>
    <dimen name="applist_appicon_item_width">75.0dip</dimen>
    <dimen name="applist_appicon_item_height">60.0dip</dimen>
    <dimen name="applist_appicon_item_margin">14.0dip</dimen>
    <dimen name="applist_appicon_image_width">36.0dip</dimen>
    <dimen name="applist_appicon_image_height">36.0dip</dimen>
    <dimen name="applist_appicon_text_width">70.0dip</dimen>
    <dimen name="applist_appicon_text_height">18.0dip</dimen>
    <dimen name="applist_flash_bar_height">102.0dip</dimen>
    <dimen name="applist_flashbar_full_width">360.0dip</dimen>
    <dimen name="applist_flashbar_full_height">615.0dip</dimen>
    <dimen name="edit_list_left_padding">11.0dip</dimen>
    <dimen name="edit_list_right_padding">12.0dip</dimen>
    <dimen name="edit_list_top_padding">41.0dip</dimen>
    <dimen name="edit_list_bottom_padding">41.0dip</dimen>
    <dimen name="edit_list_left_padding_h">15.0dip</dimen>
    <dimen name="edit_list_right_padding_h">15.0dip</dimen>
    <dimen name="edit_list_top_padding_h">12.0dip</dimen>
    <dimen name="edit_list_bottom_padding_h">11.0dip</dimen>
    <dimen name="edit_list_button_height">59.0dip</dimen>
    <dimen name="edit_list_button_width">80.0dip</dimen>
</resources>
Thanks
24th February 2013, 05:18 PM   |  #857  
rovo89's Avatar
Senior Recognized Developer
Thanks Meter: 14,474
 
2,371 posts
Join Date:Joined: Jan 2012
More
At the moment, this kind of "simple" replacement is only possible for: Boolean, Color, Integer, int[], String and String[].
Dimensions can be replaced anyway, but currently only by forwarding them to your own module. See the section "Complex resources" on this page: https://github.com/rovo89/XposedBrid...cing-resources
That said, I think directly replacing dimensions would be nice, so it will add it to my list for future versions. But don't expect that anytime soon, so better use the forwarding approach for now, which basically means you need to add a dimens.xml to your module with those dimensions you want to change and then set the replacements in your code with a reference to them as described on the wiki page.
24th February 2013, 05:21 PM   |  #858  
Tungstwenty's Avatar
Recognized Contributor
Thanks Meter: 4,397
 
1,822 posts
Join Date:Joined: Nov 2011
Donate to Me
More
Quote:
Originally Posted by Scalee

So before i spend tons more hours fumbling about, Is it the application or am i replacing the resources incorrectly?

Code:
		resparam.res.setReplacement("com.sec.android.app.FlashBarService", "dimen", "applist_appicon_item_height", 10);

Unfortunately dimensions values can't be replaced directly like that.
Check the documentation here and the code here.

Notice that unlike what happens for Boolean, Color, etc. (the documented "simple" types), any potential stored replacement is only used if it's a forwarded.
You'll need to create the resources in you mod and set a forwarder.

@rovo89, this is something which I don't know if it makes sense to analyze. Should it be possible (and is it feasible) to provide the float value directly, in case the mod's author wants to handle a large number of resources and/or dynamic values AND he's willing to do the dpi math himself?
24th February 2013, 05:37 PM   |  #859  
Scalee's Avatar
Senior Member
Thanks Meter: 245
 
184 posts
Join Date:Joined: Aug 2009
Donate to Me
Good that i caved in then :P I also kind of stupid of me.
Because i did read that it only supported said datatypes, in one ear (eye?) out the other.

Will have another crack at it after dinner.
Thanks guys
24th February 2013, 05:58 PM   |  #860  
rovo89's Avatar
Senior Recognized Developer
Thanks Meter: 14,474
 
2,371 posts
Join Date:Joined: Jan 2012
More
Quote:
Originally Posted by Tungstwenty

@rovo89, this is something which I don't know if it makes sense to analyze. Should it be possible (and is it feasible) to provide the float value directly, in case the mod's author wants to handle a large number of resources and/or dynamic values AND he's willing to do the dpi math himself?

I think our posting times overlapped. I thought about using the method "public static float applyDimension(int unit, float value, DisplayMetrics metrics)" in the TypedValue class. The metrics come from the Resources instance, whereas the unit (e.g. COMPLEX_UNIT_PX, COMPLEX_UNIT_DIP) and the value are the replacement. I'm not sure what the API for this could look like to be able to store two pieces of information, probably an instance of a to-be-created class would be necessary. One possibility:
Code:
resparam.res.setReplacement("com.sec.android.app.FlashBarService", "dimen", "applist_appicon_item_height", resparam.res.createDimensionReplacement(10.0f, COMPLEX_UNIT_DIP));
Easier to type:
Code:
resparam.res.setDimensionReplacement("com.sec.android.app.FlashBarService", "dimen", "applist_appicon_item_height", 10.0f, COMPLEX_UNIT_DIP);
But we already have 6 set[SystemWide]Replacement methods... to be consistent, I would need to add another 6 of them. Or maybe accept float replacements (= pixels) and strings (to be split into value and unit)? But then, if you want to set the replacement dynamically, you would need to compose a string, which the framework would need to split again...

Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Top Threads in Galaxy Note II Original Android Development by ThreadRank