[Release] DarkModeToggle - enable/disable specific tweaks when toggling dark mode

Release

v1.2 - I always update all of my posts with the latest information from any subsequent updates to this tweak. Last update was on February 25, 2020

v1.1

Compatible with iOS 11.0+

Repo: https://captinc.github.io

Price: Free!

Direct .deb download

Source code: https://github.com/captinc/DarkModeToggle

Screenshots

Link

  • Configure preferences in Settings after installing
  • Some tweaks/preferences can be toggled instantly, but others require a respring or killing all apps

Features

  • Customize exactly which tweaks you want enabled/disabled in dark/light mode
  • Change preferences of other tweaks when toggling dark mode
  • Toggle Noctis12 instantly
  • Change SnowBoard themes with dark mode
  • Works with the stock iOS 13 dark mode Control Center module
  • Provides a custom Control Center module for iOS 12 and older (you can still use the custom module on iOS 13)
  • Optionally run a shell script as root when toggling
  • Compatible with WallpaperChanger

Main uses

  • Toggle app-specific dark mode tweaks with iOS 13's dark mode
  • Change the appearance of other tweaks with iOS 13's dark mode
  • On iOS 12, you can have a single toggle that turns all dark modes on/off
  • When combined with WallpaperChanger and the "Run scripts" option, you can have custom appearance-aware wallpapers

Supported tweaks for changing preferences

  • BetterAlerts
  • CallBarXS
  • Complications
  • Grupi
  • Mot
  • Noctis12
  • PencilChargingIndicator
  • PullOver Pro
  • Ringer13
  • SelectionPlus
  • Sileo
  • SnowBoard
  • Tacitus
  • Ultrasound
  • XIIIHUD-Mute
  • Support for more tweaks can be added if you leave a comment or PM me

Donation links if you would like :)

Posted Jan 27, 2020, 4:29 AM UTC · edited

7999
foxfortmobileDeveloper•

I got two questions: Why does it need root access to run scripts(which im not sure are really needed)? Is there really a need to hook dlopen since that's very low level?

7
CaptInc37OPDeveloper•

Disabling tweak injection for a specific dylib can be done in 2 ways:

  1. Change the file extension from .dylib to .disabled in /Library/MobileSubstrate/DynamicLibraries. You can do that, but renaming files can cause issues elsewhere (other processes might look for a specific filename, dpkg will not delete any .disabled dylibs when removing tweaks, etc)

  2. Hook dlopen and return null when trying to load a dylib that u don’t want. This doesn’t mess with filenames and any changes I make do not persist into safe mode/persist after reboot. Choicy uses this method

Root access:

  • I made it root so there would be no restrictions on what the user can do. On my personal device, I have this script I use that requires root.

Maybe I should add a toggle for running as root? Idk

4
foxfortmobileDeveloper•

Makes sense to hook dlopen instead of trying to deal with each tweak preference file. 👍

3
oVaoiPhone 7 Plus, 13.3 | :checkra1n:•

Bro this guy is a absolute fucking legand

5
[deleted]•

[deleted]

-1
KojakMomentiPhone 8, iOS 13.3•

I tried setting it to disable Nord (WhatsApp dark mode tweak) when in light mode but it doesn't disable it

2
CaptInc37OPDeveloper•

Just tested it on my phone. No issues. Make sure to kill whatsapp or respring after toggling dark mode

1
KojakMomentiPhone 8, iOS 13.3•

Did that, still didn’t work for me for some reason

1
CaptInc37OPDeveloper•

Weird

1
OxycodonIViPhone X, iOS 13.3.1•

Great idea dev 🙏🏼

1
grapheezyiPhone X, iOS 13.2.2•

Dopeeee!

1
BananaManCJiPhone 6, iOS 12.4.5•

YES!!! I NEED THIS!!!

1
Cimmerian_IteriPhone 6, 12.1.1 | :chimera:•

YOURE MY BRO THANKS

1
shiddedonmyboner•

I put out a [Request] for this and the dev came through. What a legend. thank you so much

1
oVaoiPhone 7 Plus, 13.3 | :checkra1n:•

Does it completely shut them off without having to respring?

1
CaptInc37OPDeveloper•

Unfortunately not. Mobilesubstrate requires u to either kill the app or respring so it can reload tweaks

1
marchino123•

I have tried With byebyeseparstorcell and Spectrum but it doesn’t work

1
CaptInc37OPDeveloper•

Did you respring after toggling dark mode? Just tested those 2 tweaks on my phone and there were no issues

1
cysxliPhone X, 13.3 | :checkra1n:•

