Tweetbot-for-Mac-ColorScheme icon indicating copy to clipboard operation
Tweetbot-for-Mac-ColorScheme copied to clipboard

With version 2.4.6, dark mode causes the app to crash

Open abodnar opened this issue 8 years ago • 33 comments

I updated TweetBot to v2.4.6 the other day and it seems like the Colors.plist causes the new version to crash.

abodnar avatar Jan 30 '17 01:01 abodnar

I'm not having any trouble on 2.4.6, does it crash on any particular screen for you?

image

keith avatar Jan 30 '17 02:01 keith

Actually this does crash for me after a little while. But I don't see any crash reports 🤔

keith avatar Jan 30 '17 02:01 keith

I just start the app and a few minutes and I'll see that the app no longer has the little dot under it.

I don't see a crash either.

abodnar avatar Jan 30 '17 03:01 abodnar

It looks like tweetbot exists with a 0 status code, here's the backtrace at that point:

(lldb) bt
* thread #1: tid = 0x86720, 0x00007fffb06af47b libsystem_c.dylib`exit, queue = 'com.apple.main-thread', stop reason = breakpoint 4.3
  * frame #0: 0x00007fffb06af47b libsystem_c.dylib`exit
    frame #1: 0x00000001000023d3 Tweetbot`___lldb_unnamed_symbol8$$Tweetbot + 11
    frame #2: 0x00007fffb05e40b8 libdispatch.dylib`_dispatch_client_callout + 8
    frame #3: 0x00007fffb05f9b5b libdispatch.dylib`_dispatch_continuation_pop + 533
    frame #4: 0x00007fffb05efa6a libdispatch.dylib`_dispatch_source_latch_and_call + 192
    frame #5: 0x00007fffb05e68f6 libdispatch.dylib`_dispatch_source_invoke + 1248
    frame #6: 0x00007fffb05f19a7 libdispatch.dylib`_dispatch_main_queue_callback_4CF + 505
    frame #7: 0x00007fff9b101529 CoreFoundation`__CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
    frame #8: 0x00007fff9b0c246d CoreFoundation`__CFRunLoopRun + 2205
    frame #9: 0x00007fff9b0c1974 CoreFoundation`CFRunLoopRunSpecific + 420
    frame #10: 0x00007fff9a64dacc HIToolbox`RunCurrentEventLoopInMode + 240
    frame #11: 0x00007fff9a64d901 HIToolbox`ReceiveNextEventCommon + 432
    frame #12: 0x00007fff9a64d736 HIToolbox`_BlockUntilNextEventMatchingListInModeWithFilter + 71
    frame #13: 0x00007fff98bf3ae4 AppKit`_DPSNextEvent + 1120
    frame #14: 0x00007fff9936e21f AppKit`-[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 2789
    frame #15: 0x00007fff98be8465 AppKit`-[NSApplication run] + 926
    frame #16: 0x00007fff98bb2d80 AppKit`NSApplicationMain + 1237
    frame #17: 0x0000000100002199 Tweetbot`___lldb_unnamed_symbol2$$Tweetbot + 1833
    frame #18: 0x00007fffb061a255 libdyld.dylib`start + 1

Unfortunately it's not super helpful because they seem to be stripping symbols.

keith avatar Jan 30 '17 03:01 keith

It looks like there are a few new entries in the default colors plist, so maybe they're required.

keith avatar Jan 30 '17 03:01 keith

I added the missing keys, with this patch (note the colors are not corrected) but it still crashes silently:

--- /Users/ksmiley/Downloads/Colors.plist	2017-01-29 19:24:40.000000000 -0800
+++ Colors.plist	2017-01-29 19:23:21.000000000 -0800
@@ -3416,14 +3416,209 @@
 		<key>status_view.selected.separator</key>
 		<dict>
 			<key>w</key>
-			<integer>77</integer>
+			<integer>230</integer>
 		</dict>
 		<key>status_view.selected.text</key>
 		<dict>
 			<key>w</key>
