Skip to content
This repository has been archived by the owner on Feb 2, 2024. It is now read-only.

[Fix Found - Code Changes Needed] Cowabunga still detecting TrollStore even with Force DirtyCow #300

Open
core-hacked opened this issue May 22, 2023 · 9 comments

Comments

@core-hacked
Copy link

Hello I am on ios 16.2 beta 1 (which is supported by cowabunga/the exploit works. However it still detects trollstore even though I force DirtyCow exploit in settings.

imageimage

@leminlimez
Copy link
Owner

cowabunga v10.2.0?

@core-hacked
Copy link
Author

cowabunga v10.2.0?

Latest version and some before it. Yes

@leminlimez
Copy link
Owner

it was fixed in v10.2.0

@core-hacked
Copy link
Author

core-hacked commented May 22, 2023

it was fixed in v10.2.0

I am on the latest version. It's not (at least for me)
Reset all is also broken...

@leminlimez
Copy link
Owner

untoggle it, save, then retoggle it and save again

it is working on my ip x

@core-hacked
Copy link
Author

untoggle it, save, then retoggle it and save again

it is working on my ip x

I restarted, resprung, toggled untoggled, reinstalled Cowabunga etc. i did the most common steps to diagnose/fix the problem. This is something different.

Is there a file or folder which might indicate that trollstore is installed? What does the app actually check for/how does it know?

iP 11 Pro Max -> iOS 16.2 Beta 1

@core-hacked
Copy link
Author

core-hacked commented May 22, 2023

Ok I think I have found the problem.
Since the exploit works, but the device is on ios 16.2 (beta, but still recognized as 16.2), the lines of code below (if statement), contradict eachother so force MDC is never applied.

if #available(iOS 16.2, *) { 
    UIApplication.shared.alert(title: "Not Supported", body: "This version of iOS is not supported.")
} else { 
    // Force MDC is inside an else, however it doesnt work for 16.2 beta 1, as the above prevents it from executing.
    do {
        if UserDefaults.standard.bool(forKey: "ForceMDC") == true {
            throw "Force MDC"
        }
        // TrollStore method
        try FileManager.default.contentsOfDirectory(at: URL(fileURLWithPath: "/var/mobile/Library/Caches"), includingPropertiesForKeys: nil)
        StatusManager.sharedInstance().setIsMDCMode(false)
    } catch {
        // MDC method
        // grant r/w access
        if #available(iOS 15, *) {
            grant_full_disk_access() { error in
                if (error != nil) {
                    UIApplication.shared.alert(title: "Access Error", body: "Error: \(String(describing: error?.localizedDescription))\nPlease close the app and retry.")
                } else {
                    StatusManager.sharedInstance().setIsMDCMode(true)
                }
            }
        } else {
            UIApplication.shared.alert(title: "MDC Not Supported", body: "Please install via TrollStore")
        }
    }
}

This would need a rewrite/fix. Something like a new toggle in the main menu, "Allow unsupported versions", which would override this for users who are on betas.

I don't know Swift however my programming knowledge leads me to believe that the code below might be correct. (At least the gist of it.) Also the toggle needs to be added to the view etc. but yeah...

// adjust if statement for ios beta users / force unsupported versions toggle. 
if UserDefaults.standard.bool(forKey: "ForceUnsupported") == false && #available(iOS 16.2, *) {
    UIApplication.shared.alert(title: "Not Supported", body: "This version of iOS is not supported.")
} else { 
    do {
        if UserDefaults.standard.bool(forKey: "ForceMDC") == true {
            throw "Force MDC"
        }
        // TrollStore method
        try FileManager.default.contentsOfDirectory(at: URL(fileURLWithPath: "/var/mobile/Library/Caches"), includingPropertiesForKeys: nil)
        StatusManager.sharedInstance().setIsMDCMode(false)
    } catch {
        // MDC method
        // grant r/w access
        if #available(iOS 15, *) {
            grant_full_disk_access() { error in
                if (error != nil) {
                    UIApplication.shared.alert(title: "Access Error", body: "Error: \(String(describing: error?.localizedDescription))\nPlease close the app and retry.")
                } else {
                    StatusManager.sharedInstance().setIsMDCMode(true)
                }
            }
        } else {
            UIApplication.shared.alert(title: "MDC Not Supported", body: "Please install via TrollStore")
        }
    }
}

@core-hacked core-hacked changed the title Cowabunga still detecting TrollStore even with Force DirtyCow [Fix Found - App Update Needed] Cowabunga still detecting TrollStore even with Force DirtyCow May 22, 2023
@core-hacked core-hacked changed the title [Fix Found - App Update Needed] Cowabunga still detecting TrollStore even with Force DirtyCow [Fix Found - Code Changes Needed] Cowabunga still detecting TrollStore even with Force DirtyCow May 23, 2023
@core-hacked
Copy link
Author

Or maybe instead, just allow it if ForceMDC is on, so no new toggle.

// adjust if statement if ForceMDC is true
if UserDefaults.standard.bool(forKey: "ForceMDC") == false && #available(iOS 16.2, *) {
    UIApplication.shared.alert(title: "Not Supported", body: "This version of iOS is not supported.")
} else { 
    do {
        if UserDefaults.standard.bool(forKey: "ForceMDC") == true {
            throw "Force MDC"
        }
        // TrollStore method
        try FileManager.default.contentsOfDirectory(at: URL(fileURLWithPath: "/var/mobile/Library/Caches"), includingPropertiesForKeys: nil)
        StatusManager.sharedInstance().setIsMDCMode(false)
    } catch {
        // MDC method
        // grant r/w access
        if #available(iOS 15, *) {
            grant_full_disk_access() { error in
                if (error != nil) {
                    UIApplication.shared.alert(title: "Access Error", body: "Error: \(String(describing: error?.localizedDescription))\nPlease close the app and retry.")
                } else {
                    StatusManager.sharedInstance().setIsMDCMode(true)
                }
            }
        } else {
            UIApplication.shared.alert(title: "MDC Not Supported", body: "Please install via TrollStore")
        }
    }
}

mrx-rx added a commit to mrx-rx/Cowabunga that referenced this issue May 23, 2023
mrx-rx added a commit to mrx-rx/Cowabunga that referenced this issue May 23, 2023
@mrx-rx
Copy link
Contributor

mrx-rx commented May 23, 2023

Addressed in #301. Code fix implemented.

leminlimez added a commit that referenced this issue Jun 17, 2023
Fix Issue #300 for iOS 16.2 Beta 1 users.
leminlimez pushed a commit that referenced this issue Feb 2, 2024
leminlimez pushed a commit that referenced this issue Feb 2, 2024
leminlimez added a commit that referenced this issue Feb 2, 2024
Fix Issue #300 for iOS 16.2 Beta 1 users.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants