Skip to content

Instantly share code, notes, and snippets.

@MTACS
Last active June 15, 2024 04:00
Show Gist options
  • Save MTACS/31887e33b5661f885f986a566340c490 to your computer and use it in GitHub Desktop.
Save MTACS/31887e33b5661f885f986a566340c490 to your computer and use it in GitHub Desktop.
Always show battery icon on wired CarPlay connections
// CAR* classes have been renamed to DB (DashBoard.framework) on iOS 16
// Note that this only shows the default battery with no inline percentage on iOS 16, use a tweak like Ampere (v1.3+) to enable the percentage
// iOS >= 16
%hook DBEnvironmentConfiguration
- (BOOL)isConnectedWirelessly {
return YES;
}
%end
// iOS < 16
%hook CAREnvironmentConfiguration
- (BOOL)isConnectedWirelessly {
return YES;
}
%end
@markymc
Copy link

markymc commented Jun 14, 2024

Hi there @MTACS i found this while trying to find out how to show the battery level when plugged into CarPlay. Would this help me out? If so, how would I do that? Or do I need to jailbreak? Thanks in advance!

@MTACS
Copy link
Author

MTACS commented Jun 14, 2024

Hi there @MTACS i found this while trying to find out how to show the battery level when plugged into CarPlay. Would this help me out? If so, how would I do that? Or do I need to jailbreak? Thanks in advance!

Hey, a jailbreak would be needed to override these, it would also be possible if you had access to the unit hosting CarPlay, I’m not sure how available the APIs are though

@markymc
Copy link

markymc commented Jun 15, 2024

Thanks for the quick reply! I see. I have an aftermarket Android head unit, so I might have access, but life's a bit too busy for me to go down that rabbit hole right now. 😅😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment