yashsingh1/xdaforums huggingface dataset:
[XDA-University] edsupagood:
I've been following the tutorial, but I just can't seem to get it to work.

I'm trying to get the Smiley Clock to work but I get this error in xposed log:

E/Xposed﹕ java.lang.ClassCastException: com.android.systemui.statusbar.policy.Clock cannot be cast to android.widget.TextView

I am not sure why I get a casting error since the clock class extends TextView.

Also I am using Lollipop, can that be a possible cause?
[XDA-University] hamzahrmalik:
The example code doesn't work on lollipop
[XDA-University] exSD:
Is there a tutorial for Lollipop xposed modules?
[XDA-University] hamzahrmalik:
It works the same way its just that specific exmaple is for KitKat and below
[XDA-University] molier:
Learn xposed

Could you point us in the right direction to learn xposed for lolipop 5.1 or 5.0?

That would be amazingly helpful or maybe just explain why the tutorial won't work with lolipop and how to do for example ;the smiley clock :)?

Thanx in advance

Oscar
[XDA-University] hamzahrmalik:
The mods are made in the exact same way its just this specific example does not work

I'll try and update when I have time thought it might not be for a few weeks
[XDA-University] MVGV70:
findandhook method with array in parameters

Please, advice how to use findandhookmethod for method with array in parameters list:

private void method(byte[] paramArrayOfByte, int paramInt) ?

findAndHookMethod(CLASS_NAME, lpparam.classLoader, "method", ?, Integer.class, new XC_MethodHook () { ...
[XDA-University] hamzahrmalik:
Not too sure

Try Array.class
[XDA-University] e82136:
Thanks for this tutorial.

I have lots of questions about making a Module.

I think I should start from the basic conecpt about hooking.

Here is my questions :

--- 1 ---

I'd like to make a module to modify packageManager.getInstalledPackages(int flag) return value.

but only apply with user defined app list.

For example :

=> "com.facebook.abc" is NOT on the list , when this app called getInstalledPackages will return data normally.

=> "org.my.app" is on the list , when this app called getInstalledPackages will return the data I modified.

Is it possible ?

--- 2 ---

I'd like to figure out what is "handleLoadPackage" do , this is what I thought (maybe wrong....).

My question is : "We can only find and hook a method in this app ?"

For example :

public void handleLoadPackage(LoadPackageParam param) throws Throwable {
Vector<String> list=pref.getPkgList(); // the app list I mentioned in question 1.
if (list.contains(lpparam.packageName)){
// assuming that I've already create a XC_MethodHook object => callBack
findAndHookMethod("android.app.ApplicationPackageManager",param.classLoader,"getInstalledPackages",int.class,callBack);
}
}

Tutorial said : "The method that we are overriding gets called every time the user or system opens an app."

If this time user open "org.my.app" , this app is in the app list.

Is this work ?

------ 3 ------

My goal is to modify getInstalledPackages return value when specific app call packageManager.getInstalledPackages(flag).

How can I do with my code ?

I really have lots of questions, but for now I think I have to know the basic concept of a module work first.

Thank you very much.
[XDA-University] cukingpro:
In tutorial 9 , if the method has more than 1 parameter , what should i do?

I wanna change my android id by hooking the method android.provider.Settings.Sercure.getString(ContentResolver,String);

Thanks
[XDA-University] hamzahrmalik:
Do what you would do for one parameter then add the second parameter

So instead of ContentResolver.class

ContentResolver.class, String.class
[XDA-University] hamzahrmalik:
I'm busy right now, I'll try and help you tomorrow or some other day
[XDA-University] e82136:
Thank you !

But I have sovled those questions and have some new questions.

I found that those questions is due to the XSharedPreferences.

Even thought I set XSharedPreferences to WorldReadable, but the apps I want to hook still can NOT access them.

in "initZygote" that is OK.

in "handleLoadPackage" , before I use "xpreds.reload()" it work. BUT after I called reload() , all data gone.

Now I use sdcard to store my setting data. And it's work.

My new question is, what is the right way to use XSharedPreferences ? Thank you.
[XDA-University] MVGV70:
Works good with byte[].class
[XDA-University] hamzahrmalik:
Ah yes of course
[XDA-University] MVGV70:
resource access

How to get access to resources in own res/strings.xml file (witch contain my xposed project)?

My xposed project does not have any activity. If I try to get string from res/strings.xml someActivity.getString(R.string.sometext) I got value from hooked module not mine.

How I can get value from res/string.xml in my project?
[XDA-University] bonny_k-9:
Instructions for Android Studio is?
[XDA-University] craftandbuild:
Thanks for the tutorial. It made coding my first module much easier!
[XDA-University] hamzahrmalik:
Is....nonexistent

I'm afraid I'm not a fan of Android Studio

I do plan to migrate eventually since ADT support has been dropped and when that happens, I'll make a tutorial
[XDA-University] craftandbuild:
I did it like this:

1. You can download this example: https://github.com/rovo89/XposedExamples/tree/master/RedClock

2. Import it in android studio with "File -> New -> Import"

3. Import the XposedBridge jar by putting it into /app/libs/

4. Add this to your module build.graddle, to include it in the project:

dependencies {
provided fileTree(dir: 'libs', include: ['*.jar'])
}

Just try it and have fun :)
[XDA-University] Schrubbi:
Thanks for the tutorial, I followed it and could even successfully transfer it to my application!

Two questions remain for me:

1. My 80 lines large module creates a 1mb .apk and is 5mb large after installation. I don't think that's the way it's meant to be. Any hints where I could've gone wrong?

I'm using the gradle build of Android Studio and perhaps the xposed-library gets included in a wrong way? (I read that the author doesn't use Android Studio so far, maybe somebody else has a solution/experienced this?)

