LNSSPsd / PodsGrant

Treat AirPods Pro 2 as AirPods Pro to get it working better on older operating systems (for a few iOS versions only)
MIT License
124 stars 13 forks source link

ios 15.0.2 support #6

Open Kimo1126 opened 1 year ago

Kimo1126 commented 1 year ago

Can you please add ios 15.0.2 support, or maybe make a small tutorial on how to add support . I attached my Bluetoothd file . Thnk you bluetoothd.zip

rastafaa commented 1 year ago

Someone already requested ios15.0.. maybe 0.2 would work with that

Kimo1126 commented 1 year ago

I tried, Didnt work.

rastafaa commented 1 year ago

I tried, Didnt work.

The tweak wasn’t published with that update yet

Kimo1126 commented 1 year ago

I tried, Didnt work.

The tweak wasn’t published with that update yet

I compiled it myself.

rastafaa commented 1 year ago

Oh yeah I see in the code it specifically looks for 15.0.0

It actually looks pretty simple to update for other versions but I don't have a mac to open the daemon file.. you could try just adding a 2 for the patch version in code though assuming the daemon hasn't changed?

LNSSPsd commented 1 year ago

Just compared them and the addresses seemed to be the same as iOS 15.0.0 one. Updated the source file.

By the way, as IPC wouldn't work at iOS 15, the buggy pop-ups and swipe-to-change-volume (idk how about iOS 15.0 but it's supported by native on iOS 15.3) wouldn't work currently as well. It just make it available in the accessibility list and I think that's all.

Kimo1126 commented 1 year ago

Just compared them and the addresses seemed to be the same as iOS 15.0.0 one.

Updated the source file.

By the way, as IPC wouldn't work at iOS 15, the buggy pop-ups and swipe-to-change-volume (idk how about iOS 15.0 but it's supported by native on iOS 15.3) wouldn't work currently as well. It just make it available in the accessibility list and I think that's all.

Thank you 🙏 i'll try it whene i get home.

Kimo1126 commented 1 year ago

Didn't work for me. Iphone 13 pro max 15.0.2 / xinaa15.

Kimo1126 commented 1 year ago

Didn't work for me. Iphone 13 pro max 15.0.2 / xinaa15.

Maybe something to do with airpods pro gen 2 model ? I see in apple website there's 3 different model (A2931, A2699, A2698) .

rastafaa commented 1 year ago

Notice what he said about it not working well on ios15.. it seems he is saying that it will only add it to accessibility list and not the other typical airpod features. So the tweak is probably working as intended for 15.

LNSSPsd commented 1 year ago

Didn't work for me. Iphone 13 pro max 15.0.2 / xinaa15.

Maybe something to do with airpods pro gen 2 model ? I see in apple website there's 3 different model (A2931, A2699, A2698) .

That could be the case, for me it's A2618, but not really sure about that. A way to verify that is to remove product ID matching of this tweak, that is making if(*(unsigned int*)(a1+product_id_offset)==0x2014) { always true, but have to make sure no other bluetooth devices connected when testing to avoid messing them up.

And please make sure you've killed bluetoothd after installation so that it could be injected.

Kimo1126 commented 1 year ago

Notice what he said about it not working well on ios15.. it seems he is saying that it will only add it to accessibility list and not the other typical airpod features. So the tweak is probably working as intended for 15.

He said the pop up and the slide to change volume wouldn't work.. but the main feature of the tweak is to make ios think that airpods pro gen 2 is airpods pro (first gen). My device still treat them like any generic Bluetooth earbuds.that's why im saying it donc work for me

Kimo1126 commented 1 year ago

Didn't work for me. Iphone 13 pro max 15.0.2 / xinaa15.

Maybe something to do with airpods pro gen 2 model ? I see in apple website there's 3 different model (A2931, A2699, A2698) .

That could be the case, for me it's A2618, but not really sure about that. A way to verify that is to remove product ID matching of this tweak, that is making if(*(unsigned int*)(a1+product_id_offset)==0x2014) { always true, but have to make sure no other bluetooth devices connected when testing to avoid messing them up.

