yashsingh1/xdaforums huggingface dataset:
[XDA-University] neXus PRIME:
Will do. OK. I know I'm almost there. Just some small mistake

EDIT:

I eventually managed to get it working. Although i didnt use your method to commit using SharedPreferences. I used android PreferenceActivity which does the same on deafult and then retrieved them in my xposed class.
[XDA-University] hamzahrmalik:
Could you share what you did?
[XDA-University] hamzahrmalik:
Tutorial 9 is up - Hooking Methods which take a parameter
[XDA-University] EeWin:
[MENTION=5290145]hamzahrmalik[/MENTION]

Quick question here : How to add a new filter to your logcat to track error messages from Xposed. Add a filter named "Xposed" and filter by the tag name "Xposed" ?

I searched the web , they done through adb ( I have no clue ) , something that I missed ?

Note : Im using Eclipse on Windows 7 and Im a beginner.
[XDA-University] hamzahrmalik:
This is mentioned in tutorial 1. Yes filter by tag name Xposed
[XDA-University] EeWin:
Sorry , I think you misunderstood , my question is which button in Eclipse to add the filter ?

How to get into the filter screen (screenshot )?

I'm unfamiliar with Eclipse. Trying to learn from basic here. Sorry.

Sent from a •Franco-Carbonized Nexus 5• owner
[XDA-University] EeWin:
Screenshot.

Sent from a •Franco-Carbonized Nexus 5• owner
[XDA-University] hamzahrmalik:
Ahhh

I can't say this precisely because I'm not at my PC

But if you have the logcat view open

Click the add filter button in the left pane

If you don't have logcat open to to window>add perspective and look under Android under Other

Edit

From stack overflow
[XDA-University] EeWin:
I found the logcat option in Quick Access.

Btw , my Logcat looks weird. Very different than yours.

Lots of line in red.
[XDA-University] hamzahrmalik:
There are a lot of errors from other modules

Disable all other modules before you start
[XDA-University] undefman:
Hi guys, this is my code:

ClassLoader localClassLoader2 = paramLoadPackageParam.classLoader;

Object[] arrayOfObject2 = new Object[2];

arrayOfObject2[0] = "java.lang.String";

arrayOfObject2[1] = new XC_MethodReplacement() {

protected Object replaceHookedMethod(XC_MethodHook.MethodHookParam paramAnonymousMethodHookParam)throws Throwable {

String currentPara = paramAnonymousMethodHookParam.args[0].toString();

if(currentPara.equals("java.class.path")){

return "Our New Result";

}else{

//I am stuck and my question is how to...

//return the Original results here?

}

}

};

XposedHelpers.findAndHookMethod("java.lang.System", localClassLoader2, "getProperty", arrayOfObject2);

I would appreciate any ideas. Thanks!
[XDA-University] hamzahrmalik:
If you want to retun original results just do nothing

Try it I'm not sure

And haha you posted his in framework thread already
[XDA-University] krisjanne:
Hello for the TUTO 6 i got this one but i don't understand correcly how do you do your code... what is the différence..

Thanks for your tuto...

package com.neoteam.nxnavbarsize36dp;

import android.content.res.XModuleResources;
import de.robv.android.xposed.IXposedHookInitPackageResources;
import de.robv.android.xposed.IXposedHookZygoteInit;
import de.robv.android.xposed.callbacks.XC_InitPackageResources.InitPackageResourcesParam;

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

@Override
public void initZygote(StartupParam startupParam) throws Throwable {
MODULE_PATH = startupParam.modulePath;

}

@Override
public void handleInitPackageResources(InitPackageResourcesParam resparam)
throws Throwable {
if (!resparam.packageName.equals("android"))
return;

XModuleResources modRes = XModuleResources.createInstance(MODULE_PATH, resparam.res);
resparam.res.setReplacement("android", "dimen", "navigation_bar_height", modRes.fwd(R.dimen.navigationbarSize));
}

}
[XDA-University] hamzahrmalik:
The code looks right

Did you definitely enable?
[XDA-University] krisjanne:
I just begening with xposed and i want build one for Xperia Z2 Tablet.. But I'm just a theme not DEV that why I've some probleme... I've many idea but I can found where to link xposed java to android interface... I'm blocked... ?
[XDA-University] hamzahrmalik:
If you want to make a theme ask a dev to do the coding part and you make the graphics
[XDA-University] silentscreamz:
I'm new to the development aspects of xposed so I'm not sure of it's capabilities. Can you make a custom recovery using xposed ? I have a galaxy s4 mini SCH-I435 and there is no help with this particular model.
[XDA-University] hamzahrmalik:
Try doing the replacing without checking package name

