wibus-wee / InjectGUI

macOS Integrated Injection Framework (GUI version)
GNU General Public License v3.0
1.2k stars 74 forks source link

Password characters are limited or incorrect #14

Closed Shawn-Jones-7 closed 2 months ago

Shawn-Jones-7 commented 3 months ago

My password contains "," and when I am asked to enter the password, no matter how I switch the input, it is always wrong, which forces me to change my password.

wibus-wee commented 2 months ago

fixed

Shawn-Jones-7 commented 2 months ago

fixed

I conducted another test and the issue remained unchanged. Possibly, my previous formulation was incorrect. Specifically, it was "\ or | or、 " precisely above the Enter key.

wibus-wee commented 2 months ago

OK, I'll test it again.

RayPS commented 2 months ago

Same issue here

wibus-wee commented 2 months ago

Can you test whether the artifact is effective?

https://github.com/wibus-wee/InjectGUI/actions/runs/10416144750

RayPS commented 2 months ago

Can you test whether the artifact is effective?

https://github.com/wibus-wee/InjectGUI/actions/runs/10416144750

Thank you for investigating the issue, but the problem still persists in this artifact.

wibus-wee commented 2 months ago

Can you test whether the artifact is effective? wibus-wee/InjectGUI/actions/runs/10416144750

Thank you for investigating the issue, but the problem still persists in this artifact.

I will continue to check the code problem. Thanks for the feedback!

RayPS commented 2 months ago

Also new to Swift but I've personally made these changes to avoid dealing with special characters:

func checkAndSavePassword():

-        executor.password = password
+        executor.password = password.encode()

func runAdminCommand():

-            task.arguments = ["-c", "echo \(self.password) | sudo -S bash -c \"\(escapedCommand)\""]
+            task.arguments = ["-c", "echo \(self.password) | base64 --decode | sudo -S bash -c \"\(escapedCommand)\""]

extension String {}:

    func encode() -> String {
        if let data = self.data(using: .utf8) {
            return data.base64EncodedString()
        }
        return ""
    }

Hope that helps.

wibus-wee commented 2 months ago

@RayPS Thanks for the code!