Skip to content

Instantly share code, notes, and snippets.

@xqin
Last active July 14, 2025 01:55
Show Gist options
  • Save xqin/20a51ea523a738acfe6773616a26b2c9 to your computer and use it in GitHub Desktop.
Save xqin/20a51ea523a738acfe6773616a26b2c9 to your computer and use it in GitHub Desktop.
HyperSwitch expired patch

HyperSwitch expired!

This beta version has expired.

https://bahoom.com/hyperswitch/appcast-test.xml


Patch for HyperSwitch 0.3.10-dev

Download URL: https://bahoom.com/hyperswitch/0.3.10-dev/HyperSwitch.zip

sha1: a0e5cdda575c6563b6a7f9f333ba7eff4f4f90f1

cd /Applications/HyperSwitch.app/Contents/MacOS/

sha1sum HyperSwitch
# 861cb3d777a290e7eb899bde876e3a7df6b55378  HyperSwitch

cp HyperSwitch HyperSwitch.original

cp HyperSwitch.original HyperSwitch.unsigned

codesign --remove-signature HyperSwitch.unsigned

printf "03B202: 8D\n01146C4: 0C" | xxd -r - HyperSwitch.unsigned

mv HyperSwitch.unsigned HyperSwitch

rm HyperSwitch.original # remove HyperSwitch.original, if you want

PS: '01146C4: 0C' for AArch64, '03B202: 8D' for x86_64


  1. 根据关键字 HyperSwitch expired! 定位至使用的函数内.

0.2.593-dev 如下:

void sub_100039a57(void * _block) {
    rax = time(&var_20);
    var_20 = rax;
    if (rax >= 0x62b955d3) {
            rax = [NSAlert alloc];
            rax = [rax init];
            rax = [rax autorelease];
            [rax setAlertStyle:0x0];
            [rax setMessageText:@"HyperSwitch expired!"];
            [rax setInformativeText:@"This beta version has expired."];
            [rax setIcon:[NSImage imageNamed:@"hyperswitch"]];
            [rax addButtonWithTitle:@"Check for Updates ..."];
            [rax addButtonWithTitle:@"Quit"];
            rax = [rax runModal];
            rax = rax << 0x20;
            if (rax != 0x3e900000000) {
                    if (rax == 0x3e800000000) {
                            [[SUUpdater sharedUpdater] resetUpdateCycle];
                            [[SUUpdater sharedUpdater] checkForUpdates:0x0];
                    }
            }
            else {
                    [**_NSApp terminate:0x0];
            }
    }
    return;
}

光标定位在 0x62b955d3 上, 切换到 汇编 模式下:

jl xxx
 48 3D D3 55 B9 62 0F 8C 38 01 00 00

jl 指令 修改为 jg, 调整为相反的判断条件, 以达到 屏蔽过期 弹窗的目的.

jg xxx
 48 3D D3 55 B9 62 0F 8F 38 01 00 00

最后合成 sed 命令.

sed -i 's/\x48\x3D\xD3\x55\xB9\x62\x0F\x8C\x38\x01\x00\x00/\x48\x3D\xD3\x55\xB9\x62\x0F\x8F\x38\x01\x00\x00/' HyperSwitch
@AlbiDR
Copy link

AlbiDR commented Mar 7, 2025

This is once again happening. "This beta version has expired" even if reinstalled from the official website.
Is there any solution for this?

@xqin
Copy link
Author

xqin commented Mar 10, 2025

@AlbiDR

For version of 0.3.10-dev, the patch is:

sed -i 's/\x48\x3D\x2D\x5D\xB6\x67\x0F\x8C\x36\x01\x00\x00/\x48\x3D\x2D\x5D\xB6\x67\x0F\x8D\x36\x01\x00\x00/' HyperSwitch

change:

48 3D 2D 5D B6 67 0F 8C 36 01 00 00 into 48 3D 2D 5D B6 67 0F 8D 36 01 00 00

@AlbiDR
Copy link

AlbiDR commented Mar 11, 2025

@xqin thanks for the answer. I realized only after commenting that this thread was opened 3 years ago - the fact you still answered is crazy

Not sure if I did something wrong but running the command from Terminal I get the following error
sed: 1: "HyperSwitch": extra characters at the end of H command

@xqin
Copy link
Author

xqin commented Mar 11, 2025

@AlbiDR sorry about that.

try this:

cd /Applications/HyperSwitch.app/Contents/MacOS/

cp HyperSwitch HyperSwitch.original

cp HyperSwitch.original HyperSwitch.unsigned

codesign --remove-signature HyperSwitch.unsigned

printf "03B202: 8D\n01146C4: 0C" | xxd -r - HyperSwitch.unsigned