2. I'm doing filename manipulation in my module and want to check presence of files. Do I need the write/read external storage permission as for regular apps or is this somehow handled differently for xposed modules?

This can be seen as a rather general question for permissions of modules, as I haven't seen that been covered so far.

Thanks for your help and the great tutorial that perfectly helped me getting started!
[XDA-University] craftandbuild:
1:

Maybe you are using AppCompat (in build.gradle if used). It often made my apk +1Mb bigger and is only needed for gui's.

An other cause could be if you used big images as ressources for the launcher icon etc.

You can also look at the source of the TimeFormat module I uploaded earlier: Source Download

You can also use proguard to shrink it, but proguard will also obfuscate your code and make debugging harder.

2:

I don't have experience with modifying files.
[XDA-University] hamzahrmalik:
FOr your second question, i think the module runs under the process of the app being hooked so the app being hooked needs to have permissions to write to the file you are trying to manipulate
[XDA-University] hamzahrmalik:
Add strings?

You mean modify them?
[XDA-University] hamzahrmalik:
For what purpose
[XDA-University] Beat_Slayer:
You must read the package xml file, then you add what you want and forward the resource loading to your module, so that your xml gets read whenever the package tries to read it.

Can you post the xml file, I'll look at it and help you with that.
[XDA-University] JusTeN_:
How can I import the jar using android studio? thanks
[XDA-University] Vivek_Neel:
You can't.
[XDA-University] JusTeN_:
Wow, but I am using it and not Eclipse, too bad :\
[XDA-University] craftandbuild:
Is this, what you searched? If something is unclear I will explain it more detailled.
[XDA-University] JusTeN_:
Yes thanks, I will try that later.
[XDA-University] grosbedo:
I don't understand how to add a preferences screen for my module. The example in the tutorial (Part 7) just explains that you have to create an Activity and put the code managing the preferences inside, but when I go in Xposed I still can't click on my module to open this activity, it just says that the module provides no user interface.

Can someone explain me how to create the link? I have googled all over the net and didn't find anything...

/EDIT: found the answer, you just need to create a launcher activity, as simple as that. Here's an extended answer:

http://stackoverflow.com/questions/...th-a-gui-preferences-screen/32555782#32555782
[XDA-University] IPM devlopers(ethiopia):
Hi guys i went

Notifications tool xposed please sent link or apk

thanks
[XDA-University] MVGV70:
adding menu

**
[XDA-University] abo hani:
I've just started in Android Programming, so this guide worked for me .

But i've tried to make a apply option, when enabled it will change something in SystemUI, but i'm having a problem with the code .

If anyone can understand the problem, please navigate here : stackoverflow.com/questions/34117627/xposed-oncheckedchanged-code-error-in-compiling .

Thanks a lot !
[XDA-University] Wassupdog:
Hello guys!

I tried to follow this tutorial, but can't find what I need.