Any chance to make it toggles on/off some specific settings/preferences for tweaks?
sometime we still need those tweaks but not the theme/setup we want in opposite mode🤣

That’ll be awesome !!

1
CaptInc37OPDeveloper•

Progress has been made https://imgur.com/a/HafaRf5

3
Justin-SiroisiPhone XS Max, 12.0 | :chimera:•

This is exactly what I meant! Thank you so much I love your hard work :) hope you will release one day ☝️

1
CaptInc37OPDeveloper•

Holy shiitake mushrooms.....just got the preferences working and boy this is gonna be fire.

Fully customizable - you can pick exactly what value a setting for another tweak should be in exactly which mode (dark mode vs light mode). Each of those settings will be applied right as u toggle dark mode (iOS 13’s stock dark mode or my custom module. Both work)

In the future, adding another tweak’s toggle to my tweak literally requires adding 1 line of code and adding 3 entries to a .plist file. Wow.....😳

Even I’m impressed and I’m the one who made it lol

3
Justin-SiroisiPhone XS Max, 12.0 | :chimera:•

Oh my gosh, this is EASILY the most innovative/ amazing tweak made in a LONG TIME!!! Thanks so much for all the updates on this project :))))

1
cysxliPhone X, 13.3 | :checkra1n:•

Bro, where's your donate link?

1
cysxliPhone X, 13.3 | :checkra1n:•

Damn!!! Why u r so amazing like thiiiiiiis!!!!

1
CaptInc37OPDeveloper•

I would have to hardcode that, which makes stuff harder. Is there a specific tweak u need this for? (no guarantees btw)

3
GKeeP77iPhone 5s, 12.4.6 | :checkra1n:•

I have contributed to a similar tweak some time ago. It toggles Dune and a few other tweaks. I've added support for bubbles and BetterSettings, so if you'll be adding support for them you can borrow code from there. Must say, though, BetterSettings implementation is kinda janky, since I hardcoded all preset values from tweak's source code (haven't found a better way to toggle specific modes).

3
CaptInc37OPDeveloper•

Well here’s what I came up with. As you probably know, every tweak that has preferences must store those preferences somewhere. That location would be /var/mobile/Library/Preferences/com.<developer>.<tweakname>.plist

The vast majority of those tweaks read values from that plist at runtime to determine what to do. As a result, if you manually change a value in a .plist, you essentially just toggled the corresponding switch in Settings.app.

Changing text content of a file can easily be done with a shell script (not hard to code). So technically, you are already able to do what you ask with my “Run scripts” feature.

Now obviously this isn’t very user-friendly & noobs**will have a hard time setting the script up, but I can do some magic on my end to basically wrap the plist-value-change thingy in a GUI with relatively little extra work for me.

So your final answer is a “Maybe”!

** (lmao, I couldn’t think of a better/nicer description than ‘noob’. I don’t mean it in a negative way :) Sorry!)

Edit: just to clarify: each setting for a different tweak requires me to manually add it to my tweak

4
Justin-SiroisiPhone XS Max, 12.0 | :chimera:•

Could you please implement a way to do what your talking about simply for us ‘noobs’? :) I’m not so much of a noob if you explained how to do it I could but the GUI would help ALOT

1
CaptInc37OPDeveloper•

Hmmm. At the moment, i have no idea what i will do about this. Only time will tell....

2
cysxliPhone X, 13.3 | :checkra1n:•

Dude ur awesome!

1
[deleted]•

[deleted]

1
Justin-SiroisiPhone XS Max, 12.0 | :chimera:•

Can you add support for CallbarXS, Complications, Ringer13 and/or XIIIHUD-Mute, ChromaGram (just enable/disable this one) pretty please :)

1
CaptInc37OPDeveloper•

If you’re just turning the entire Noctis on/off, you can already do that

2
Justin-SiroisiPhone XS Max, 12.0 | :chimera:•

I meant the other part of my comment not the first part was a mistype

1
CaptInc37OPDeveloper•

Just FYI, ChromaGram and Noctis are both already supported with the “Disable these tweaks” feature, so no need to add those 2 to the upcoming update

2
Justin-SiroisiPhone XS Max, 12.0 | :chimera:•

Okay awesome! Will this new tweak and the other one you released work nicely alongside?

1
cysxliPhone X, 13.3 | :checkra1n:•

Just something like : Ultrasound, PencilChargingIndicator, SnowBoard, XenHTML, ColorBanners2, Grupi, Mot, CallBarXS, Tacitus, ColorMeNotifs.

