yashsingh1/xdaforums huggingface dataset:
[Xposed Framework Modules] VD171:
Yes.
[Xposed Framework Modules] Schroeder09:
Anyone having any interesting use case for this that they have been using? This looked really exciting when it came out. Idk enough about hooks to write them myself though.
[Xposed Framework Modules] zhipingne:
After some investigating, I found that it has many custom parameters and other stuff going on, so creating a complete compatible converter would be very difficult. Therefore, I probably won’t work on it, sorry.
[Xposed Framework Modules] anuraag.neo:
ok but there is a hook which i wonder how to do.

"className": "android.content.Intent",
"methodName": "CREATOR:createFromParcel",
"parameterTypes": [
"android.os.Parcel"
],
"returnType": "android.content.Intent",

It's hooking intent.

Another one

"className": "android.content.ClipData",
"methodName": "CREATOR:createFromParcel",
"parameterTypes": [
"android.os.Parcel"
],
"returnType": "android.content.ClipData",
[Xposed Framework Modules] zhipingne:
local Intent = import("android.content.Intent")
local Parcel = import("android.os.Parcel")
local ClipData = import("android.content.ClipData")

hook {
class = Intent.CREATOR:getClass(),
returns = Intent,
method = "createFromParcel",
params = {
Parcel
},
replace = function(this, params)
print("replace Intent.CREATOR.createFromParcel")
return Intent(params[1])
end
}

hook {
class = ClipData.CREATOR:getClass(),
returns = ClipData,
method = "createFromParcel",
params = {
Parcel
},
replace = function(this, params)
print("replace ClipData.CREATOR.createFromParcel")
return Intent(params[1])
end
}

Refs:

XPrivacyLua/app/src/main/java/eu/faircode/xlua/XLua.java at 85a1e498d5a9dbb902ca3d83e987ae6eec377d7a · M66B/XPrivacyLua

Really simple to use privacy manager for Android 6.0 Marshmallow and later - M66B/XPrivacyLua

github.com

XPrivacyLua/DEFINE.md at master · M66B/XPrivacyLua

Really simple to use privacy manager for Android 6.0 Marshmallow and later - M66B/XPrivacyLua

github.com
[Xposed Framework Modules] anuraag.neo:
Thanks for this but I'm still struggling to find Intent action. XprivicyLua has getResult() function which returns Intent.

I think below code will give me action?

Intent(params[1]):getAction()
[Xposed Framework Modules] zhipingne:
Try this snippet, If any error please send to me.

local Intent = import("android.content.Intent")
local Parcel = import("android.os.Parcel")

hook {
class = Intent.CREATOR:getClass(),
returns = Intent,
method = "createFromParcel",
params = {
Parcel
},
replace = function(this, params)
print("replace Intent.CREATOR.createFromParcel")
local ret = Intent(params[1])
print("action " .. ret:getAction())
return ret
end
}