I just started learning how to develop things for Xposed and I'm trying to change Google's search bar in the recents window.

I found a method called: "addSearchBarAppWidgetView" and has "AppWidgetHostView" type of variable (the bar itself) but I don't understand how can I access the search bar to change it's place.
[XDA-University] Beat_Slayer:
Look at the layouts.

If you need I'll give more info later, as I developed for one user some time ago a module to hide it.
[XDA-University] Wassupdog:
I will be glad to have some more info.
[XDA-University] Pr2015:
Thank you, can you please tell me in android studio where i should add the jar file
[XDA-University] Pr2015:
can you please explain more about that for android studio developer because by default when I create a project at first time two packages are created having the same name which one I should choose?

What do you mean by root here? when I pasted the jar file into the app folder nothing happened

also I didn't find file "assets" in android studio, can you tell me which one I should use?

sorry but I'm still beginner
[XDA-University] hamzahrmalik:
The tutorial primarily focuses on Eclipse so I'm not sure, I don't use Android Studio. I might try it and see if I can help
[XDA-University] rmrf:
Hi, I tried to follow this tutorial but it seems that package "com.android.systemui" never show up (I printed lpparam.packageName every time handleLoadPackage is called). My device is LG G4 on 5.1.1. Could anyone show me how to fix it? Thank you!
[XDA-University] hamzahrmalik:
Not sure why make sure you're logging from the time you boot
[XDA-University] rmrf:
I logged every time handleLoadPackage method is called. Is that from the beginning?
[XDA-University] asdfasdfvful:
Hey all, quick question. I'm new to Xposed and I'm trying to create a module for theming.

1. How can I use the setTheme method with a local style (R.style.etc). From my attempts, it only works with android.R.style, and I couldn't find an example of others using it this way.

2. How is it possible to get a value from an app, rather than just modify it? For example, is it possible to get the value of the color "background_dark" from an app?
[XDA-University] hamzahrmalik:
I'm pretty certain you can't modify a style but I'm not sure. Take a look at Holo Themer on github https://github.com/hamzahrmalik/HoloThemer

You should be able to get a value but admittedly I'm not sure how
[XDA-University] asdfasdfvful:
According from rovo's tutorial I guess styles is "too deep in the native code" to modify.

Sorry to bother you, but I have one more question. I looked at your tutorial 8 and tried my best to replicate it, since it's very similar to what I am doing. In the settings app, I found a layout "single_button_panel.xml" which contains a button of id "button"

I wanted to tint the background (default tint is ?colorAccent), so here is what I did. Here is the original layout file in settings.

However, I'm getting an error of not being find resource ID #0x70dc3480. Do you have any idea what I did wrong? Only thing I see that's different is that this is a button whereas your example was a LinearLayout.

And thanks so much! It's awesome seeing examples and they help a lot.
[XDA-University] P1nGu1n_:
Hey buddy, long time no see!

I looked at your code, it does look fine to be honest.

Good to see you started programming! If you wanna catch up or get some tips, leave me a PM :)
[XDA-University] samkpo:
Great tutorial [emoji122]

I made a module to replace resources, with it's settings activity where I choose what to replace. The question is, how do I do to replace the new resources without rebooting the phone?

Enviado desde mi Moto G mediante Tapatalk

---------- Post added at 12:16 AM ---------- Previous post was at 12:07 AM ----------

Never mind, it's automatic, but the hooked package must be killed first...

Enviado desde mi Moto G mediante Tapatalk
[XDA-University] hamzahrmalik:
try this http://fuzion24.github.io/android/gradle/xposed/jar/java/build/sdk/2014/08/15/android-gradle-xposed/
[XDA-University] Pr2015:
Thank you:)
[XDA-University] dave07747:
Help Please!

Hi there!

First off, I wanted to say great tutorial! However, I'm running into a little problem. I'm testing it on my Nexus 5 with Marshmallow and when I check Xposed logs, it's saying

This is my source

package com.example.david.clock;

import android.widget.TextView;

import de.robv.android.xposed.IXposedHookLoadPackage;
import de.robv.android.xposed.XC_MethodHook;
import de.robv.android.xposed.XposedBridge;
import de.robv.android.xposed.callbacks.XC_LoadPackage.LoadPackageParam;

import static de.robv.android.xposed.XposedHelpers.findAndHookMethod;