Remove this bit

if (!resparam.packageName.equals("com.htc"))

return;
[XDA-University] hamzahrmalik:
No xposed is for modding Android

Recovery isnt part of Android
[XDA-University] grorg:
Alright it's working, thanks.
[XDA-University] hamzahrmalik:
Just so you know this is why it works

When you check the package, it only replaces the resources for that package

So when another app uses the resources that app doesn't get affected by your mod

You could actually use this to your advantage and make a per app feature
[XDA-University] 0utcast:
what if I want to hook a value in an application code and return the Boolean result or change the Boolean result.

the method would return if the application is expired.

package com.outcast.test;

import static de.robv.android.xposed.XposedHelpers.findAndHookMethod;
import android.widget.TextView;
import de.robv.android.xposed.IXposedHookLoadPackage;
import de.robv.android.xposed.XC_MethodHook;
import de.robv.android.xposed.callbacks.XC_LoadPackage.LoadPackageParam;

public class Main implements IXposedHookLoadPackage {

@Override
public void handleLoadPackage(LoadPackageParam lpparam) throws Throwable {
if (!lpparam.packageName.equals("com.android.systemui"))
return;

findAndHookMethod("com.example.application.billing.BillingHelper", lpparam.classLoader, "isSubscriptionExpired", new XC_MethodHook() {
@Override
protected void afterHookedMethod(MethodHookParam param) throws Throwable {
//code for boolean code goes here

}
});
}
}
[XDA-University] hamzahrmalik:
FIrstly, sorry if I'm wrong, but it looks like this mod is going to allow you to pirate apps? or somethiing like that. That isn't allowed on XDA

To change what the method returns,

param.setResult(true) //change true to whatever you want to return
[XDA-University] 0utcast:
no I don't want to pirate apps. i want to see what can be hooked inside applications using xposed.

thank you for your help on the return.
[XDA-University] 0utcast:
can a person do like in cydiasubstrate and make sure the param exists before trying to set it

something like below.

//take from cydia substrate, has no relevance to xposed
//copy and paste taken from gdssecurity example

try{
method = _class.getMethod(methodName, String.class, String.class); // public boolean validatePassword(String password, String storedPassword)
}catch(NoSuchMethodException e){
method = null;
}
[XDA-University] grorg:
[MENTION=5290145]hamzahrmalik[/MENTION], please can you explain how to replace color in colors.xml.
[XDA-University] hamzahrmalik:
I've never tried it, so am not sure

Try the same way you would replace other resources
[XDA-University] grorg:
I've tryed. No result.
[XDA-University] grorg:
[MENTION=5290145]hamzahrmalik[/MENTION], did you've tryed to replace layouts in multiple apk's?
[XDA-University] hamzahrmalik:
How do you mean
[XDA-University] grorg:
I make a module that should replace one layout in HtcContactWidgets.apk and one in HtcMusicWidget.apk. Is it possible?
[XDA-University] hamzahrmalik:
Of course
[XDA-University] S0bes:
Is there way to replace whole .java file( or even add brand new) instead of replacing some methods inside it?

I need to make http://grepcode.com/file/repository...id/dialer/dialpad/LatinSmartDialMap.java?av=f

look like

https://github.com/OWLeeMod/android...droid/dialer/dialpad/RussianSmartDialMap.java

And there are a lot of changes for me. So I think it would be easer just replace whole file :)

Sorry for a dumb question, this is my first day of xposed module creating and I've already made some simple modules thanks to OP :)
[XDA-University] hamzahrmalik:
Its not a dumb question

Everyone has to learn :)

Ask rovo89 I'm really not sure

I'm 99% certain you CANT but check of you want
[XDA-University] dillonr:
Is it possible to call/run another method (of the hooked application) when the application is loaded?

I am using tasker to open up my music playing app (grooveshark) when i enter my car, but i was going to make grooveshark start playing automatically when tasker opens it, so that i do not have to remove my phone from my pockets to start the music.

I would need to call

com.grooveshark.android.lib.player.AsyncPlayer.play

and pass the argument

(boolean) true

to hopefully get it to start playing

Any input would be appreciated

Edit:

XposedHelpers.callMethod() looks promising
[XDA-University] S0bes:
Hi, I got a question about this thing:

if (!resparam.packageName.equals("name.of.package"))
return;

How can I use it for different packages simultaneously ?

For example, I got this code