Here maybe is what you want, but now WeiJu2 cannot read the method's original return value `ret' for now (this is a bug I'll fix it later)

local Intent = import("android.content.Intent")
local Parcel = import("android.os.Parcel")

hook {
class = Intent.CREATOR:getClass(),
returns = Intent,
method = "createFromParcel",
params = {
Parcel
},
-- Not Implemented: Should have access for original return value
-- v
after = function(this, params, ret)
print("action " .. ret:getAction())
return ret
end
}
[Xposed Framework Modules] anuraag.neo:
It's working but there are some errors for nil values. I think i have to use a check for nill values

E attempt to concatenate string and nil
E │ 22 print("replace Intent.CREATOR.createFromParcel")
E │ 23 local ret = Intent(params[1])
E └╴24 print("action " .. ret:getAction())
E 25 return ret
E 26 end

Another question how to get context? In xlua we have param:getApplicationContext()
[Xposed Framework Modules] zhipingne:
Wrap up you code inside a other hook will do.

local Intent = import("android.content.Intent")
local Parcel = import("android.os.Parcel")
local Application = import("android.app.Application")

hook {
class = Application,
returns = void,
method = "onCreate",
-- if won't work, try replace `before` with `after`
before = function(this, params)
local applicationContext = this

hook {
class = Intent.CREATOR:getClass(),
returns = Intent,
method = "createFromParcel",
params = {
Parcel
},
replace = function(this, params)
print("replace Intent.CREATOR.createFromParcel")
local ret = Intent(params[1])
print("action " .. ret:getAction())
print("context " .. applicationContext)
return ret
end
}
end
}
[Xposed Framework Modules] anuraag.neo:
Thanks for all help. I'll use this when needed.

There is one thing i dislike that when a script is need to apply on multiple apps then we have to create same script multiple times. Can you make it automatically available in Available Scripts for other apps or something better?

Edit: Ok there is Global scope option. So that might work.

Edit2: There is some serious bug present where your app unable to save preferences, scripts. On restarting app loads some old state.
[Xposed Framework Modules] zhipingne:
For Edit2: I couldn't reproduce this on my devices. Please make sure when you modify scripts WeiJu2 was checked in LSPosed, because the scripts are save at two different path in the active and non-active states.
[Xposed Framework Modules] anuraag.neo:
I noticed same. Where does WeiJu2 save when LSPosed is inactive?

Does backing up script_store is enough to restore WeiJu2?
[Xposed Framework Modules] zhipingne:
Yes, all the scripts data are saved in script_store.xml

For storing path please refer: https://xdaforums.com/t/app-xposed-7-0-weiju2-scriptable-xposed-module.4482585/post-87835247
[Xposed Framework Modules] anuraag.neo:
Hi

I'm trying to port an hook from xlua but it seems to not working

"className": "android.content.pm.PackageManager",
"methodName": "queryIntentActivities",
"parameterTypes": [
"android.content.Intent",
"android.content.pm.PackageManager$ResolveInfoFlags"
],
"returnType": "java.util.List",
"minSdk": 33,

Script: https://github.com/M66B/XPrivacyLua/blob/master/app/src/main/assets/generic_filter_by_uid.lua

Here is script i have created for testing but there is nothing happens while it works on xlua. Is it happening due to abstract class?

local PackageManager = import("android.content.pm.PackageManager")
local Intent = import("android.content.Intent")
local Flags = import("android.content.pm.PackageManager$ResolveInfoFlags")

hook {
class = PackageManager,
returns = List,
method = "queryIntentActivities",
params = {
Intent,
Flags
},
after = function(this, params, ret)
print("hooked")
end
}
[Xposed Framework Modules] anuraag.neo:
Hi

ArrayList:size() throws error attempt to call a number value

local Toast = import("android.widget.Toast")
local Activity = import("android.app.Activity")
local Bundle = import("android.os.Bundle")

-- Hook a method
hook {
class = Activity,
returns = void,
method = "onCreate",
params = {
Bundle
},
after = function(this, params)
local arrayListCls = luajava.bindClass('java.util.ArrayList')
local aList = luajava.new(arrayListCls)
Toast:makeText(this, aList:size(), Toast.LENGTH_SHORT):show()
end,
}
[Xposed Framework Modules] zhipingne:
Confirmed, I will fix this later. Thank you!
[Xposed Framework Modules] anuraag.neo:
Hi

Below hook not working with your app and XprivicyLua but with one of the closed source scriptable app it works. Can you please look into.

local Account = import("android.accounts.Account")
local Parcel = import("android.os.Parcel")

hook {
class = Account.CREATOR:getClass(),
returns = Account,
method = "createFromParcel",
params = {
Parcel
},
after = function(this, params, ret)
print("hooked Account.CREATOR:getClass()")
end
}
[Xposed Framework Modules] Schroeder09:
Sorry I'm no dev. I'm very curious about these hooks and scripts though. I lurk in this thread often. What does this one do?
[Xposed Framework Modules] wyt18:
Is it possible to use this to change DPI in Android Auto? Any guide as to how to start? Thanks!
[Xposed Framework Modules] bush911:
This seems great. But coding is really beyond my ability. Stay with XprivacLua as long as I can.
[Xposed Framework Modules] Gogu24:
How can I hook a function that takes an int array as an argument? params = { int[] } doesn't work
[Xposed Framework Modules] zhipingne:
Try this one

intArray = luajava.bindClass("[I")

params = { intArray }
[Xposed Framework Modules] jet_iso:
Hi zhipingne,

Just want to get device android version and do somethins according to it.

Just wrote the logic. Ignore typos and syntax :)
[Xposed Framework Modules] zhipingne:
You can import the Build class and then assets it's static members.