mv HyperSwitch.unsigned HyperSwitch


rm HyperSwitch.original # remove HyperSwitch.original, if you want

After completing the above steps, exit the app and reopen it.

You may also need to grant it the corresponding permissions again.

@AlbiDR
Copy link

AlbiDR commented Mar 12, 2025

@AlbiDR
This breaks the app and it won't allow it to work any longer unfortunately: "The application “HyperSwitch.app” can’t be opened.". I love this app but this bug it's making it basically unusable

@xqin
Copy link
Author

xqin commented Mar 12, 2025

Disable SIP first.

@AlbiDR
Copy link

AlbiDR commented Mar 16, 2025

@xqin Hmm interesting, while it does seem to work with SIP off. I need it enabled for another app that causes issues when it's disabled.

This said, it's a shame this is the state of the issue considering that you reported it first 3 years ago. I will have to use AltTab which, despite being the more updated and recommended application, is not really my favorite. I like Hyperswitch's implementation much much more.

Hopefully this will once again get fixed in the future

@larspehrsson
Copy link

larspehrsson commented Mar 19, 2025

This worked for me to UPDATE the app, but it looks like it is still complaining. OP must be using a gnu version of sed.

cd /Applications/HyperSwitch.app/Contents/MacOS
LC_ALL=C sed -i '' 's/\x48\x3D\x2D\x5D\xB6\x67\x0F\x8C\x36\x01\x00\x00/\x48\x3D\x2D\x5D\xB6\x67\x0F\x8D\x36\x01\x00\x00/' HyperSwitch

or with perl:

cd /Applications/HyperSwitch.app/Contents/MacOS
perl -pi -e 's/\x48\x3D\x2D\x5D\xB6\x67\x0F\x8C\x36\x01\x00\x00/\x48\x3D\x2D\x5D\xB6\x67\x0F\x8D\x36\x01\x00\x00/g' HyperSwitch

A workaround is just to click "check for updates" and it will run anyway.

my sha values before and after. They are different than @xqin's

after: 1ece650c808e4a3fa372f2fd98439d7e55f4e78e HyperSwitch
before: 861cb3d777a290e7eb899bde876e3a7df6b55378 HyperSwitch.backup

Note that only 1 byte is changed in the sed command. 8C is changed to 8D.

You can run this to visualise the changes:

xxd HyperSwitch > hs.hex
xxd HyperSwitch.backup > hs_backup.hex
diff -u hs_backup.hex hs.hex

And you will see just one change (blue what we search for, and yellow what we change)
image

The patch changes a < to a >=, reversing the logic for the comparison with the current timestamp.

0F 8C 36 01 00 00   ; J**L** (jump if **less**, signed)
→
0F 8D 36 01 00 00   ; J**GE** (jump if **greater or equal**, signed)

@AlbiDR
Copy link

AlbiDR commented Mar 20, 2025

