FORUMS
Remove All Ads from XDA

[TUTORIAL]Xposed module devlopment

1,658 posts
Thanks Meter: 2,019
 
Post Reply Email Thread
25th September 2014, 02:46 PM |#91  
hamzahrmalik's Avatar
OP Senior Member
Thanks Meter: 2,019
 
Donate to Me
More
Quote:
Originally Posted by Mjuksel

edit scrap my old post ;

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

Code:
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 ?

I'm assuming you're targeting wrong
Look at some mods on github which change notification background

Sent from my amazingly awesome OnePlus One using Tapatalk
 
 
28th September 2014, 02:53 PM |#92  
Junior Member
Thanks Meter: 0
 
More
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?
30th October 2014, 02:16 PM |#93  
PedriX's Avatar
Junior Member
Thanks Meter: 2
 
More
Fantastic tutorial
4th November 2014, 12:45 PM |#94  
Member
Thanks Meter: 3
 
More
Smile 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
4th November 2014, 04:40 PM |#95  
hamzahrmalik's Avatar
OP Senior Member
Thanks Meter: 2,019
 
Donate to Me
More
Quote:
Originally Posted by drsaidalavi@gmail.com

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

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

Sent from my amazingly awesome OnePlus One using Tapatalk
28th November 2014, 08:42 AM |#96  
vikasb32's Avatar
Recognized Themer
Flag Hardwar
Thanks Meter: 2,001
 
Donate to Me
More
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

Quote:

public class SettingFragment extends PreferenceFragment implements
OnSharedPreferenceChangeListener {

public static boolean enabled = false;



@Override
public void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);
this.getPreferenceManager().setSharedPreferencesMo de(
PreferenceActivity.MODE_WORLD_READABLE);
this.getPreferenceManager().getSharedPreferences()
.registerOnSharedPreferenceChangeListener(this);

this.addPreferencesFromResource(R.xml.pref_setting );



}


@Override
public void onSharedPreferenceChanged(SharedPreferences arg0, String key) {

//SettingsProvider.settingsChanged(getActivity());
if (key.equals("theme")) {

Intent intent = new Intent(getActivity(), SettingActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(intent);
getActivity().overridePendingTransition(android.R. anim.fade_in,
android.R.anim.fade_out);


}
}

}

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.

Quote:

public class SettingActivity extends ActionBarActivity {
private Menu Vmenu;
private SharedPreferences prefs;
@Override
public void onCreate(Bundle savedInstanceState) {
prefs = PreferenceManager.getDefaultSharedPreferences(this );
// PreferenceManager.setDefaultValues(this, R.xml.pref_setting, false);
if (prefs.getBoolean(Common.KEY_APP_THEME, false)) {


setTheme(R.style.AppTheme);
}
else {
setTheme(R.style.AppBaseTheme);
}


super.onCreate(savedInstanceState);

if(savedInstanceState == null) {
setContentView(R.layout.activity_settings);
Fragment fragment = new SettingFragment();
fragment.setArguments(getIntent().getExtras());
getSupportFragmentManager().beginTransaction().add (R.id.settingsFragment, fragment).commit();
}

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
SystemBarTintManager tintManager = new SystemBarTintManager(this);
tintManager.setStatusBarTintEnabled(true);
int actionBarColor = this.getResources().getColor(
R.color.statusbar_color);
tintManager.setStatusBarTintColor(actionBarColor);
}
}

public boolean onCreateOptionsMenu(Menu menu) {
super.onCreateOptionsMenu(menu);
getSupportActionBar().setDisplayHomeAsUpEnabled(fa lse);
Vmenu = menu;
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.menu, menu);

return true;
}

public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.toast:
final Toast tag = Toast.makeText(getApplicationContext(),
R.string.toast_test_title, Toast.LENGTH_SHORT);
tag.show();
return true;
}

return super.onOptionsItemSelected(item);
}




}

28th November 2014, 04:07 PM |#97  
hamzahrmalik's Avatar
OP Senior Member
Thanks Meter: 2,019
 
Donate to Me
More
Quote:
Originally Posted by 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.

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

Sent from my amazingly awesome OnePlus One using Tapatalk
The Following User Says Thank You to hamzahrmalik For This Useful Post: [ View ] Gift hamzahrmalik Ad-Free
28th November 2014, 05:03 PM |#98  
vikasb32's Avatar
Recognized Themer
Flag Hardwar
Thanks Meter: 2,001
 
Donate to Me
More
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?
28th November 2014, 08:48 PM |#99  
hamzahrmalik's Avatar
OP Senior Member
Thanks Meter: 2,019
 
Donate to Me
More
Quote:
Originally Posted by 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?

Ah I get you
Yes it is you need to use world readable

Sent from my amazingly awesome OnePlus One using Tapatalk
29th November 2014, 02:12 AM |#100  
vikasb32's Avatar
Recognized Themer
Flag Hardwar
Thanks Meter: 2,001
 
Donate to Me
More
Quote:
Originally Posted by hamzahrmalik

Ah I get you
Yes it is you need to use world readable

Sent from my amazingly awesome OnePlus One using Tapatalk

Thanks can you tell me where I use that word i already use that word in my fragment class.
29th November 2014, 10:26 AM |#101  
hamzahrmalik's Avatar
OP Senior Member
Thanks Meter: 2,019
 
Donate to Me
More
Quote:
Originally Posted by vikasb32

Thanks can you tell me where I use that word i already use that word in my fragment class.

You have to use it every time you access shared preferences

Sent from my amazingly awesome OnePlus One using Tapatalk
Post Reply Subscribe to Thread

Tags
beginner, development, mod, tutorial, xposed

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes