ealeksandrov / ProvisionQL

Quick Look plugin for mobile apps and provisioning profiles
MIT License
2.35k stars 147 forks source link

Need help adding a new type #50

Open gzz2000 opened 10 months ago

gzz2000 commented 10 months ago

Hi Evgeny, I tried to enhance ProvisionQL by adding support to an alias of the .ipa file, .tipa (TrollStore IPA, an airdrop-friendly extension making it easy to send ipa files to iOS devices running the TrollStore semi-jailbreak, which is very popular these days).

I did so by modifying all code related to ipa file handling and add tipa to the matching list (see my commit). By mdls -name kMDItemContentType I found the type should be com.opa334.trollstore.tipa. I've succeeded in making it working if I explicitly launch my modified ProvisionQL like this:

qlmanage -p file.tipa -g ~/Library/QuickLook/ProvisionQL.qlgenerator -c com.opa334.trollstore.tipa

But it does not work if I do not explicitly specify the -g and -c options, nor in Finder directly. Do you have any idea why it doesn't work? Did I miss something to edit? Thanks!

relikd commented 9 months ago

tell me what this command returns for your tipa file:

mdls -name kMDItemContentType your_app.tipa
gzz2000 commented 9 months ago

tell me what this command returns for your tipa file:

mdls -name kMDItemContentType your_app.tipa

Actually on my side, mdls shows com.opa334.trollstore.tipa. I don't know where this is configured, as macos should never know this type.

% mdls -name kMDItemContentType ~/Downloads/Filza_4.0.0_.tipa           
kMDItemContentType = "com.opa334.trollstore.tipa"

I tried changing it to the type you mentioned in your PR (dyn.ah62d4rv4ge81k4puqe) but it did not work either.:(

relikd commented 9 months ago

Interesting, so there is a macOS application for tipa files. I did not find any on the official homepage. With this command you can check which App is used:

/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -dump Type | grep '^uti:\s*com.opa334.trollstore.tipa$' -B2 -A3 | grep '^flags:\s*active' -B5 

you tried changing it in your source code or using my branch? I've pushed a new version, try again.

relikd commented 9 months ago

Oh, and my opinion on that is that it is probably better to create a separate QL plugin for that. The TIPA file does not follow the same structure as normal IPAs. In fact, it would be best if the app you have would add a QL extension to its code.

The one tipa I tried has the icon file stored in a .car asset bundle. ProvisionQL (currently) does not support extracting from .car files. At least Apple provided .ipa files will always bundle an Artwork which can be used as icon. There are simply no guarantees as to what will and will not work in tipa.

relikd commented 9 months ago

Does .tipa work with this plugin? (remember to qlmanage -r) ProvisionQL.qlgenerator.zip

gzz2000 commented 9 months ago

This is working! I have tested a few (~10) .tipa files and most of them works with this plugin. However, 2 of them did not seem to work on my side. I don't know if it's because of caches on my side or something special about these two files. I uploaded the failed ones for reference. failed_tipa.zip

relikd commented 9 months ago

Yes, the error happens because of a bug in the original code (tried to access non-existing key CFBundleShortVersionString). I fixed that in my overall refactoring. Here is the newest version which builds atop my refactoring branch with .tipa enabled. ProvisionQL_with_tipa.zip

Note: TrollDecrypt does not show an icon but this is due to the poor quality control of tipa developers. In this case, the developer created an empty icon file with @3x which is prefered over the @1x resolution. As mentioned above, I noticed other inconsistencies which may and will break the functionality of this plugin. But at least you get as much information as possible out of it.

gzz2000 commented 9 months ago

This newest version works on all my .tipa files. This is cool!

relikd commented 9 months ago

You shouldn't close the issue, as it is not added to the main branch yet. waiting for @ealeksandrov's approval

gzz2000 commented 9 months ago

Reopened:)