And please make sure you've killed bluetoothd after installation so that it could be injected.

Mine is A2698.. i'll try what you suggest and let you know..and thankd for your support appreciate

LNSSPsd commented 1 year ago

Notice what he said about it not working well on ios15.. it seems he is saying that it will only add it to accessibility list and not the other typical airpod features. So the tweak is probably working as intended for 15.

He said the pop up and the slide to change volume wouldn't work.. but the main feature of the tweak is to make ios think that airpods pro gen 2 is airpods pro (first gen). My device still treat them like any generic Bluetooth earbuds.that's why im saying it donc work for me

Yep that means it didn't work for sure. The device should show AirPods Pro icon instead of bluetooth icon on the volume slider (of control center) in case it's working.

Kimo1126 commented 1 year ago

Didn't work for me. Iphone 13 pro max 15.0.2 / xinaa15.

Maybe something to do with airpods pro gen 2 model ? I see in apple website there's 3 different model (A2931, A2699, A2698) .

That could be the case, for me it's A2618, but not really sure about that. A way to verify that is to remove product ID matching of this tweak, that is making if(*(unsigned int*)(a1+product_id_offset)==0x2014) { always true, but have to make sure no other bluetooth devices connected when testing to avoid messing them up.

And please make sure you've killed bluetoothd after installation so that it could be injected.

Sorry to bother, can you give me the exact sentence to make it always true

rastafaa commented 1 year ago

Sorry to bother, can you give me the exact sentence to make it always true

I'm not much of a coder but I would guess removing that line 14 and the closing bracket at 16 would make it always true

Kimo1126 commented 1 year ago

Sorry to bother, can you give me the exact sentence to make it always true

I'm not much of a coder but I would guess removing that line 14 and the closing bracket at 16 would make it always true

didn't work. maybe he can just add support for other product id model (A2931, A2699, A2698) .

LNSSPsd commented 1 year ago

I'm sorry but I found it's my fault that I put the wrong offset value. Try the new one out.

Kimo1126 commented 1 year ago

I'm sorry but I found it's my fault that I put the wrong offset value. Try the new one out.

still didn't work :(

LNSSPsd commented 1 year ago

I'm sorry but I found it's my fault that I put the wrong offset value. Try the new one out.

still didn't work :(

Sorry hearing that, I'll try figuring it out with my rootless device.

Kimo1126 commented 1 year ago

I'm sorry but I found it's my fault that I put the wrong offset value. Try the new one out.

still didn't work :(

Sorry hearing that, I'll try figuring it out with my rootless device.

Thanks for your support 🙏

bobjenkins603 commented 1 year ago

I'm sorry but I found it's my fault that I put the wrong offset value. Try the new one out.

still didn't work :(

Sorry hearing that, I'll try figuring it out with my rootless device.

I compiled from latest and tested on 15.0, battery levels are working with updated offset.

LNSSPsd commented 1 year ago

Did some updates and got it worked on my rootless device, try it out.

Remember to kill bluetoothd after installation. For Fugu15 Max the vmaddr slide is 1 instead of 0 so I made it so, but I am not quite sure about how was it on XinaA15, if you find the bluetoothd is crashing try changing the vmaddr slide back to 0.

bobjenkins603 commented 1 year ago

Did some updates and got it worked on my rootless device, try it out.

Remember to kill bluetoothd after installation. For Fugu15 Max the vmaddr slide is 1 instead of 0 so I made it so, but I am not quite sure about how was it on XinaA15, if you find the bluetoothd is crashing try changing the vmaddr slide back to 0.

Compiled with new changes, still no working volume adjustments. Bluetoothd doesn’t crash, and is receiving volume change request from airpods, and sends to mediaserverd. See attached image, can send better logs on discord if you’d like. 9740A647-64D8-4E99-9DBF-57CFBA37E7B5 047C1E4A-3DA4-4E2E-A76B-E5B81F711326

Also, sometimes bluetoothd refuses to send volume change request for some reason. 9A116A84-F8D1-460F-9949-79282E46D446