public void handleInitPackageResources(InitPackageResourcesParam resparam) throws Throwable {

XSharedPreferences pref = new XSharedPreferences("com.s0bes.checkboxes", "settings");
H_on=pref.getBoolean("Disabled_data_icon", false);
H_data=pref.getBoolean("Data_icon_H", false);
Fm_speaker=pref.getBoolean("Speaker", false);

// systemUi
if (!resparam.packageName.equals("com.android.systemui"))
return;
if (H_on==true)
resparam.res.setReplacement("com.android.systemui", "bool", "show_data_disabled_icon", true);
else
resparam.res.setReplacement("com.android.systemui", "bool", "show_data_disabled_icon", false);

if (H_data==true){
resparam.res.setReplacement("com.android.systemui", "bool", "config_hspa_data_distinguishable", true);
resparam.res.setReplacement("com.android.systemui", "bool", "config_hspap_data_distinguishable", true);}
else{
resparam.res.setReplacement("com.android.systemui", "bool", "config_hspa_data_distinguishable", false);
resparam.res.setReplacement("com.android.systemui", "bool", "config_hspap_data_distinguishable", false);}

//Fmradio
if (!resparam.packageName.equals("com.motorola.android.fmradio"))
return;
if (Fm_speaker==true)
resparam.res.setReplacement("com.motorola.android.fmradio", "bool", "config_speaker_supported_in_fm_radio", true);
else
resparam.res.setReplacement("com.motorola.android.fmradio", "bool", "config_speaker_supported_in_fm_radio", false);

}

and Fmradio part is not working :(

UPD:

Solved my problem. Saw how to do it in Gravitybox sources https://github.com/C3C0/GravityBox/blob/master/src/com/ceco/gm2/gravitybox/GravityBox.java

public void handleInitPackageResources(InitPackageResourcesParam resparam) throws Throwable {

// if (!resparam.packageName.equals("com.android.systemui"))
XposedSystemUI.initResources(resparam);

//if (!resparam.packageName.equals("com.motorola.android.fmradio"))
xposedRadio.initResources(resparam);
}
}
[XDA-University] S0bes:
[MENTION=5290145]hamzahrmalik[/MENTION] Can you tell me what should I use if parameter is a char?

@Override
public boolean isValidDialpadAlphabeticChar(char ch) {
return (ch >= 'a' && ch <= 'z');
}

I tried

XposedHelpers.findAndHookMethod("com.android.dialer.dialpad.LatinSmartDialMap", loadpkg.classLoader,
"isValidDialpadAlphabeticChar", Character.class, new XC_MethodHook() {

@Override protected void beforeHookedMethod(final MethodHookParam param) throws Throwable {
XposedBridge.log( "AAAAAAAAAAAAA" );
}
});

But log says that it cant find isValidDialpadAlphabeticChar method

java.lang.NoSuchMethodError: com.android.dialer.dialpad.LatinSmartDialMap#isValidDialpadAlphabeticChar(java.lang.Character)#exact

at de.robv.android.xposed.XposedHelpers.findMethodExact(XposedHelpers.java:179)

at de.robv.android.xposed.XposedHelpers.findAndHookMethod(XposedHelpers.java:129)

at de.robv.android.xposed.XposedHelpers.findAndHookMethod(XposedHelpers.java:136)
[XDA-University] hamzahrmalik:
Your hook is fine, i think it's because its overrided method

I'm not sure what to do, ask on the xposed general forum (make sure it hasn't already been asked)
[XDA-University] frkhtc:
How did you do that? Sorry for my noobness :D
[XDA-University] frkhtc:
Thanks for this tutorial hamzahrmalik. I manage to make a module to change some drawables from framework, for a specific app.

Now, since i'm a total noob on Java programming, can someone give me a tip on how to change those files, for multiple specific apps.

An example: if a open Dialer, it should use png1, if i open messages it should use png2 and so on.

I have tried an if-else statement but doesn't work

@Override