local Build = import("android.os.Build")
local sdkInt = Build.VERSION.SDK_INT

if sdkInt > 30 then

end

if sdkInt < 26 then

end
[Xposed Framework Modules] jet_iso:
What about a method?

I want to read "android.os.Build.getserial()"...

That's all I need. I'll do the rest. Thanks.
[Xposed Framework Modules] zhipingne:
Just do `Build.getSerial()` when the method is static.

If you want to call a member method say `car.run()`, do the following

local Car = import("xxx.xxx.Car")
local car = Car() -- call the constructor

car:run() -- syntax sugar for car.run(car)
[Xposed Framework Modules] jet_iso:
I get "method cannot be called without instance"

getSerial is "public static String getSerial ()" in Android API.

I think I missed or not understand somethins but couldn't find it...

Here is my code, it's the very simple;

local Build = import("android.os.Build")
local gS = Build.getSerial()
[Xposed Framework Modules] zhipingne:
Ah, I forgot that calling a static method also need use `:` operator, this should work.

local Build = import("android.os.Build")
local gS = Build:getSerial()
[Xposed Framework Modules] jet_iso:
Ok. Perfect.

I'm currently having some issues with XPrivacyLua on my device. So I decided to write my own privacy tool with WeiJu2. So far so good.

I have 5 diffrent package but want to add some sdk etc check like XPL. I'll upload them to github when ready.
[Xposed Framework Modules] jet_iso:
A question;

There is a method (actually there are many methods like this) that throws exception. I could not manage to reproduce this...

There is a soluyion for this on Fif_'s XPL scripts but I did not understand that too... Couldn't port his solution.

Could you please help me with that?

Class : https://developer.android.com/refer...Manager#getPackageGids(java.lang.String, int)

My hook;

local target = import("android.content.pm.ApplicationInfo")
local intArray = luajava.bindClass("[I")
local AList = import("java.util.ArrayList")

hook {
class = target,
returns = intArray,
method = "getPackageGids" ,
params = {String, int} ,
replace = function(this, params)
local resp
resp = AList()

return resp
end
}

WeiJu console log;

vm error: java.lang.IllegalArgumentException: Can not hook abstract methods: public abstract int[] android.content.pm.PackageManager.getPackageGids(java.lang.String, int) throws android.content.pm.PackageManager$NameNotFoundException

