Can Xposed make result of a method to dynamic value - Xposed General

hi everyone
i m setting new Xposed module to change the result of IMEI
but not to a Static Value
i mean:
any android app will ask for DeviceId and get the IMEI
but i want to change that value to be the imei stored in a file on sdcard
so:
findandhiik::: setResult (GetContentsof("/sdcard/imeit-xt"))
i ve seen imei changer made by an other developper
everytime that app changes the imei; we have to reboot the phone to get the new imei
i want to make it dynamic so , i will change the imei instantly
so the real question :
DOES XPOSED MAKE CHNAGES TO BE STATIC RESULT NOT DYNAMIC RESULT ?
i hope you can help me

Use PrefenceActivity and set shared prefs mode to world mode readable. Many modules use this implementation.

pyler said:
Use PrefenceActivity and set shared prefs mode to world mode readable. Many modules use this implementation.
Click to expand...
Click to collapse
How exactly ?

Related

Starting a service with same permissions as hooked package

Simple question. I want to start my own service from my package with the same permissions as the package i am hooking. Does anybody know how i could do this? I know if i use android:sharedUserId="android.uid.systemui" in the manifest, but it prevents it based off of signature mismatch. Could i use xposed to grant my app the sharedUserId?
Simple question. I want to start my own service from my package with the same permissions as the package i am hooking.
Click to expand...
Click to collapse
I don't think that is possible. I haven't worked with services yet, but as far as I understood, you have to declare them in your manifest (in contrast to BroadcastReceivers, which can also be registered at runtime). Theoretically again, you could try to modify the manifest parsing and try to inject additional entries there.
elesbb said:
Could i use xposed to grant my app the sharedUserId?
Click to expand...
Click to collapse
Theoretically, I think yes, you could hook the package manager to ignore the signature mismatch etc. But I think it will be quite fragile.
What do you want to achieve with this?
rovo89 said:
I don't think that is possible. I haven't worked with services yet, but as far as I understood, you have to declare them in your manifest (in contrast to BroadcastReceivers, which can also be registered at runtime). Theoretically again, you could try to modify the manifest parsing and try to inject additional entries there.
Theoretically, I think yes, you could hook the package manager to ignore the signature mismatch etc. But I think it will be quite fragile.
What do you want to achieve with this?
Click to expand...
Click to collapse
I hate how Samsung removed widgets from the lockscreen. So i figured i'll create my own lockscreen and have it loaded by the system. I might just skip the whole service thing (which would make my lockscreen easier to write by having classes that extend things like FrameLayout as the stock lockscreen does) but i found where the lockscreen is actually shown. i may just inflate my own xml of the lockscreen using xposed resources and then adding it with windowmanager. Then the inflated view will follow the same permissions as the stock lockscreen and allow me to handle key presses and still preserve the security behind it.
Thanks rovo for the reply!
@rovo89
If i am inflating my own view inside a hooked method, how can i get the ids of my layout? I tried XModuleResources myRes; myRes.getIdentifier() but it returned null.
Be careful, Resources.getIdentifier() expects the arguments in a different order than Xposed, like getIdentifier("mystring", "string", "my.package.name").
Apart from that, simply use R.layout.my_layout.

how to modify android.os.Build's static field?

Hi, I'm just use Xposed to dev a simple project.
I'm trying to modify device info by using Xposed. When I hook TelephonyManager.getDeviceId, return the value that just what I set.
But I can't find out how to modify the fields in andoid.os.Build. They are FINAL fields and Xposed can just hook on methods but not fields.
I get a way to set the fields using XposedHelpers.setStaticObjectField. It can ONLY modify ONCE when the target apk has not started. When the target apk( such as device info viewer ) started, I have to reboot or force close the apk because of the handleLoadPackage method can not reinvoke.
Waiting online for any solution. Thanks very much.
joetony said:
Hi, I'm just use Xposed to dev a simple project.
I'm trying to modify device info by using Xposed. When I hook TelephonyManager.getDeviceId, return the value that just what I set.
But I can't find out how to modify the fields in andoid.os.Build. They are FINAL fields and Xposed can just hook on methods but not fields.
I get a way to set the fields using XposedHelpers.setStaticObjectField. It can ONLY modify ONCE when the target apk has not started. When the target apk( such as device info viewer ) started, I have to reboot or force close the apk because of the handleLoadPackage method can not reinvoke.
Waiting online for any solution. Thanks very much.
Click to expand...
Click to collapse
I don't know which final field you are trying to change, but most of them get their values from getString(), getStringList() or getLong() methods.
You need to hook in these methods, read their "property" parameter ( param.args[0] ) to see if it is the one you want to change, and finally change the method result ( param.setResult() ).
Hello. Is there a solution to change the fields like Build.MODEL on the fly? Any examples not worked. Thanks.
Some fields can't be replaced, am I right?
Code is poetry:
https://github.com/M66B/XPrivacy/blob/master/src/biz/bokhorst/xprivacy/XPrivacy.java#L159
Your code is amazing
M66B said:
Code is poetry:
https://github.com/M66B/XPrivacy/blob/master/src/biz/bokhorst/xprivacy/XPrivacy.java#L159
Click to expand...
Click to collapse
It's worked only in own application with this code. In other apps it's not worked. I need to make changes to apply to all applications.
PS: Sorry for my bad English.
ifynk said:
It's worked only in own application with this code. In other apps it's not worked. I need to make changes to apply to all applications.
PS: Sorry for my bad English.
Click to expand...
Click to collapse
You can do this only when the Java VM is being initialized in handle load package.
M66B said:
You can do this only when the Java VM is being initialized in handle load package.
Click to expand...
Click to collapse
Thanks. How i can restart package for new init for handle load?
ifynk said:
Thanks. How i can restart package for new init for handle load?
Click to expand...
Click to collapse
There is no need for restarts, just set a new value in the Xposed handleLoadPackage callback for the applications you want to modify values.
Note that changing Build properties for Android might result in a bootloop.
Edit: if you don't known about handleLoadPackage , you need to do some studying ...
This all can be simplified by XposedHelpers.setStaticObjectField(clazz, name, value)
M66B said:
Edit: if you don't known about handleLoadPackage , you need to do some studying ...
Click to expand...
Click to collapse
Were i can read about handleLoadPackage? Thanks.

