[MODULE] PNG patch for OP5T OPLongshot

Search This thread

E66666666

Senior Member
May 23, 2013
237
70
Woah, awesome! Always wanted OnePlus to revert their stupid decision.

Works great on my OnePlus 3, on OOS 9.0.6.
 

LoganDark

Senior Member
Dec 27, 2014
159
48
Alright, I did you all a favor and coded up some XPrivacyLua hooks that make the screenshot application produce PNG screenshots. I've attached it to this post. There are a total of 6 and they can be installed for free with the "XPrivacyLua Pro" companion app (without actually purchasing Pro).

Import them all, make sure that "Correctness" is checked in the "Global values" section, then go into XPrivacyLua, navigate to Screenshot (com.oneplus.screenshot), make sure "Force stop automatically" is checked, then check the "Longshot.JPEG" group.

Ta-da, you should have PNG screenshots. You can use an app like MiXplorer to verify the file name, and you can just... zoom in to see the immediate quality improvement. It's amazing.

There's a check for the Screenshot app in each hook so that you can leave "restrict new apps" on like I do, without intercepting random unrelated calls to String.format or StringBuilder.append.

I think this works on all versions of the Screenshot app, though I only tested it on OOS10 on the 7 Pro.

Here is a nice PNG screenshot to prove it works:

Screenshot_20201207-013150.png
 

Attachments

  • LongshotPNG.zip
    3.5 KB · Views: 36
Last edited:
  • Like
Reactions: Piijixei

Piijixei

New member
Jan 24, 2021
1
1
Alright, I did you all a favor and coded up some XPrivacyLua hooks that make the screenshot application produce PNG screenshots. I've attached it to this post. There are a total of 6 and they can be installed for free with the "XPrivacyLua Pro" companion app (without actually purchasing Pro).

Import them all, make sure that "Correctness" is checked in the "Global values" section, then go into XPrivacyLua, navigate to Screenshot (com.oneplus.screenshot), make sure "Force stop automatically" is checked, then check the "Longshot.JPEG" group.

Ta-da, you should have PNG screenshots. You can use an app like MiXplorer to verify the file name, and you can just... zoom in to see the immediate quality improvement. It's amazing.

There's a check for the Screenshot app in each hook so that you can leave "restrict new apps" on like I do, without intercepting random unrelated calls to String.format or StringBuilder.append.

I think this works on all versions of the Screenshot app, though I only tested it on OOS10 on the 7 Pro.

Here is a nice PNG screenshot to prove it works:

View attachment 5150015
Thank you so much for this! Works on a OnePlus 5T running OOS 10.
 
  • Like
Reactions: LoganDark

urbanman2004

Senior Member
Sep 16, 2013
416
197
Rock Town
Alright, I did you all a favor and coded up some XPrivacyLua hooks that make the screenshot application produce PNG screenshots. I've attached it to this post. There are a total of 6 and they can be installed for free with the "XPrivacyLua Pro" companion app (without actually purchasing Pro).

Import them all, make sure that "Correctness" is checked in the "Global values" section, then go into XPrivacyLua, navigate to Screenshot (com.oneplus.screenshot), make sure "Force stop automatically" is checked, then check the "Longshot.JPEG" group.

Ta-da, you should have PNG screenshots. You can use an app like MiXplorer to verify the file name, and you can just... zoom in to see the immediate quality improvement. It's amazing.

There's a check for the Screenshot app in each hook so that you can leave "restrict new apps" on like I do, without intercepting random unrelated calls to String.format or StringBuilder.append.

I think this works on all versions of the Screenshot app, though I only tested it on OOS10 on the 7 Pro.

Here is a nice PNG screenshot to prove it works:

View attachment 5150015
So I tried installing your hooks in XprivacyLua Pro by going to ≡ -> Import all settings, however I get a grayed out popup that says "Buy this pro feature". Not sure what I might've missed. Since I'm not as well versed in using XprivacyLua Pro I maybe could have overlooked something .
 

LoganDark

Senior Member
Dec 27, 2014
159
48
So I tried installing your hooks in XprivacyLua Pro by going to ≡ -> Import all settings, however I get a grayed out popup that says "Buy this pro feature". Not sure what I might've missed. Since I'm not as well versed in using XprivacyLua Pro I maybe could have overlooked something .
Sorry, you're meant to unzip the file and install each hook using Manage hook definitions -> dot menu -> Import.

Also you should tick Optional in the SaveImageBackgroundTask.SCREENSHOT_FILENAME_TEMPLATE hook, since I forgot to do that. That way it won't spam you with notifications every time you install a new app
 
  • Like
Reactions: urbanman2004

urbanman2004

Senior Member
Sep 16, 2013
416
197
Rock Town
Sorry, you're meant to unzip the file and install each hook using Manage hook definitions -> dot menu -> Import.

Also you should tick Optional in the SaveImageBackgroundTask.SCREENSHOT_FILENAME_TEMPLATE hook, since I forgot to do that. That way it won't spam you with notifications every time you install a new app

OMG, thanks my guy. It freaking works now.
 
  • Like
Reactions: LoganDark

Top Liked Posts

  • There are no posts matching your filters.
  • 5
    This module patches OPLongshot's code so that it produces PNG screenshots, as it should, instead of JPEG screenshots (ew!). It patches only the VDEX/ODEX files, which have no signature on them — only the APK is signed, which we do not modify, so OPLongshot still retains system signature privileges. The original APK is included to avoid version mismatches (although I don't think there will be much issue even if it isn't includd).

    Note that the OPLongshot was taken from the OnePlus 5T's system image. YMMV for other devices on OxygenOS (or even HydrogenOS?).

    The current version uses the version of OPLongshot from OnePlus 5T OxygenOS 5.1.0/5.1.1 (same), with version 1.1.0.180328153957.6a699c8.

    Remember to clear Dalvik/ART cache after installing this.

    GitHub repository (also details of how the patch is done).
    Download zip (temporary until the Magisk repo bot refreshes)
    4
    I have updated the module, based on OOS OB20 (OP5T) but should also work for OB22 (OP5). Cheers. :cowboy:
    2
    The latest update works only on Pie. Also, pie for 5T is currently on Beta, so most users don't have it.
    Whilst developer's enthusiasm is to be understood, a good practice would be to upload a second module in magisk repo, for Pie and leave the Oreo one largely available.
    I had to uninstall due to this issue.

    v8 of this module doesn't work on my OxygenOS 5.1.2 Oreo, Magisk 18.1. Breaks the screenshot feature. [emoji20]
    Pie only?

    Sent with much love & Android. OnePlus 5T

    Here's a version for Oreo, if anyone is still on it.

    (It is the same as this commit, but I changed the module ID so Magisk Manager will not show it as out-of-date.)

    The module is still working with 9.0.3 but the texts in the share menu are wrong Is there anyone else experiencing this?

    The latest version fixes this... at least on OOS 9.0.4.
    2
    Are you going to port it to OnePlus 3/3T devices?
    2
    Is there any timeframe on when Pie support for this module will be implemented? It worked fine for me in the previous beta version, and now I can only take screenshots with the module disabled since I updated my OP5T today. :(