11 Commits
0.0.1 ... main

Author SHA1 Message Date
bc691e5d5b Update README.md 2022-12-03 01:23:35 +07:00
4c09578a8d Update README.md 2022-12-03 01:23:19 +07:00
56408b5964 Fixed crash on lower iOS version 2022-12-02 10:19:23 -08:00
4a39d96921 Updated header 2022-12-02 10:17:49 -08:00
57b1947a47 Edited disclaimers 2022-11-13 23:31:01 +07:00
dedc9363e9 Fixed formatting 2022-11-13 23:22:28 +07:00
6b83b8ce80 Added notice about iOS version 2022-11-13 23:21:59 +07:00
84904dc6aa Update README.md 2022-09-02 22:36:57 +07:00
9fbf5a797a Typo again 2022-07-20 17:07:14 +07:00
8bd68b5127 Fixed Typo 2022-07-20 17:06:26 +07:00
ca7135f20e Update README.md 2022-07-20 17:00:23 +07:00
3 changed files with 37 additions and 7 deletions

View File

@@ -7,13 +7,19 @@ This is my first jailbreak tweak <3, so it might not be perfect
![Preview](https://user-images.githubusercontent.com/84713269/167249578-41f97c06-756c-4610-a94e-2a259a9171fb.gif)
![Preference](https://user-images.githubusercontent.com/84713269/179952103-1e851b56-14ce-4e48-8f51-ddb52aaf5d01.png)
## ✨ 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.**

View File

@@ -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)

View File

@@ -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