hook {
class = target,
returns = intArray,
[Xposed Framework Modules] zhipingne:
The exception message is quite clear: you simply cannot hook an abstract method. Also, there is a casting error in your hook. `getPackageGids` should return an `int array`, not an `ArrayList`.

See: https://stackoverflow.com/questions/66523720/xposed-cant-hook-getinstalledapplications

hook {
class = target,
returns = intArray,
method = "getPackageGids" ,
params = {String, int} ,
replace = function(this, params)
return { 1234 }
end
}
[Xposed Framework Modules] jet_iso:
Ooh. Just ignore ArrayList line. I forgot to remove it. That's a part of my script.

There is a working hook method on fif_'s xpl script. I'm trying to port it...
[Xposed Framework Modules] anuraag.neo:
Change android.content.pm.PackageManager to android.app.ApplicationPackageManager
[Xposed Framework Modules] mGforCe:
Hi, I am not a programmer but want to use WeiJu2 to disable access to contacts to few apps.

Any simple guide here?
[Xposed Framework Modules] anuraag.neo:
Below code ported from xlua to block contacts

local ContentResolver = import("android.content.ContentResolver")

local Uri = import("android.net.Uri")
local strArr = import("[Ljava.lang.String;")
local CancellationSignal = import("android.os.CancellationSignal")
local Bundle = import("android.os.Bundle")

local Cursor = import("android.database.Cursor")
local MatrixCursor = import("android.database.MatrixCursor")

hook {
class = ContentResolver,
returns = Cursor,
method = "query",
params = {
Uri,
strArr,
String,
strArr,
String
},
after = function(this, params, ret)
if (params[1]:getAuthority() == 'com.android.contacts') then
local fake = MatrixCursor(ret:getColumnNames())
return fake
end
end
}

hook {
class = ContentResolver,
returns = Cursor,
method = "query",
params = {
Uri,
strArr,
String,
strArr,
String,
CancellationSignal
},
after = function(this, params,ret)
if (params[1]:getAuthority() == 'com.android.contacts') then
local fake = MatrixCursor(ret:getColumnNames())
return fake
end
end
}

hook {
class = ContentResolver,
returns = Cursor,
method = "query",
params = {
Uri,
strArr,
Bundle,
CancellationSignal
},
after = function(this, params, ret)
if (params[1]:getAuthority() == 'com.android.contacts') then
local fake = MatrixCursor(ret:getColumnNames())
return fake
end
end
}
[Xposed Framework Modules] mGforCe:
Thanks Anuraag.

By the way, even this is beyond my comprehension (as of now). Will read little more and then try to use.
[Xposed Framework Modules] welcometopwn:
I'm was wondering how i could bypass integrity check (root, unlocked bootloader and so on) of an app?

Very new to this so any help is appreciated.
[Xposed Framework Modules] traversone:
Hi all,

I am not a programmer but want to use WeiJu2 to control/change the "uimode" for Skygo app.

This app is not supposed to run/work on AndroidTV devices but it works on some Android Boxes whose TVSettings contain per app feature to change the UiMode from Television to Normal or even other modes.

On some others (i.e. AOSP Slimbox ROM) the app fails as detects some TV feature (AOSP must not even have ).

Please, any simple guide here?

thank you!
[Xposed Framework Modules] RootedLee:
[EDIT]: thx to zhipingne: working up to Android 13 (partially working in Android 14)

I opened an issue at GitHub/WeiJu2 because the settings auto-imported from WeiJu "legacy/ classic" 0.3.7/ 0.3.8 do not result in the desired app's locale be changed. Please anybody see if you have any input:

[working up to Android 13] Script to change an app's locale/ language​
[Xposed Framework Modules] oleg543:
Has anyone tried to create Java arrays? You can hook a method with an array in its parameters using import("[Java.lang.Object;"), for example. But how do I call the method where I need to pass such an array? newInstance crashes with NPE :(

Issue with details: https://github.com/ikws4/WeiJu2-Scripts/issues/6
[Introductions] ItzKaguya:
Hello. I'm just a normal guy who likes to help out in the Galaxy A10s Development Group on telegram, and this is my first time creating an XDA account. I'm currently working on 64-bit Vendor development (6 months ago), Device Tree (a year ago), and Custom Recovery for Galaxy A10s devices. I hope my presence at XDA can help all of you. Thank you
[Introductions] galaxys:
Welcome to XDA and enjoy the forums! 🙂

Nice introduction and A10 experience!

Cheers
[Introductions] ItzKaguya:
Thanks 😃
[General Questions and Answers] laocheebye:
Is probably because of the fact that people who really knows the answer do not care to read this part of the forum. Agree people?
[General Questions and Answers] nir36:
There are plenty of people who read this section of the forum every day and come up with answers.

chill.
[General Questions and Answers] BigE:
Do people really read this section? and answer?

Shalom Nir,

In almost 2 years of daily reading in the forum I have to admit I hardly read the question section... Look for yourself at any given moment - over 600 view the hack part, less than 10 in the question part...

Do the math - it is x60 likely to get an answer if it is published in the hack part. Not that you are not right, it is against human nature..;)
[General Questions and Answers] nir36:
hehe. the questions & answers section only exists for about... 2 weeks now... that might be the reason :)
[General Questions and Answers] joel2009:
if you post in the development and hacking now you are asked to post here (or yelled at) and your thread may be moved or deleted. people are in that section to work on or download software, not to answer questions like "which is better, throttle launcher or wad"