+			<integer>77</integer>
+		</dict>
+		<key>status_view.selected.time</key>
+		<dict>
+			<key>w</key>
+			<integer>179</integer>
+		</dict>
+		<key>status_view.selected.user_name</key>
+		<dict>
+			<key>w</key>
+			<integer>0</integer>
+		</dict>
+		<key>status_view.selected_old.avatar_highlighted_outline</key>
+		<dict>
+			<key>a</key>
+			<integer>153</integer>
+			<key>w</key>
+			<integer>0</integer>
+		</dict>
+		<key>status_view.selected_old.avatar_outline</key>
+		<dict>
+			<key>a</key>
+			<integer>179</integer>
+			<key>w</key>
+			<integer>0</integer>
+		</dict>
+		<key>status_view.selected_old.background</key>
+		<dict>
+			<key>w</key>
+			<integer>51</integer>
+		</dict>
+		<key>status_view.selected_old.conversation_icon</key>
+		<dict>
+			<key>w</key>
+			<integer>128</integer>
+		</dict>
+		<key>status_view.selected_old.favorite_icon</key>
+		<dict>
+			<key>b</key>
+			<integer>100</integer>
+			<key>h</key>
+			<integer>41</integer>
+			<key>s</key>
+			<integer>100</integer>
+		</dict>
+		<key>status_view.selected_old.hashtag</key>
+		<dict>
+			<key>b</key>
+			<integer>100</integer>
+			<key>h</key>
+			<integer>211</integer>
+			<key>s</key>
+			<integer>50</integer>
+		</dict>
+		<key>status_view.selected_old.hashtag_highlighted</key>
+		<dict>
+			<key>a</key>
+			<integer>128</integer>
+			<key>b</key>
+			<integer>100</integer>
+			<key>h</key>
+			<integer>211</integer>
+			<key>s</key>
+			<integer>50</integer>
+		</dict>
+		<key>status_view.selected_old.link</key>
+		<dict>
+			<key>b</key>
+			<integer>100</integer>
+			<key>h</key>
+			<integer>211</integer>
+			<key>s</key>
+			<integer>50</integer>
+		</dict>
+		<key>status_view.selected_old.link_highlighted</key>
+		<dict>
+			<key>a</key>
+			<integer>128</integer>
+			<key>b</key>
+			<integer>100</integer>
+			<key>h</key>
+			<integer>211</integer>
+			<key>s</key>
+			<integer>50</integer>
+		</dict>
+		<key>status_view.selected_old.marker_back</key>
+		<dict>
+			<key>w</key>
+			<integer>102</integer>
+		</dict>
+		<key>status_view.selected_old.marker_behind</key>
+		<dict>
+			<key>w</key>
+			<integer>26</integer>
+		</dict>
+		<key>status_view.selected_old.media_background</key>
+		<dict>
+			<key>w</key>
+			<integer>41</integer>
+		</dict>
+		<key>status_view.selected_old.media_border</key>
+		<dict>
+			<key>a</key>
+			<integer>26</integer>
+			<key>w</key>
+			<integer>0</integer>
+		</dict>
+		<key>status_view.selected_old.media_highlighted_overlay</key>
+		<dict>
+			<key>a</key>
+			<integer>77</integer>
+			<key>w</key>
+			<integer>0</integer>
+		</dict>
+		<key>status_view.selected_old.media_small_shadow</key>
+		<dict>
+			<key>w</key>
+			<integer>255</integer>
+		</dict>
+		<key>status_view.selected_old.mention</key>
+		<dict>
+			<key>b</key>
+			<integer>100</integer>
+			<key>h</key>
+			<integer>211</integer>
+			<key>s</key>
+			<integer>50</integer>
+		</dict>
+		<key>status_view.selected_old.mention_highlighted</key>
+		<dict>
+			<key>a</key>
+			<integer>128</integer>
+			<key>b</key>
+			<integer>100</integer>
+			<key>h</key>
+			<integer>211</integer>
+			<key>s</key>
+			<integer>50</integer>
+		</dict>
+		<key>status_view.selected_old.place</key>
+		<dict>
+			<key>w</key>
+			<integer>128</integer>
+		</dict>
+		<key>status_view.selected_old.place_highlighted</key>
+		<dict>
+			<key>b</key>
+			<integer>100</integer>
+			<key>h</key>
+			<integer>212</integer>
+			<key>s</key>
+			<integer>20</integer>
+		</dict>
+		<key>status_view.selected_old.quoted.screen_name</key>
+		<dict>
+			<key>w</key>
+			<integer>128</integer>
+		</dict>
+		<key>status_view.selected_old.quoted.text</key>
+		<dict>
+			<key>w</key>
+			<integer>128</integer>
+		</dict>
+		<key>status_view.selected_old.quoted.user_name</key>
+		<dict>
+			<key>w</key>
 			<integer>204</integer>
 		</dict>