[Q] Setting Shared Preferences World Readable

Hi
I am trying to read settings for my module using XSharedPreferences. When I call makeWorldReadable method it returns false.
It's not because the path is wrong. I tried setting permissions from ES and then module can read settings.
I am also setting mode in preference fragment.
Code:
getPreferenceManager().setSharedPreferencesMode(Context.MODE_WORLD_READABLE);
But I am missing something.. Any ideas
726f62696e said:
Hi
I am trying to read settings for my module using XSharedPreferences. When I call makeWorldReadable method it returns false.
It's not because the path is wrong. I tried setting permissions from ES and then module can read settings.
I am also setting mode in preference fragment.
Code:
getPreferenceManager().setSharedPreferencesMode(Context.MODE_WORLD_READABLE);
But I am missing something.. Any ideas
Click to expand...
Click to collapse
Looks right to me (at least that's how I'm doing it). You're calling makeWorldReadable() in initZygote right?
Is this on the new LP xposedbridge?
With SE enabled it returns always false:
Code:
public boolean makeWorldReadable() {
if (!SELinuxHelper.getAppDataFileService().hasDirectFileAccess())
return false; // It doesn't make much sense to make the file readable if we wouldn't be able to access it anyway.
...

How to enable haptic feedback on S5 Mini running official Lolipop?

There's no feature in sounds or anywhere in settings. Also if I need device rooted to do that, please let me link to how to vid, as I've never done that.
As far as I kbow, if you have a G800F device you can do it using a custom kernel:
http://forum.xda-developers.com/galaxy-s5-mini/orig-development/kernel-custom-kernel-t3130662
For other models, probably using an Xposed module. Both need root.
Damn. I don't get it, why the f they removed it from settings after kitkat...
tried to activate in H with build.prop, and all the vibration was gone
Use SQLite editor. There is a database in package Settings storage named settings.db, find hapic_feedback_enabled name in system category and change the value from 0 to 1 then restart the phone. I think this will help ))

Enable builtin firewall option Samsung

Mostly when you install a new ROM a Note 5 you get an option restrict background data option. What if you want to stop an application to use the wifi or mobile data completely. Answer normally was to use a third party software. But hey Samsung has a built in firewall. See the pics to get the picture
Add this line to CSC using any root file browser (Xplore recommended).
Path
root/system/csc/others.xml
Click to expand...
Click to collapse
Code:
<!-- SmartManager -->
<CscFeature_SmartManager_ConfigDashboard>dual_dashboard</CscFeature_SmartManager_ConfigDashboard>
<CscFeature_SmartManager_ConfigSubFeatures>roguepopup|autoclean|autorestart|networkpowersaving|storageclean|backgroundapp|applock|trafficmanager|notificationmanager|devicesecurity|applicationpermission|devicesecurity|chinadualpage|UDS</CscFeature_SmartManager_ConfigSubFeatures>
Good day,
I added the lines to the (others.xml) , before : </FeatureSet>.. rebooted the phone, but nothing happen.. is there any thing else should I Do ?!
Edit:
I found the solution, by changing | to , in the second line.. now the code is :
Code:
<CscFeature_SmartManager_ConfigDashboard>dual_dashboard</CscFeature_SmartManager_ConfigDashboard>
<CscFeature_SmartManager_ConfigSubFeatures>roguepopup,autoclean,autorestart,networkpowersaving,storageclean,backgroundapp,applock,trafficmanager,notificationmanager,devicesecurity,applicationpermission,chinadualpage,cstyle,fake_base_station,UDS2</CscFeature_SmartManager_ConfigSubFeatures>

Categories

Resources