as the section grows more and more, and people become more aware of it, they don't answer your questions there.

Another thing, when people log on they usually do look through the questions section to see if they can be a help, but if they can't then they move along. in other word people don't "dily-daly" around, they get the job done and then move on.
[General Questions and Answers] nir36:
percisely put.
[General Questions and Answers] hotrod101:
Every time I visit this site, I pay a visit to the Questions and asnwers forum. (since the QandA section has existed) First I check my previous posts to see if I can help those people first, then I search the QandA section to see if I can help with some of the new questions. If I can Help, I do try, if I can't I don't say anything and I leave to begin my own searching and reading, I constantly check back to New Posts to see if anyone has any new quetions I may be able to help with as well. This section does not show many people visiting because you don't need to stay long such as in the DandH section. there just isn't that much reading to do here as there is there.
[General Questions and Answers] BigE:
Well put answers...

Sorry for playing the devil's advocate for you guys. I just pointed out what seems obvious. i did not even notice the Q&A section is that young... Silly me.:)

OK, you got me, from now on I am going to pay a visit to this section (as I just did). I don't post much but I am a WM user for 3 years now, starting with ETEN G500 , moving on with HTC P3600 and hopefully getting a touch HD as soon as it is supporting 3G in the US (yes, i still hope it will in the near future against current posts). My poor trinity is my witness, as there isn't one WWE ROM I did not test...:D

Since i am not a cooker, nor a talented graphic designer, I will try to help on this section as much as I can. Thanks for all the cookers , they are the ones to blame I hardly sleep since i was introduced to this forum...:rolleyes:
[General Questions and Answers] nir36:
i'll drink to that :)
[General Questions and Answers] Iceman692:
Theoretically I agree with those defending the section. However, I just posted a question and 368 people are in dev and hacking and 1 person is in Q&A....me. Maybe it will take a little time for people to journey over that way. we shall see.
[General Questions and Answers] nir36:
it doesn't matter how many people are in the Dev&Hack section and how many in the Q&A section.

the dev&hack section is NOT intended for questions, it's intended for Development and Hacking.

the fact that people spend most of their forum time there is natural because they can get the latest updates for their apps.

you can't expect people to sit in the Q&A section, it's pointless. as joel said, you pass by, check if there's something you can solve, and move on.
[Moto G 2015 General] WildZammi:
Hi all,

I had a Moto G3 for more than a year now. Until May this year I used it with the stock ROM, then my bank stopped supporting Android 6...

I switched to @TheForce 's LOS 16, which worked well until now. Big up to him for maintaining the most recent and stable android for this phone!!!

The last weeks, I experienced several problems:

1. first, the proximity sensor didn't work anymore (works again after I cleaned the dust inside)

2. Then the speaker randomly stopped working. This is a known issue (bad contact between speaker and the board).

Since yesterday, my phone doesn't want to start antymore: it asks me for a password to start Android (I never encrypted anything). When entering my Pin/password, it tells me decyphering is good, but data is corrupt.

I tried to format, repair or wipe data in TWR, but nothing worked (unable to mount data, formatting data with f2fs never ended - I had to interrupt with power button after 2hours without progress).