-		<key>status_view.selected.text_selection</key>
+		<key>status_view.selected_old.retweeted</key>
+		<dict>
+			<key>w</key>
+			<integer>128</integer>
+		</dict>
+		<key>status_view.selected_old.retweeted_highlighted</key>
+		<dict>
+			<key>b</key>
+			<integer>100</integer>
+			<key>h</key>
+			<integer>212</integer>
+			<key>s</key>
+			<integer>20</integer>
+		</dict>
+		<key>status_view.selected_old.screen_name</key>
+		<dict>
+			<key>w</key>
+			<integer>204</integer>
+		</dict>
+		<key>status_view.selected_old.separator</key>
+		<dict>
+			<key>w</key>
+			<integer>230</integer>
+		</dict>
+		<key>status_view.selected_old.text</key>
+		<dict>
+			<key>w</key>
+			<integer>204</integer>
+		</dict>
+		<key>status_view.selected_old.text_selection</key>
 		<dict>
 			<key>b</key>
 			<integer>100</integer>
@@ -3432,17 +3627,17 @@
 			<key>s</key>
 			<integer>100</integer>
 		</dict>
-		<key>status_view.selected.time</key>
+		<key>status_view.selected_old.time</key>
 		<dict>
 			<key>w</key>
 			<integer>153</integer>
 		</dict>
-		<key>status_view.selected.top_separator</key>
+		<key>status_view.selected_old.top_separator</key>
 		<dict>
 			<key>w</key>
 			<integer>51</integer>
 		</dict>
-		<key>status_view.selected.user_name</key>
+		<key>status_view.selected_old.user_name</key>
 		<dict>
 			<key>w</key>
 			<integer>255</integer>

keith avatar Jan 30 '17 03:01 keith

I suspect the alteration of color codes (rgba/hsba) between the custom and original Colors.plist might be the cause. Since this dark color theme was mostly based on the one from iOS version of Tweetbot, lots of the items were not using the same color code as the Mac one.

I'm trying to convert the color codes to the same as the original one and try if the problem can be solved, however this is a lot of work.

lucifr avatar Jan 31 '17 06:01 lucifr

Update: It seems the crash has nothing to do with the color code. Change of the Colors.plist file will led to a crash no matter what. I don't know if this is a sandboxing issue or tapbots brought in some kind of checksum mechanism. Either way, this color scheme will no longer work.

lucifr avatar Feb 01 '17 06:02 lucifr