public void handleInitPackageResources( XC_InitPackageResources.InitPackageResourcesParam resparam) throws Throwable {

//contacts

if (!resparam.packageName.equals("com.android.htccontacts")) {

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

XposedBridge.log("---------------------CONTACTS------------------------------");

XResources.setSystemWideReplacement("com.htc", "drawable", "common_app_bkg_top_src", modRes.fwd(R.drawable.common_app_bkg_top_blue));

XResources.setSystemWideReplacement("com.htc", "drawable", "common_footer", modRes.fwd(R.drawable.common_footer));

XResources.setSystemWideReplacement("com.htc", "drawable", "common_header", modRes.fwd(R.drawable.common_headerblue));

XposedBridge.log("sensesixtheme: ----------Contacts were changed!--------------");

}

//gallery

else if (!resparam.packageName.equals("com.htc.album")) {

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

XposedBridge.log("sensesixtheme: ---------------------------GALLERY-----------------------------------------------");

XResources.setSystemWideReplacement("com.htc", "drawable", "common_app_bkg_top_src", modRes.fwd(R.drawable.common_app_bkg_top_red));

XResources.setSystemWideReplacement("com.htc", "drawable", "common_footer", modRes.fwd(R.drawable.common_footer));

XResources.setSystemWideReplacement("com.htc", "drawable", "common_header", modRes.fwd(R.drawable.common_headerred));

XposedBridge.log(" ---------------Ok, gallery were changed!----------------");

}
[XDA-University] hamzahrmalik:
In your if statements you've used

If(!reparam.bla.bla)

The ! Means not equal

Remove all the !
[XDA-University] frkhtc:
Thanks a lot. It's working now. There is a lag of 0.5 sec in changing those files, but not in every app. Gonna do some research. For now i can live with that.
[XDA-University] frkhtc:
I'm back with another question. How can you change the status bar background in an app?

i have tried this code

if (resparam.packageName.equals("com.android.htccontacts")) try {
resparam.res.setReplacement("com.htc", "drawable", "common_header", modRes.fwd(R.drawable.header_default_categone));
resparam.res.setReplacement("com.android.systemui", "drawable", "status_bar_background", new XResources.DrawableLoader() {
@Override
public Drawable newDrawable(XResources res, int id) throws Throwable {
return new ColorDrawable(Color.WHITE);
}
});
} catch (Throwable t) { XposedBridge.log(t); }

but it gives this error in logcat: android.content.res.Resources$NotFoundException: com.android.systemui:drawable/status_bar_background

at android.content.res.XResources.setReplacement(XResources.java307)
[XDA-University] Mjuksel:
edit scrap my old post ;

this is what i have next, trying to make the notifications transparent.. not really working

package mjxl.xposed.cm11;

import android.content.res.XModuleResources;
import de.robv.android.xposed.IXposedHookInitPackageResources;
import de.robv.android.xposed.IXposedHookZygoteInit;
import de.robv.android.xposed.callbacks.XC_InitPackageResources.InitPackageResourcesParam;

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

@Override
public void initZygote(StartupParam startupParam) throws Throwable {
MODULE_PATH = startupParam.modulePath;
}

@Override
public void handleInitPackageResources(InitPackageResourcesParam resparam) throws Throwable {
XModuleResources modRes = XModuleResources.createInstance(MODULE_PATH, resparam.res);
resparam.res.setReplacement("android", "drawable", "notification_bg_normal", modRes.fwd(R.drawable.mjxlnull));
}
}

this doesn't give any errors, but either i'm pointing the wrong files, or something needs a fix.

any tips ?
[XDA-University] hamzahrmalik:
I'm assuming you're targeting wrong

Look at some mods on github which change notification background
[XDA-University] devtrop:
how can I hook a systemService?

I'm trying to hook AppOpsService,

actually, I'm not even sure what is the correct package name...

I'd like to hook the getUid() method so I could filter out some uid from the AppOps...

Is it possible to hook a method in a system service?
[XDA-University] PedriX:
Fantastic tutorial :good: :good:
[XDA-University] drsaidalavi@gmail.com:
Bluetooth Launcher APK to launch voice dialer in LG g2

Hello Hamzahrmalik,

I was the onewho requested for the Hijiri clock and I must say it is fantastic in all aspect . I am using it in my LG G2 D 802 successfully. I want to send donation to your development project, but I don't know how to send it. Kindly give the address by which I can send it by PayPal.

I have one more request. I am very much satisfied with my LG G2 D802. The only problem is that it can not launch any voice dialer applications like Cyberon voice speed dial, Google search, or Utter when the dial button of the connected bluetooth head set is pressed. I can answer the call by pressing it , but can't make a call. I wrote to the company about this which is available even in the old and basic models like Nokia N 95. But they said it is not there in the LG g2. Then I came across Cloudyfa's Cloudyflex 2.2 rom for LG g2. When I installed it, it brought back this function, and I can launch Cyberon voice speed dial by pressing the Bluetooth dial button. But when they upgraded the rom, this function again lost, so that now I am stuck in Cloudyflex 2.2 rom only to retain this function. The bluetooth version in this rom is F340k20a.

I tried to extract the apk file, odex file , lib file etc and tried to replace in higher versions of the same rom and other roms, but failed.

Now I want to install the ported G3 rom in my LG G2, but none of them has this bluetooth function.

I humbly request you ,if possible make an apk, or a xposed module by which you can assign any third party voice dialer to be launched when the dial button of bluetooth head set is pressed. Without this the phone will not be completely Hands free . Always we have to mount the phone in the dash board ofthe car and shout at it to open Google now. So it will be a great apk or module if you can successfully make it and we can install it any android with all latest roms.