@larspehrsson unfortunately clicking check for updates does almost nothing for me. It goes away for a few minutes and then comes back once again (when I say "few minutes" I mean it literally, as it's around 2 to 15 minutes avg.)

As of now I simply got VERY tired and switched to AltTab. It really sucks because despited AT being the more famous app, I much more prefer HyperSwitch and the way it implements the feature. Oh well

@xqin
Copy link
Author

xqin commented Mar 21, 2025

Please check sha1sum before and after of HyperSwitch.

I've also tried AltTab before, but I like HyperSwitch better.

➜  MacOS pwd
/Applications/HyperSwitch.app/Contents/MacOS
➜  MacOS sha1sum HyperSwitch*
9c729937a902697efb5ad01a4d5ef70d6006d16f  HyperSwitch
861cb3d777a290e7eb899bde876e3a7df6b55378  HyperSwitch.original

861cb3d777a290e7eb899bde876e3a7df6b55378 before.

9c729937a902697efb5ad01a4d5ef70d6006d16f after.

image

@ArcanusNEO
Copy link

@xqin Thank you very much for your patch! But I can only get this patched verison of HyperSwitch working by executing /Applications/HyperSwitch.app/Contents/MacOS/HyperSwitch in the Terminal. Clicking the App icon or running it via launchd will end up with a permission request dialog, even if all the permissions are granted:
截屏2025-03-31 00 25 00
截屏2025-03-31 00 30 50
Are there some sort of macOS system restrictions of patched Apps?

@xqin
Copy link
Author

xqin commented Mar 31, 2025

@ArcanusNEO 因为文件的签名变了(移除了),所以需要重新授予权限。
从列表中 选中, 点 - 号 删除掉, 之后点 + 号重新添加进来,再重新开启权限即可。

@ArcanusNEO
Copy link

@ArcanusNEO 因为文件的签名变了(移除了),所以需要重新授予权限。 从列表中 选中, 点 - 号 删除掉, 之后点 + 号重新添加进来,再重新开启权限即可。

非常感谢,可以正常工作了

@larspehrsson
Copy link

Correct me if I am wrong, but this patch seems to only patch the x86 part of the binary and not the arm part. So if you are running any M model, it won't work.

@xqin
Copy link
Author

xqin commented Jun 11, 2025

Correct me if I am wrong, but this patch seems to only patch the x86 part of the binary and not the arm part. So if you are running any M model, it won't work.

x86 and arm patch is here.

I am very happy to see people with the same interests participating in the discussion. @larspehrsson

https://gist.github.com/xqin/20a51ea523a738acfe6773616a26b2c9?permalink_comment_id=5485926#gistcomment-5485926

image

@xqin
Copy link
Author

xqin commented Jun 11, 2025

Later, I will update the patch method for HyperSwitch 0.3.10-dev to the gist.

@ArcanusNEO
Copy link

Correct me if I am wrong, but this patch seems to only patch the x86 part of the binary and not the arm part. So if you are running any M model, it won't work.

This patch works on my M3 MacBook.

@AlbiDR
Copy link

AlbiDR commented Jun 11, 2025

Just a reminder for everyone, this patch only works with SIP off.. which is not, and should not, be normal behavior.
Until it will be fixed and work normally, I'll stick to AltTab

@xqin
Copy link
Author

xqin commented Jun 12, 2025

Just a reminder for everyone, this patch only works with SIP off.. which is not, and should not, be normal behavior. Until it will be fixed and work normally, I'll stick to AltTab

The prerequisite for modifying third-party software is to turn off SIP, which is a very normal behavior (because when SIP is turned on, the system does not allow you to modify it).

If you don’t understand, please don’t talk nonsense.

@AlbiDR
Copy link

AlbiDR commented Jun 12, 2025

The prerequisite for modifying third-party software is to turn off SIP, which is a very normal behavior (because when SIP is turned on, the system does not allow you to modify it).

If you don’t understand, please don’t talk nonsense.

When I said it shouldn't be normal behavior, what I meant was that the app is not working in an intact environment, which itself is not normal behavior. This is particularly true given that it used to function perfectly for years. My comment wasn't about the patch itself, so calm down as there's no need to get upset.

As I previously said, I don't mind SIP being off, but I have a crucial app that requires SIP to be enabled. Therefore, despite my love for Hyperswitch, I'll have to stop using it because of it not working (at all) in an intact environment where SIP is enabled.

@xqin
Copy link
Author

xqin commented Jun 14, 2025

The prerequisite for modifying third-party software is to turn off SIP, which is a very normal behavior (because when SIP is turned on, the system does not allow you to modify it).
If you don’t understand, please don’t talk nonsense.

When I said it shouldn't be normal behavior, what I meant was that the app is not working in an intact environment, which itself is not normal behavior. This is particularly true given that it used to function perfectly for years. My comment wasn't about the patch itself, so calm down as there's no need to get upset.

As I previously said, I don't mind SIP being off, but I have a crucial app that requires SIP to be enabled. Therefore, despite my love for Hyperswitch, I'll have to stop using it because of it not working (at all) in an intact environment where SIP is enabled.

I think you misunderstood. You need to turn off SIP to run, not because Hyperswitch needs it, but in the scenario of modifying (cracking) software, only when SIP is turned off, the operating system allows the modified software to run.

As for the modification point of the software, a friend has explained it before. A judgment instruction was modified so that the condition is not met and the prompt box of software expiration is not popped up.

If you don’t understand what is being done here, I suggest you don’t continue to participate in the discussion.

@larspehrsson
Copy link

larspehrsson commented Jun 16, 2025

Correct me if I am wrong, but this patch seems to only patch the x86 part of the binary and not the arm part. So if you are running any M model, it won't work.

x86 and arm patch is here.

Thanks.. Either it is a new guide, or I missed it before. Anyway. It works on arm64.

If anyone is interested: The patch changes a less than "31.12.2024" to greater than "31.12.2024" and skips the expired warning.

Just a reminder for everyone, this patch only works with SIP off.. which is not, and should not, be normal behavior. Until it will be fixed and work normally, I'll stick to AltTab

The prerequisite for modifying third-party software is to turn off SIP, which is a very normal behavior (because when SIP is turned on, the system does not allow you to modify it).

If you don’t understand, please don’t talk nonsense.

If you have access to a Mac where SIP is disabled, you can do the changes there and copy the patched file over.

On machine with SIP disabled. Install HyperSwitch and patch the file.

sudo xattr -cr /Applications/HyperSwitch.app
sudo codesign -s - --deep --force /Applications/HyperSwitch.app

Copy /Applications/HyperSwitch.app to your destination computer with scp and then run this on your destination computer:

sudo xattr -cr /Applications/HyperSwitch.app
sudo codesign -s - --deep --force /Applications/HyperSwitch.app

When Mac asks for permissions that you might already have given, click "-" to remove the old app and + to add the new app in /Applications/HyperSwitch.app.

@afanjul
Copy link

afanjul commented Jul 11, 2025

I don't think it's necessary to disable SIP, at least I haven't found it to be required:

Steps:

  1. Download Sentinel (simply because it's more convenient than using the Terminal)
  2. Disable Gatekeeper protection (don't know if its completely necessary but just in case, I always have gatekeeper disabled)
sentinel
  1. Follow the instructions in @xqin gist, ie, for ARM macos:
cd /Applications/HyperSwitch.app/Contents/MacOS/
sha1sum HyperSwitch
# 861cb3d777a290e7eb899bde876e3a7df6b55378  HyperSwitch
cp HyperSwitch HyperSwitch.original
cp HyperSwitch.original HyperSwitch.unsigned
codesign --remove-signature HyperSwitch.unsigned
printf "03B202: 8D\n01146C4: 0C" | xxd -r - HyperSwitch.unsigned
mv HyperSwitch.unsigned HyperSwitch
rm HyperSwitch.original # remove HyperSwitch.original, if you want
  1. Drag the "HyperSwitch.app" into Sentinel (where it says Sign app with ad-hoc identity)
  2. Grant the necessary permissions (if you had it installed before, remove the app from permissions (with the "-" icon) and add it again properly with the "+" icon or by dragging)
  3. And you're done!

If this method doesn’t work for you and you absolutely need to disable SIP, but you don't wanna mess things up starting macos in SIP disabled mode, here’s what you can do:

  1. Boot into macOS Recovery Mode and open Terminal from there.
  2. Temporarily disable SIP with csrutil disable.
  3. Follow the instructions from @xqin, keeping in mind that your HyperSwitch.app will be located at /Volumes/Macintosh HD/Applications/HyperSwitch.app or similar, and that the "xxd" tool must be run with the absolute path, like this:
cd /Volumes/Macintosh\ HD/Applications/HyperSwitch.app/
sha1sum HyperSwitch
# 861cb3d777a290e7eb899bde876e3a7df6b55378  HyperSwitch
cp HyperSwitch HyperSwitch.original
cp HyperSwitch.original HyperSwitch.unsigned
codesign --remove-signature HyperSwitch.unsigned
printf "03B202: 8D\n01146C4: 0C" | /Volumes/Macintosh\ HD/usr/bin/xxd -r - HyperSwitch.unsigned
mv HyperSwitch.unsigned HyperSwitch
rm HyperSwitch.original # remove HyperSwitch.original if you want
  1. Then, re-enable SIP with csrutil enable.
  2. Restart your computer and sign the app with your own certificate (either via command line or using the Sentinel app).
  3. And you’re all set.

@AlbiDR
Copy link

AlbiDR commented Jul 12, 2025

@afanjul Yup, Sentinel is exactly the method I discovered and it works great. I can finally use HyperSwitch again - as it should work right away and without any patch.. (It did not work for me at all once SIP got enabled back)

I've been using this method for a little bit already

@afanjul
Copy link

afanjul commented Jul 13, 2025

@afanjul Yup, Sentinel is exactly the method I discovered and it works great. I can finally use HyperSwitch again - as it should work right away and without any patch.. (It did not work for me at all once SIP got enabled back)

I've been using this method for a little bit already

So you didn't have to patch it to make it works without beta expire warning ?
It's a bit strange Because The Only Thing That sentinel does Is To Sign The app With Self-signed certificate as You Can do in terminal

@AlbiDR
Copy link

AlbiDR commented Jul 13, 2025

@afanjul Sorry, I might have explained myself poorly.
Yes, I did have to patch the app through Terminal.
Yes, I did have to patch the app through Sentinel.

What wasn't working before was using the app with SIP; even if I turned it on afterwards (i.e. SIP had to stay off at all times or I would get the same "expired" error).
.
.
.

  1. Disable Gatekeeper protection.

PS: Disabling Gatekeeper is not necessary for this to work

@xqin
Copy link
Author

xqin commented Jul 14, 2025

@afanjul You already have a developer certificate and can sign your own app, so of course you don't need to turn off SIP.

In addition, Gatekeeper cannot be disabled in some scenarios, but SIP can be disabled in recovery mode.

image

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