Model name: ACCESSORY_MODEL_NAME_20 Model number: A2698

LNSSPsd commented 1 year ago

Did some updates and got it worked on my rootless device, try it out. Remember to kill bluetoothd after installation. For Fugu15 Max the vmaddr slide is 1 instead of 0 so I made it so, but I am not quite sure about how was it on XinaA15, if you find the bluetoothd is crashing try changing the vmaddr slide back to 0.

Compiled with new changes, still no working volume adjustments. Bluetoothd doesn’t crash, and is receiving volume change request from airpods, and sends to mediaserverd. See attached image, can send better logs on discord if you’d like. 9740A647-64D8-4E99-9DBF-57CFBA37E7B5 047C1E4A-3DA4-4E2E-A76B-E5B81F711326

Also, sometimes bluetoothd refuses to send volume change request for some reason. 9A116A84-F8D1-460F-9949-79282E46D446

Model name: ACCESSORY_MODEL_NAME_20 Model number: A2698

The model name doesn't seem like it worked well, have you killed bluetoothd after installing? Also, how was accessibility settings, do they appear after installing the tweak? Volume adjustment is currently not going to work for iOS 15+ by applying this tweak, but your log seems to be helpful and I will try working on it later. And what's the name for that tweak showing logs, it looks quite helpful.

rastafaa commented 1 year ago

I tried compiling with theos but all I get is errors so I gave up on it.. guess I'll wait to get from repo. Also wondering what this logging tool is never seen it before.

Kimo1126 commented 1 year ago

the tweak name is antoine from chariz repo. no accessibility settings .

Kimo1126 commented 1 year ago

I tried compiling with theos but all I get is errors so I gave up on it.. guess I'll wait to get from repo. Also wondering what this logging tool is never seen it before.

you have to replace Lightmessangin.h file in theos directory with this one. https://github.com/rpetrich/LightMessaging

bobjenkins603 commented 1 year ago

The model name doesn't seem like it worked well, have you killed bluetoothd after installing? Also, how was accessibility settings, do they appear after installing the tweak? Volume adjustment is currently not going to work for iOS 15+ by applying this tweak, but your log seems to be helpful and I will try working on it later. And what's the name for that tweak showing logs, it looks quite helpful.

Killed bluetoothd in xina processview after installing. Accessibility does not appear. Antoine on Chariz repo.

rastafaa commented 1 year ago

you have to replace Lightmessangin.h file in theos directory with this one. https://github.com/rpetrich/LightMessaging

Now you tell me after I wasted hours and deleted everything lol

Kimo1126 commented 1 year ago

you have to replace Lightmessangin.h file in theos directory with this one. https://github.com/rpetrich/LightMessaging

Now you tell me after I wasted hours and deleted everything lol

😂 You didn't ask

LNSSPsd commented 1 year ago

Thanks. You can uncomment line 16,17,53,54,162,163,164 to have your airpods' product ID in a log in /tmp. Tell me what it is if possible, PRODID: %d. Make sure only airpodspro2 connected so that it won't be messed up. For me it's 0x2014=8212, just like what in the source file. The log file for this would appear at /tmp/bluetoothd.txt, if that file doesn't appear, it means that the hooking failed.

Kimo1126 commented 1 year ago

Thanks. You can uncomment line 16,17,53,54,162,163,164 to have your airpods' product ID in a log in /tmp. Tell me what it is if possible, PRODID: %d. Make sure only airpodspro2 connected so that it won't be messed up. For me it's 0x2014=8212, just like what in the source file. The log file for this would appear at /tmp/bluetoothd.txt, if that file doesn't appear, it means that the hooking failed.

There' no PRODID: in the log file. it only contain :

PREP, MYPID 9613 PREP, MYPID 9643

LNSSPsd commented 1 year ago

Then it's hooking failure. Try turning vmaddr slide to 0. (_dyld_get_image_vmaddr_slide(1) -> _dyld_get_image_vmaddr_slide(0)) and uncomment line 205,206 to ensure it's not a version comparison failure.

Kimo1126 commented 1 year ago