Bummer :(

abodnar avatar Feb 01 '17 15:02 abodnar

I am having the same problem. Reverting to original Colors.plist did not help (still crashed). I had to remove the app and reinstall; now the app is not crashing. Something about this modified Colors.plist makes it crash, even after reverting to the original Colors.plist w/o a reinstall.

envirodug avatar Feb 01 '17 16:02 envirodug

Yep, same here - too bad :/ @tapbots we want daaaaaark mode!

benp avatar Feb 03 '17 00:02 benp

If I mv the original Colors.plist back, it does not crash.

If I cat the patched Colors.plist to Colors.plist, it crashes.

(re: https://github.com/lucifr/Tweetbot-for-Mac-ColorScheme/issues/9#issuecomment-276700489)

b4 avatar Feb 09 '17 18:02 b4

Darn, I'm hoping this can be resolved somehow. The dark theme is so much easier on the eyes

CoryAlexMartin avatar Feb 21 '17 01:02 CoryAlexMartin

Seems like the crash is not related to the Color.plist. This is related to the previous container directory placed for when you had a previous installation. To resolve this make sure Tweetbot is closed, then go to ~/Library/Container and delete the com.tapbots.TweetbotMac folder.

Containers are special folders that provide access to specific directories needed for certain applications instead of providing complete directory access not needed by the application.

mikeyjoel avatar Apr 02 '17 18:04 mikeyjoel

@mikeyjoel This fix does not work.

MikeASchneider avatar Apr 02 '17 22:04 MikeASchneider

I tried this and the app crashed after the first few minutes, but once I restarted it, it's been fine.

abodnar avatar Apr 03 '17 00:04 abodnar

Did not work for me either unfortunately 😕

sberrevoets avatar Apr 03 '17 01:04 sberrevoets

Tweetbot crashes for me after ~40 seconds even with the patched version of Colors.plist :( No interaction. Launch Tweetbot, wait ~40s, poof it's gone.

R2robot avatar Apr 06 '17 10:04 R2robot

Todd Thomas tweeted at me a few weeks ago saying this was caused by Tweetbot's DRM. A new update of Tweetbot for Mac has been released, and the Colors.plist issue is still present. SIGH.

MTWomg avatar Apr 26 '17 01:04 MTWomg

Meaning they're doing more than just what the MAS provides to validate this?

keith avatar Apr 26 '17 01:04 keith

Yes, exactly.

MTWomg avatar Apr 26 '17 01:04 MTWomg

I'm fairly furious about this. The wait for a fix is ridiculous enough, but not even fixing it in the end makes it even worse. I've been left with the option to use the (eye searing) official version, revert to an old version from backup and be stuck with a '1' on the Mac App Store icon, or grab a pirated version. Not great choices. Now, unless someone at Tapbots spends the five minutes to remove (or more time to fix) their DRM, we're all fucked.

The best part is that the DRM is not even effective - 2.4.6 has been cracked. And, no, the pirates did not fully strip the DRM, so the Colors.plist issue is present with the cracked version as well. 😞

Relevant tweets: https://twitter.com/toddthomas/status/830291401321492480 https://twitter.com/toddthomas/status/831251453075353600 https://twitter.com/toddthomas/status/842130433001246720

MTWomg avatar Apr 26 '17 01:04 MTWomg

Obviously I have no inside knowledge on the internals of tweetbot, but some thoughts about this:

I imagine this isn't particularly easy for them to solve on the codesigning side. Since I assume these API calls validate your bundle vs what's expected. For example in Contents/_CodeSignature/CodeResources you can see there is information specifically about each file which probably defines it's contents:

<key>Resources/Colors.plist</key>
<data>
some data
</data>

And of course changing Colors.plist causes this to be invalid, and therefore fails the validation. I don't think it would be simple to opt out this one file.

I think the simplest way for them to solve this (without just adding a native dark theme 😛) would probably be to look in an alternate location for the Colors.plist file, and then fallback to the one bundled with the app in the case that it isn't there (most users). But it seems like this would almost be endorsing this hack, so I'm not sure they'll do that 😢

Also FWIW cracking these binaries may be easy but in the case of tweetbot you would lose all functionality related to iCloud since this is based on their entitlements + their signature, so I think for most people even that would be a non-starter.

If you go deep enough there are workarounds for this but I don't want to spread any of these around since they are akin to cracking the app. I think we should instead ask them to support this feature in general, so we can abandon this approach all together 😄

keith avatar Apr 26 '17 03:04 keith

Best way to solve this would be to stop validating app resources for the purpose of DRM. The DRM should be confined to 'is the binary/receipt tampered with' only. Adding a dark mode/an alternate location for Colors.plist only solves the Colors.plist problem. Bottom line, I should be able to modify an app I purchased. It's pretty fucked up that a Mac app would have DRM that prevents the user from modifying non-executable app resources.

MTWomg avatar Apr 26 '17 03:04 MTWomg

(Unfortunately) it is unreasonable to expect a graphics rendering engine to not be vulnerable to code execution nowadays.

Sent from my iPhone

On Apr 25, 2017, at 20:10, MTWomg [email protected] wrote:

Best way to solve this would be to stop validating app resources. The DRM should be confined to 'is the binary/receipt tampered with' only.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

b4 avatar Apr 26 '17 03:04 b4

That can't be a factor. Being able to modify apps as I please is a big part of what makes a Mac a Mac, and not an iPhone. If the goal is DRM, the DRM doesn't work anyway. If the goal is security, the user must be allowed to make security decisions for themselves, according to their own priorities.

MTWomg avatar Apr 26 '17 03:04 MTWomg

Under 2.5, replying to tweets with the modified Colors.plist does not work due to changes to the Colors.plist. If anyone has time, I'd be nice to update Colors.plist for 2.5, for when this bug gets fixed.

EDIT: Fixed, see https://github.com/lucifr/Tweetbot-for-Mac-ColorScheme/issues/10

MTWomg avatar May 01 '17 21:05 MTWomg

2.5.1 crashed even with this file. Any idea?

ghost avatar May 09 '17 11:05 ghost

Still crashing, even using the file M @MTWomg uploaded. Any fixes? :(

mimed avatar Jun 30 '17 13:06 mimed

The cracked versions (by TNT) of 2.5.0 and 2.5.3 (latest) have the buggy DRM that causes our issue removed, so they work with my Colors file. Shame that we have to go that route when we all paid for the damn app, but at least that is something of a fix.

MTWomg avatar Sep 24 '17 19:09 MTWomg