IIRC, there were [Wave] and [Missito] to do such a thing but for me they didn’t work :(

(Missito not working and Wave need a dark mode toggle which not exist in iOS12😭)

1
CaptInc37OPDeveloper•

Wait. Clarify what you want with those tweaks that you mentioned...?

2
cysxliPhone X, 13.3 | :checkra1n:•

With ur toggle, simply changes a bunch of tweak preferences to a different setup. Sorry for bad English :(

1
CaptInc37OPDeveloper•

ColorBanners 2, ColorMeNotifs, SnowBoard, and XenHTML are all already supported with the “Disable these tweaks” feature

The rest of the tweaks you requested are almost done

2
cysxliPhone X, 13.3 | :checkra1n:•

Hot!!!!🥳🥳🥳🥳🥳

1
FirasCriss7iPhone X, iOS 13.3•

DAMN… I LOVE JAILBREAKING 😘

1
JMRipollGiPhone SE, 13.4.1 | :checkra1n:•

After a few tries, I got it to work with Turkey, which is awesome! I wish there was some way I could enable/disable dark mode using Watusi and change CallBar XS Light/Dark Glass Style but I realize that could be pretty complicated.

I do have one question though. What's the point of having it work with YouTubeDarkModeSync? Doesn't it defeat the purpose of the tweak?

1
CaptInc37OPDeveloper•

Yeah u right. It doesn’t really “work” with youtubedarkmodesync, i was just kinda mentioning that YTDMS is a similar tweak that’s in the same category.

I’ll edit the post to clarify, thanks for pointing that out

1
Justin-SiroisiPhone XS Max, 12.0 | :chimera:•

Oh my gosh please do this and post a tutorial and tag me please when you do!! This is amazing your a great person :)

1
[deleted]•

[deleted]

1
mkizzle2906iPhone 11 Pro Max, iOS 13.3•

Can u add support for PullOver Pro light/dark mode ??? And make your toggle also switch Noctis12 toggle ? And can you make it work with app has their own dark mode which work on iOS 12 or below (such as Messenger, Youtube, Reddit, Twitter, Fantistical, Telegram, Tweetbot,...)

1
CaptInc37OPDeveloper•

Someone else already requested PullOver Pro and Noctis, so those 2 have already been added. My other tweak YouTubeDarkModeSync will do what you ask once DarkModeToggle is updated.

As for the other apps, each requires its own separate tweak. Unfortunately I just don’t have the time to make a tweak for each app, sorry. You’ll have to ask someone else.

However, if you can somehow provide me with the code to toggle each app, I can very easily make a tweak for each app. You might actually be able to do this. DM if interested

For developers that want to make such a tweak: detecting when DarkModeToggle is toggled is very very easy. DM if interested

1
mkizzle2906iPhone 11 Pro Max, iOS 13.3•

I really wanna do that but don’t know anything about develope 😅

1
CaptInc37OPDeveloper•

lmao. Maybe u can ask around and see if other people can help u?

1
mkizzle2906iPhone 11 Pro Max, iOS 13.3•

Hope u can make a all-in-one that type of apps tweaks. Maybe enable/disable with Applist 🤔

1
s0m3guy_YT•

I'd like support for Carbon Dark Mode and Dune. I would love to see it implemented in this tweak

1
CaptInc37OPDeveloper•

iOS 12, I presume?

1
s0m3guy_YT•

Yes

1
CaptInc37OPDeveloper•

Settings > DarkModeToggle > When in dark mode > Disabled these tweaks > Dune and Carbon Dark Mode

1
s0m3guy_YT•

Thing is, Carbon Dark Mode and Dune can be disabled just by changing preferences. Disabling them from your method doesn’t work. Here’s the source code for the two tweaks if it helps:

https://github.com/OxideLabs/Carbon https://github.com/Skittyblock/Dune

1
casuallycompetes•

some tweaks don't work with the iPad..

1
CaptInc37OPDeveloper•

Wdym

1
casuallycompetes•

Turkey doesn't work. now my Cydia opens with a dark screen while loading it. its kinda annoying. ccsupport doesn't work as I tried in on my XS and both work on the iPhone.

1
CaptInc37OPDeveloper•

I’m confused. Are you saying these tweaks don’t work with DarkModeToggle, or don’t work in general?

1
pretenditsokayiPhone 11, iOS 13.3•

I'd love a way to load a different widget when switching to light/dark mode through xenhtml, would that be possible in future update ?

Thanks for your already great tweak

1
CaptInc37OPDeveloper•

Maybe. I’ll keep it in mind

1
royerlraph79•

Can you add Deluminator and FacebookDarkMode support for preferences please? :)

1
CaptInc37OPDeveloper•

It’s been added to the to-do list :)

2
royerlraph79•

Thank you! 😊

1