Fastboot and TWRP work, but adb is impossible (device not found). When trying to format data via fastboot it tells me:

(Bootloader) slot-count: not found

(Bootloader) slot-suffixes: not found

(Bootloader) has-slot:data: not found

When trying to format data in another format with TWRP, it ends with an error on mmcblk0p42 (that corresponds to my data partition)...

I have a full adb backup, but can't restore it, as adb does not work...

How can I make the phone work again without worsening things?

And what might be the problem that caused the problem with the data partition firsthand? Hardware failure?

I now tried to repair with Rescue and Smart Assistant. First attempt took 1,5h to complete fastboot flash, then fastboot mode hang and rebooting but me in bootloop (failed to validate Recovery image).

I'm trying RSA rescue again, hoping that will work...

Thanks for your help, as I need my phone on Monday...
[General Topics] eddiewould:
OnePlus 9 running LineageOS (Android 12). I've got the "driving mode" app working (replacement for Android Auto) via a tile on my home screen.

In the "Driving Mode" settings section of my Google Assistant settings, the option

"When connected to car's Bluetoth" is set to "Launch Driving Mode"

yet when I'm in the car, although my headunit (JVC) connects to the phone's bluetooth, driving mode does not start.

Under Android Auto I could previously set which device should start it, however I can't find any equivalent option for Driving Mode. How is this magic supposed to work?
[General Topics] eddiewould:
As per this Reddit thread
[General Topics] eddiewould:
As suggested in the #lineageos subreddit, renaming the paired Bluetooth device (on my phone) to "Car audio" made it work!!!
[LG G8X ThinQ Questions & Answers] Brando81:
I'm at my wit's end on this. Calls stopped working the other day due to 3G disablement as far as I can tell. AT&T model unlocked and using with Simple Mobile on T-Mobile network. Calls would just say "Calling" for a long time and then eventually disconnect. I could switch to GSM and make calls again, but slow data. Simple told me to get a new SIM and when trying to activate, it shows ineligible IMEI due to no Volte it seems.

I'm trying to get that fixed, but running into various issues.

LM-G850UM

I tried to crossflash (https://xdaforums.com/t/tutorial-crossflash-bypass-opid-mismatched-error.4345963/)

I flashed G850QM30c_00_NAO_US_OP_0224.kdz but it didn't ask me to change the model, so it still shows LM-G850UM software G850UM30c. IMEI is the same.

Since this didn't get calls back or Volte, I tried updating the MBN (https://xdaforums.com/t/guide-no-ro...ther-qualcomm-powered-lg-devices-too.4343655/)

Data shows 4G. Calls don't even try to connect.

I don't know what to do next and don't have much time to try to figure it out. I like the G8X, so I'm hoping there's a way to save it.

Any thoughts from the experts?
[LG G8X ThinQ Questions & Answers] Surgemanxx:
Make a back up,and cross flash it with T-Mobile firmware.Problem solved.
[LG G8X ThinQ Questions & Answers] Brando81:
Thanks Surge!

I crossflashed to general firmware. Where's the best place for the TMobile firmware? Just off their website? Will that lock the phone again, or will I still be able to use the Simple Mobile Service?
[LG G8X ThinQ Questions & Answers] Surgemanxx:
It shouldn't lock the device if it's already unlocked.You can also use G8 firmware as well.(same device)Look here,this should get you the firmware you need.

Models - LG-Firmwares.com

Free archive of LG firmwares. Comparison of features and reviews of all mobile devices. Quick download of updates for your device.

lg-firmwares.com
[LG G8X ThinQ Questions & Answers] Brando81:
Thanks again, Surge.

That's where I got my KDZ before. I used the one here: https://lg-firmwares.com/lg-lmg850qm-firmwares/ and used the 3/24/22 version for Android 11. When I flashed it with LG UP, it didn't ask me to change models, which I'm not sure if that's why it didn't trigger it to start working again.