/**
* Created by David on 3/30/2016.
*/
public class Tutorial implements IXposedHookLoadPackage {
@Override
public void handleLoadPackage(LoadPackageParam loadPackageParam) throws Throwable {
if (!loadPackageParam.packageName.equals("com.android.systemui"))
return;
XposedBridge.log("We are in SystemUI - David");
findAndHookMethod("com.android.systemui.statusbar.policy.Clock", loadPackageParam.classLoader, "updateClock", new XC_MethodHook() {
@Override
protected void afterHookedMethod(MethodHookParam param) throws Throwable {
TextView textView = (TextView) param.thisObject;
textView.append(":)");
}
});
}
}

My Manifest

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.david.clock">

<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<meta-data
android:name="xposedmodule"
android:value="true" />
<meta-data
android:name="xposeddescription"
android:value="Easy example which makes the status bar clock red and adds a smiley" />
<meta-data
android:name="xposedminversion"
android:value="30" />
</application>

</manifest>

And my xposed_init

com.example.david.clock.Tutorial

Any suggestions on what I may be doing wrong. because I am totally at a loss.

Thank you!

David
[XDA-University] hamzahrmalik:
I had this same issue and its yet to be resolved. Eclipse or Android Studio
[XDA-University] dave07747:
I'm using Android Studio for this
[XDA-University] hamzahrmalik:
I've been told there's an issue with the latest gradle and 1.5 will work. I haven't tried though so let me know if it does
[XDA-University] dave07747:
I just tried it with 1.4 and yeah, that did it. Now I have a smiley in my clock :) Thank you sooooo very much for that!!!!
[XDA-University] j2rong:
great tutorial
[XDA-University] samkpo:
Hi, first I want to thank you for the great tutorial ?

I want to know if it's possible to replace a string inside a method, and how to do it if possible...

Enviado desde mi Moto G mediante Tapatalk
[XDA-University] P1nGu1n_:
Show the method, this description is too vague
[XDA-University] samkpo:
I'm sorry, forgot that..

The text "sans-serif-medium" is the one I want to replace...

Enviado desde mi Moto G mediante Tapatalk
[XDA-University] P1nGu1n_:
No you can't replace that text in this method. But what you could do is hook TypeFace.create(...) and if the parameter equals 'sans-serif-medium' set it to whatever value you want.
[XDA-University] samkpo:
Thanks, that's a good idea, I'm gonna try it [emoji106]

Enviado desde mi Moto G mediante Tapatalk
[XDA-University] samkpo:
Nevermind. Delete message if possible..

~Is it possible to hook a method and replace a resource, both on the same Xposed class?~

Enviado desde mi Moto G mediante Tapatalk
[XDA-University] samkpo:
How and where would you do it? I've been trying without success...

Enviado desde mi Moto G mediante Tapatalk
[XDA-University] P1nGu1n_:
I'd do it like this. I've added comments to explain it. Please let me know if it works for you :)

public class XposedMod implements IXposedHookLoadPackage {

[MENTION=439709]override[/MENTION]
public void handleLoadPackage(XC_LoadPackage.LoadPackageParam lpparam) throws Throwable {
if (!lpparam.packageName.equals("com.replace.with.your.app")) {
return;
}

XposedHelpers.findAndHookMethod("android.graphics.Typeface", lpparam.classLoader, "create", String.class, int.class, new XC_MethodHook() {
// 'beforeHookedMethod' so we can replace the argument before the actual method is executed
[MENTION=439709]override[/MENTION]
protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
// 'param.args' are the arguments passed to the method, we get the first one and compare it
String name = (String) param.args[0];
if ("sans-serif-medium".equals(name)) {
// let's replace it
param.args[0] = "NEW NAME";
}
}
});
}
}

Note: I've not tested this.
[XDA-University] samkpo:
It worked! But there's a bug. It replaces all the coincidences, not just the one from the method I quoted. But it worked [emoji106]

Enviado desde mi Moto G mediante Tapatalk
[XDA-University] adlx.xda:
You can add more filtering to only alter parameters when you need, using these:

Name of the method calling the hooked method: param.method.getName()

Name of the class of the method calling the hooked method: param.thisObject.getClass().getName(),
[Galaxy S III Q&A, Help & Troubleshooting] Klar Klammer:
Hello there,