PREP, MYPID 13487 FOUND ENTRY PREP, MYPID 13550 FOUND ENTRY

LNSSPsd commented 1 year ago

Quite weird to have hooking not working.

LNSSPsd commented 1 year ago

Not sure but this could be related:

With Xina 1.1.4 switching to libhooker, the 2 necessary functions MSHookMemory and MSHookFunction are now working as intended. This means that game mods should also work. With a couple of small fixes from my side, my mods work on my device (A12, 15.1)

Best way to see if MSHookFunction is working could be hooking a null pointer and if it crashes it works. Another case could be that there are more than 1 binaries injected in an order prior to the binary itself, in such case just try some more vmslide number, such as 2,3,4,etc.

bobjenkins603 commented 1 year ago

Not sure but this could be related:

With Xina 1.1.4 switching to libhooker, the 2 necessary functions MSHookMemory and MSHookFunction are now working as intended. This means that game mods should also work. With a couple of small fixes from my side, my mods work on my device (A12, 15.1)

Best way to see if MSHookFunction is working could be hooking a null pointer and if it crashes it works. Another case could be that there are more than 1 binaries injected in an order prior to the binary itself, in such case just try some more vmslide number, such as 2,3,4,etc.

Tested on latest xina 1.1.8-f2 (from cypwn). I checked it out in frida, product id is 8212, but does not show in the log file. "BTDetails_ProductID" = "BTHeadphones76,8212"

I will say that xina versions > 1.1.6.2 have bugged mediaserverd, so I will give that version a chance.

Kimo1126 commented 1 year ago

Not sure but this could be related:

With Xina 1.1.4 switching to libhooker, the 2 necessary functions MSHookMemory and MSHookFunction are now working as intended. This means that game mods should also work. With a couple of small fixes from my side, my mods work on my device (A12, 15.1)

Best way to see if MSHookFunction is working could be hooking a null pointer and if it crashes it works. Another case could be that there are more than 1 binaries injected in an order prior to the binary itself, in such case just try some more vmslide number, such as 2,3,4,etc.

now it works as itended, i made the 4 entry vmslide to 1 .hope you'll find a workaround for the slide to change volume. thanks for you support

LNSSPsd commented 1 year ago

Not sure but this could be related:

With Xina 1.1.4 switching to libhooker, the 2 necessary functions MSHookMemory and MSHookFunction are now working as intended. This means that game mods should also work. With a couple of small fixes from my side, my mods work on my device (A12, 15.1)

Best way to see if MSHookFunction is working could be hooking a null pointer and if it crashes it works. Another case could be that there are more than 1 binaries injected in an order prior to the binary itself, in such case just try some more vmslide number, such as 2,3,4,etc.

now it works as itended, i made the 4 entry vmslide to 1 .hope you'll find a workaround for the slide to change volume. thanks for you support

Oh, perfect! Good to hear that, thanks for your hard tries too.

rastafaa commented 1 year ago

you have to replace Lightmessangin.h file in theos directory with this one. https://github.com/rpetrich/LightMessaging

Wow that really did fix the issue..! Thanks, I was able to compile the tweak now. Though I got several warnings about it not finding a rootful directory.

Kimo1126 commented 1 year ago

you have to replace Lightmessangin.h file in theos directory with this one. https://github.com/rpetrich/LightMessaging

Wow that really did fix the issue..! Thanks, I was able to compile the tweak now. Though I got several warnings about it not finding a rootful directory.

Good to hear that. You're welcome mate

saadumar786 commented 1 year ago

So this tweak works fully as intended on Xina15 ios 15.0.2 ? I am thinking about purchasing Airpods pro 2 . It would make my decision much easier lol. Thanks for all the hard work

bobjenkins603 commented 1 year ago

So this tweak works fully as intended on Xina15 ios 15.0.2 ? I am thinking about purchasing Airpods pro 2 . It would make my decision much easier lol. Thanks for all the hard work

Yes, but you must install rootless via saily, which breaks sileo. So perfectly fine and working for me as I use saily for a package manager.

saadumar786 commented 1 year ago

I think i will wait for official Fugu release. Thanks