mirror of
https://github.com/YuzuZensai/iOS-DiscordPresence.git
synced 2026-01-06 04:33:12 +00:00
Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| bc691e5d5b | |||
| 4c09578a8d | |||
| 56408b5964 | |||
| 4a39d96921 | |||
| 57b1947a47 | |||
| dedc9363e9 | |||
| 6b83b8ce80 | |||
| 84904dc6aa | |||
| 9fbf5a797a | |||
| 8bd68b5127 | |||
| ca7135f20e |
16
README.md
16
README.md
@@ -7,13 +7,19 @@ This is my first jailbreak tweak <3, so it might not be perfect
|
||||

|
||||

|
||||
|
||||
## ✨ Features
|
||||
|
||||
- Detect running games and show them on your Discord!
|
||||
- Fetch Discord token from the iOS Discord Application
|
||||
- Built-in ratelimiter
|
||||
|
||||
## 🔧 Installation
|
||||
1. Download .deb from [release](https://github.com/YuzuZensai/iOS-DiscordPresence/releases) page (for repo, soon?)
|
||||
2. Install the .deb file (Using your package manager, or Filza)
|
||||
3. Respring
|
||||
4. Configure the tweak in the settings
|
||||
|
||||
## 👜 Prerequisites
|
||||
## 👜 Prerequisite
|
||||
|
||||
- [Theos](https://theos.dev/)
|
||||
|
||||
@@ -23,12 +29,14 @@ This is my first jailbreak tweak <3, so it might not be perfect
|
||||
2. Edit ``Makefile`` if needed
|
||||
3. Run ``make do`` to build and install on your device, ``make package`` to build, or ``make package FINALPACKAGE=1`` for production build
|
||||
|
||||
## ⚠️ Disclaimer
|
||||
## ⚠️ Disclaimers
|
||||
|
||||
Only tested on iOS 14.3, but it should work on other versions too
|
||||
Fully supports on iOS 14+, iOS 12+ (Temporary workaround), untested on lower versions
|
||||
|
||||
Only tested on iOS 14.3 (unc0ver), 14.5 (checkra1n), and 12.5.6 (Chimera) but it should work on other versions too
|
||||
|
||||
iOS-DiscordPresence utilizes Discord API that is outside OAuth2/bot API scope.
|
||||
|
||||
``/api/v6/presences``
|
||||
|
||||
Automating normal user accounts (generally called "self-bots") outside of the OAuth2/bot API is a **violation** of Discord [Terms Of service](https://discord.com/terms) & [Community Guidelines](https://discord.com/guidelines), and can result in account termination if found. **I do not take any responsibility, liability, or anything that happened on your Discord Account.**
|
||||
Automating normal user accounts (generally called "self-bots") outside of the OAuth2/bot API is a **violation** of Discord [Terms Of service](https://discord.com/terms) & [Community Guidelines](https://discord.com/guidelines), and can result in account termination if found. **I do not take any responsibility, liability, or anything that happened to or on your Discord Account.**
|
||||
|
||||
@@ -21,7 +21,9 @@
|
||||
@end
|
||||
|
||||
@interface SBApplicationInfo (Tweak)
|
||||
@property (nonatomic,copy,readonly) NSArray * iTunesCategoriesOrderedByRelevancy;
|
||||
@property(getter=isAppleApplication, nonatomic, readonly) BOOL appleApplication;
|
||||
@property(getter=isInternalApplication, nonatomic, readonly) BOOL internalApplication;
|
||||
@property(nonatomic, copy, readonly) NSArray *iTunesCategoriesOrderedByRelevancy;
|
||||
@end
|
||||
|
||||
@interface SBLockScreenManager (Tweak)
|
||||
|
||||
@@ -30,7 +30,27 @@ static void showDiscordRatelimitAlert() {
|
||||
});
|
||||
}
|
||||
|
||||
static Boolean isiOS14orAbove() {
|
||||
return [[UIDevice currentDevice].systemVersion floatValue] >= 14.0;
|
||||
}
|
||||
|
||||
static Boolean isSBApplicationValid(SBApplication* app) {
|
||||
SBApplicationInfo *appInfo = [app info];
|
||||
|
||||
if ([appInfo isAppleApplication] || [app isSystemApplication] || [appInfo isInternalApplication])
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static Boolean isSBApplicationAGame(SBApplication* app) {
|
||||
|
||||
//TODO: Remove this temporary workaround
|
||||
if (isiOS14orAbove() == false) {
|
||||
NSLog(@"iOS 14 or above is required to detect games, skipping check");
|
||||
return true;
|
||||
}
|
||||
|
||||
SBApplicationInfo *appInfo = [app info];
|
||||
NSArray *category = [appInfo iTunesCategoriesOrderedByRelevancy];
|
||||
|
||||
@@ -193,14 +213,14 @@ static void stopDiscordUpdatePresenceTimer() {
|
||||
else if ([arg1 isKindOfClass:[%c(SBApplication) class]]) {
|
||||
SBApplication *app = arg1;
|
||||
|
||||
Boolean isSystemApplication = [app isSystemApplication];
|
||||
Boolean isValidApplication = isSBApplicationValid(app);
|
||||
Boolean isGameApplication = isSBApplicationAGame(app);
|
||||
|
||||
// Switched to itself, ignore
|
||||
if (focusedApplication == app) return;
|
||||
|
||||
// Ignore if the application is system application or is not a game
|
||||
if(isSystemApplication || !isGameApplication) {
|
||||
if(!isValidApplication || !isGameApplication) {
|
||||
// Remove any focused application, since the user switched to non game or system application
|
||||
if(focusedApplication != nil) {
|
||||
// Remove current focused application and stop the presence
|
||||
|
||||
Reference in New Issue
Block a user