Kindly try for it, and we don't mind even if it is a paid apk

Thanking You

Dr.Saidalavi
[XDA-University] hamzahrmalik:
Firstly, this should go in the requests thread

Have you tried using the Xposed Additions module it let's you remap buttons

Edit

I don't take donations, you can help out by buying any of my paid apps, thanks
[XDA-University] vikasb32:
hello i have problem my xposed module work fine but when i use setTheme function my module didn't work at all hope you will help me in this. here is my code

this is my fragment class

here my main activity the red color code make my module not to work at all but if i remove that code it work fine.
[XDA-University] hamzahrmalik:
What's the module meant to do?

Where is the Xposed class?

The red is in your activity not the module part and therefore not an Xposed error
[XDA-University] vikasb32:
My module is Xtoast and no problem in xposed class but when I copy red code in my to add a functionality to change app theme to holo dark and light my xposed did not work at all but when I remove that red part my module work fine can you tell me why? It is due to xsharedpreference did not able to read my preference file?
[XDA-University] hamzahrmalik:
Ah I get you

Yes it is you need to use world readable
[XDA-University] vikasb32:
Thanks can you tell me where I use that word i already use that word in my fragment class.
[XDA-University] hamzahrmalik:
You have to use it every time you access shared preferences
[XDA-University] vikasb32:
Shared preference or xsharedpreference?
[XDA-University] hamzahrmalik:
shares preferences
[XDA-University] Cilenco:
I tried to hook the method

protected void onVolumeChanged(int streamType, int flags)

with this Xposed function:

XposedHelpers.findAndHookMethod(classVolumePanel, "onVolumeChanged", Integer.class, Integer.class, new MethodHook());

but it comes to the MetthodNotFound error. What do I have to pass if the method has primitive parameters?
[XDA-University] aljaadi:
Thank you very much.
[XDA-University] GoodOldWar:
I'm a bit confused on how all this works. All the subject in the tutorials, I've picked up fairly easily. But what about when I just want to tweak portions of a method? i.e.,

public void methodToChange() {

String original = "text";

do.someStuff(original);

do.someOtherStuff();

}

How can I access do to use do.someOtherStuff() if do isn't defined within my personal code? It seems a bit excessive to import all that code into my project. Do I build my project using the source of the apk I'm modifying as a library?
[XDA-University] hamzahrmalik:
Either rewrtite the method in your Xposed module and replace the whole original method

Or find another way of doing what you need
[XDA-University] sumit yadav:
Can you please guide me how to create xposed module for Facebook app(make most recent story as default)!!??
[XDA-University] hamzahrmalik:
You'd have to get the source code using APK tool or similar then find the appropriate method and hook it
[XDA-University] sumit yadav:
Source code for most recent from Facebook app?
[XDA-University] sscsps:
Decompile facebook apk
[XDA-University] 93Akkord:
I've been following these guides and I've made progress but I have a couple of questions.

1. How do I modify another part of a layout within the same module? This is what I have right now, which changed the background for the red text in the code below it. I am now trying to change the background for the text in blue. How would I go about doing this? So far, anything I have done has thrown framelayout errors in log (sorry, I forgot the logs at home).

public class Appname implements IXposedHookInitPackageResources {
RelativeLayout mainBack;

@Override
public void handleInitPackageResources(InitPackageResourcesParam resparam) throws Throwable {
if (!resparam.packageName.equals("com.appname.android"))
return;

resparam.res.hookLayout("com.appname.android", "layout", "stories", new XC_LayoutInflated() {
@Override
public void handleLayoutInflated(LayoutInflatedParam liparam) throws Throwable {
mainBack = (RelativeLayout) liparam.view.findViewById(liparam.res.getIdentifier("top_panel", "id", "com.appname.android"));
mainBack.setBackgroundColor(Color.BLACK);
}
});

}
}

<RelativeLayout android:background="[COLOR="red"]@android:color/white[/COLOR]" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_below="@id/[COLOR="red"]top_panel[/COLOR]">
<View android:id="@id/stories_divider" android:background="@color/divider_grey" android:layout_width="fill_parent" android:layout_height="1.0dip" />
<com.appname.android.ui.ptr.AppnamePtrFrameLayout android:id="@id/[COLOR="Blue"]stories_ptrframe[/COLOR]" android:background="[COLOR="blue"]@android:color/white[/COLOR]" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_below="@id/stories_divider">

2. How do I modify the background of a layout that does not have an id?

Example

<RelativeLayout android:background="#ffffffff" android:layout_width="fill_parent" android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android">