i am using the Stock E-Mail Client from my Galaxy S3 and now, i want to reset my Phone but there are > 3000 Mails stored in the local Sent-Folder.

I have used SMTP to send Emails, My Mail-Provider and the Stock Email Client doesnt support the Server Side Save of Emails.

Samsung have no Solution in Form of a Backup.

How i can Backup Email-folders, if possible without Root?

Regards
[Fire TV Q&A, Help & Troubleshooting] meber:
The first thing I noticed when I received my Fire TV was that it was auto linked to my amazon account that I purchased the unit with. Is this done with the RFID chip that was in the ifixit tear down pictures? I am trying to remember if I had to re-authenticate at any point or if purchases could be made immediately. I wouldn't want to have the device lost in transit if someone can make purchases from the get-go.
[Fire TV Q&A, Help & Troubleshooting] FISKER_Q:
No, the RFID chip is not even connected to anything.

I doubt they do anything to do the device, they probably just have some sort of serial no->user binding they use for the linking process when your box connects to the service.
[Fire TV Q&A, Help & Troubleshooting] meber:
I was thinking they scanned the RFID chip before shipping which contains the device serial number which then auto links it to your account.

But like I said if they come pre-connected.. if someone else took it would they be able to make unauthorized purchases.
[Fire TV Q&A, Help & Troubleshooting] kbowman:
I know for a fact how they do it. When the device is scanned for your order the devices s/n is recorded. Then when the device hits the internet Amazon sees the s/n and it automatically authenticates itself to your account.
[Fire TV Q&A, Help & Troubleshooting] meber:
Isn't this dangerous to send a pre-authenticated device shipped? Thanks for the confirmation though.
[Fire TV Q&A, Help & Troubleshooting] YoColdRain:
how would this work when you resell device.
[Fire TV Q&A, Help & Troubleshooting] tarvoke:
if they're tying the user to the device using the s/n, doesn't really matter if it's a bar code, qr code, rfid, etc... functionally all equivalent.

the rfid makes sense in that bar code labels wear off, rfid is easier to read for inventory, processing, shipping, returns/repairs etc. - you don't have to physically locate an optical code to scan it. it's probably a lot more prevalent than we think - you already see rfid-type stickers on the inside of packaging (in the past mostly for loss prevention?) - why not just put it inside the item itself.

but...

seems like amazon could have planned that a little better - yeah, anyone could take it and have access to your account.

also the fact that when I ordered, I was not given any option if the device was not meant for myself, no option for either a blank one or specify the recipient.

if I selected "as gift" at checkout, would it still put my account on it and then either I have to fix it or the gift recipient simply has to deal with it?

if I bought it for someone through their wishlist - same questions.

I think I read that you can change the amazon account on it. which is only common sense. so at least you can remove your account and give it to a friend or family, or sell it.

also have to wonder how they manage the association on their end - what if I do change the account on the device, then do whatever factory reset / total clean wipe? when it initializes again, which account will come up?
[Fire TV Q&A, Help & Troubleshooting] meber:
I have not tried this, but my guess is you log on to Amazon and click on devices and deregister your device. Then do a factory reset on the Fire TV.

Yeah, I hope this gets more attention.
[Fire TV Q&A, Help & Troubleshooting] sluflyer06:
If you go to settings there an option to de-authorize the FireTV, after you select this it will then prompt you to login to a Amazon account of your choosing.
[Fire TV Q&A, Help & Troubleshooting] tarvoke:
hm, yep, I went to "Your Devices" in my amazon account, and there's the firetv, registered at the date&time that I ordered it.

they haven't even shipped it yet lol, but they already registered it for me! is this how amazon does kindles too?

are people too incredibly lazy for the extra step of entering ID and password? (amazon wants to be super friendly like apple where "things just work right away" and screw that security nonsense?)

poking around my amazon account, I have the option to delete the device - hm I guess that *might* be one way to secure the firetv before you receive it, or if you're giving as a gift.

I think I'll delete it, before I boot it the first time, just to see - it shouldn't hurt anything... probably.

- expected case: makes me enter a new id/pass.

- worst case: limbo state where I can't enter id/pass.

- scary case: starts up normally with my ID anyway and re-adds the device in my account.
[Fire TV Q&A, Help & Troubleshooting] dimsumx:
It could also be from IP address association.