Skip to content

Instantly share code, notes, and snippets.

@HoussemNasri
Last active November 15, 2024 19:49
Show Gist options
  • Save HoussemNasri/c09e55e0e5f451aa10f8621a6680ba28 to your computer and use it in GitHub Desktop.
Save HoussemNasri/c09e55e0e5f451aa10f8621a6680ba28 to your computer and use it in GitHub Desktop.
Extend your trial period for Balsamiq Wireframes on Windows and macOS Forever!

Overview

This script will prolong your trial time for Balsamiq Wireframes on both Windows and macOS. You may also manually apply the hack by following the steps in Manual Editing.

Prerequisites

  • python3

⚠️ Warning: Close all balsamiq wireframes instances before proceeding, otherwise the operation won't succeed.

Run the script

⚠️ Works only on Windows, for MacOS check the Manual Editing section.

  1. Download and install python3
  2. Download the script and extract it
  3. Open the terminal and navigate to the script location
  4. Close Balsamiq
  5. Run python BalsamiqForever.py or python3 BalsamiqForever.py

Manual Editing

If running the script didn't do it or you just want to get your hands dirty, here is how to apply the hack manualy by editing configuration files on the application folder.

Windows

  1. Open this file in your text editor %APPDATA%\Balsamiq\Balsamiq Wireframes\LocalSettings.json.
  2. Edit DefaultSelectionColorRGBA property and increase it's value.

For example, if you're using this configuration "DefaultSelectionColorRGBA": 1916130510, your trial will expire in September 20, 2030 🤯, for custom expiration date use this website.

  1. Save changes.

MacOS

Adding support for macOS wouldn't be possible without the help of @pep108 and @megatunger.

  1. Open this file in your text editor /Applications/Balsamiq Wireframes.app/Contents/Resources/editor-macos.js.
  2. Search for this function function getLicenseValidFromLicenseData(data).
  3. Replce function body by return true.
//result
function getLicenseValidFromLicenseData(data) {
      return true
}
  1. Save.
import json
import os
import time
import webbrowser
import sys
import re
def handleWindows(extra_seconds):
print("OS : Windows")
local_settings = r"{}\Balsamiq\Balsamiq Wireframes\LocalSettings.json".format(os.getenv('APPDATA'))
print("Reading from {}".format(local_settings))
with open(local_settings) as reader:
json_data = json.load(reader)
json_data['DefaultSelectionColorRGBA'] = int(time.time()) + extra_seconds
print("Writing to {}".format(local_settings))
with open(local_settings, 'w') as outfile:
json.dump(json_data, outfile)
def handleMacos(trial_days_left=30, debug_mode=False):
print("OS : macOS")
print("Debug Mode: " + str(debug_mode))
def dump_debug(start_func, end_func, content_func, new_func):
print("function start line: {}".format(start_func))
print("function end line: {}".format(end_func))
print("function content:")
print(content_func)
print("new function content:")
print(new_func)
editor_macos = "/Applications/Balsamiq Wireframes.app/Contents/Resources/editor-macos.js"
editor_macos_test = r"C:\Users\housi\Desktop\Balsamiq\editor-macos-test.js"
if debug_mode:
editor_macos = editor_macos_test
print(editor_macos)
if not os.path.exists(editor_macos):
print("editor-macos.js NOT FOUND!")
exit(0)
get_trial_days_left_pattern = re.compile(r"\s*function\s+getTrialDaysLeftFromNativeData\(\w+\)\s*{")
func_start_line = -1
func_end_line = -1
found_a_match = False
function_content = ""
with open(editor_macos, encoding="utf8") as reader:
line_number = 0
# it starts at 1 because w have already matched one '{'
curly_braces_balance = 1
for line in reader.readlines():
line_number += 1
if not found_a_match:
match = get_trial_days_left_pattern.match(line)
if match is not None:
found_a_match = True
func_start_line = line_number
# TODO what if the start line is also the end line, One-Liner function
else:
curly_braces_balance += line.count("{")
curly_braces_balance -= line.count("}")
if curly_braces_balance == 0:
function_content = function_content + line
func_end_line = line_number
break
if func_start_line != -1:
function_content = function_content + line
body = "return {};".format(trial_days_left)
new_function_signature = "\nfunction getTrialDaysLeftFromNativeData(nativeData) {\n\t" + body + "\n}\n\n"
if debug_mode:
dump_debug(func_start_line, func_end_line, function_content, new_function_signature)
with open(editor_macos, encoding="utf8") as reader:
lines = reader.readlines()
# The first -1 to make it base 0 and the second one refers to the previous index
index = (func_start_line - 1) - 1
leading_count = 0
# Removing leading blank lines before the function definition
while not lines[index].strip():
lines.pop(index)
index -= 1
leading_count += 1
# The start and end indexes will change after removing the leading blank lines
func_start_line -= leading_count
func_end_line -= leading_count
# Removing trailing blank lines after the function end
index = func_end_line
while not lines[index].strip():
lines.pop(index)
# Removing the old function
for i in range(func_end_line - func_start_line + 1):
lines.pop(func_start_line - 1)
# Replacing it with the new function
lines.insert(func_start_line - 1, new_function_signature)
# Writing changes back to file
with open(editor_macos, "w", encoding="utf8") as f:
lines = "".join(lines)
f.write(lines)
print("IMPORTANT! please make sure to close Balsamiq before proceeding or the script won't have any effect")
years = int(input("How many years of trial do you want :) "))
if sys.platform.startswith("win"):
handleWindows(years * 365 * 24 * 60 * 60)
elif sys.platform.startswith("darwin"):
handleMacos(years * 365)
else:
print("Sorry, operating system not supported")
exit(0)
print("****************************************************************")
print("* Congratulations! You gained {} days of trial".format(years * 365))
print("* Please don't forget to leave a star ✭")
print("****************************************************************")
print("https://gist.github.com/HoussemNasri/c09e55e0e5f451aa10f8621a6680ba28")
webbrowser.open("https://gist.github.com/HoussemNasri/c09e55e0e5f451aa10f8621a6680ba28")
input("Press ENTER to exit")
@chenqingze
Copy link

ow to do it on Mac? I'm getting error using the manual way.

Hey there!

I've found a way to extend the trial period for Balsamiq Wireframe on Mac. Here's what you need to do:

If you've already installed the software, use "App Cleaner & Uninstaller" to completely uninstall it. You could also use other uninstall software, just make sure it can clean all files generated by Balsamiq Wireframe.

Change the system time to a date in the future, like 10 years from now.

Install the latest version of Balsamiq Wireframe again and open it once. The remaining trial time will show as 30 days.

Change the system date back to the correct date and reopen the software.

You'll notice that the software now says "Expires in 3683 days".

Hope that helps!

Thank you Very Much , bro!
it works for me now ,Balsamiq Wireframes for Desktop Version 4.7.2 ,but i don't know whether or not it still work after macos restart.

@chenqingze
Copy link

ow to do it on Mac? I'm getting error using the manual way.

Hey there!
I've found a way to extend the trial period for Balsamiq Wireframe on Mac. Here's what you need to do:
If you've already installed the software, use "App Cleaner & Uninstaller" to completely uninstall it. You could also use other uninstall software, just make sure it can clean all files generated by Balsamiq Wireframe.
Change the system time to a date in the future, like 10 years from now.
Install the latest version of Balsamiq Wireframe again and open it once. The remaining trial time will show as 30 days.
Change the system date back to the correct date and reopen the software.
You'll notice that the software now says "Expires in 3683 days".
Hope that helps!

Thank you Very Much , bro! it works for me now ,Balsamiq Wireframes for Desktop Version 4.7.2 ,but i don't know whether or not it still work after macos restart.

Screenshot 2023-05-07 at 14 20 09

i've tested it ,it still work after macos restarted

@morbidream
Copy link

Thanks a lot <333

@rubenqba
Copy link

Awesome!! Works like a charm!!

CleanShot 2023-05-13 at 18 58 39

@mattal92
Copy link

mattal92 commented May 14, 2023

Hi, i am novice. Please how to enter the code on macOs. I don't understand when tutorial said
"1. Open this file in your text editor"
Is it TERMINAL or just TEXTEDIT ?

Thanks

@HoussemNasri
Copy link
Author

TextEdit is fine. However, it's possible to edit text files in the terminal too.

@mattal92
Copy link

It's making me crazy, I don't suceeded in. Could you screenshot or made a tuto with pics ?

Thanks !

@HoussemNasri
Copy link
Author

Right now, I only have access to a Windows and Linux PC so it's not possible to take screenshots or do a video tutorial on MacOS. However, you are welcome to provide more details about what you mean by "don't succeed in" so I can help you better 😇

@mattal92
Copy link

Capture d’écran 2023-05-15 à 21 32 50

Hi Is it this ?

@HoussemNasri
Copy link
Author

That's a function call, not the function definition. What you need is to look for is the function name with an opening curly braces, like this function getLicenseValidFromLicenseData(data) {. You can paste the code in a Javascript code formatter to make it easier to read.

@mattal92
Copy link

Thank you HoussemNasri,
sorry really it is just impossible for me to make it.

Someone on macOs could made a pic tuto here to help me ? @rubenqba @chenqingze ? maybe...

Thank you guys

@arvelie
Copy link

arvelie commented May 30, 2023

ow to do it on Mac? I'm getting error using the manual way.

Hey there!

I've found a way to extend the trial period for Balsamiq Wireframe on Mac. Here's what you need to do:

If you've already installed the software, use "App Cleaner & Uninstaller" to completely uninstall it. You could also use other uninstall software, just make sure it can clean all files generated by Balsamiq Wireframe.

Change the system time to a date in the future, like 10 years from now.

Install the latest version of Balsamiq Wireframe again and open it once. The remaining trial time will show as 30 days.

Change the system date back to the correct date and reopen the software.

You'll notice that the software now says "Expires in 3683 days".

Hope that helps!

This works on Mac Ventura MBP M2 3.3.1 (a) with Balsamiq Version 4.7.2

@arvelie
Copy link

arvelie commented May 30, 2023

Screenshot 2023-05-30 at 4 37 25 PM

Screenshot 2023-05-30 at 4 37 12 PM

Thank you! Added 20years on my time :)

@Apurva01021999
Copy link

Doesn't work.

@ZhangChengX
Copy link

Screenshot 2023-06-04 at 3 50 27 PM

Lifetime trial.

@raulicomr
Copy link

raulicomr commented Jun 23, 2023

Hi all,

For macOS (and tested on version 4.7.2) the following steps can be done:

  1. Deploy the app file via dmg file.
  2. Open a terminal and create a file run_balsamiq.sh with the following content:
#! /bin/sh
sudo systemsetup -setusingnetworktime off
# Set date format, example: March 06, 2022, 10:00 am would be 0306100022
sudo date 0306100022
/Applications/Balsamiq\ Wireframes.app/Contents/MacOS/Balsamiq\ Wireframes
sudo systemsetup -setusingnetworktime on
  1. Save the file and give it execution permission:
$ chmod +x run_balsamiq.sh
  1. launch the script to use the app and enter the root password to change the system date:
$ sudo ./run_balsamiq.sh
  1. Enjoy Balsamiq app.

Important: It is necessary to close the app with the right button on its icon in the dock so that it is completely closed and the system date is restored.

@cpamungkas
Copy link

image
working..

@solartes
Copy link

ow to do it on Mac? I'm getting error using the manual way.

Hey there!

I've found a way to extend the trial period for Balsamiq Wireframe on Mac. Here's what you need to do:

If you've already installed the software, use "App Cleaner & Uninstaller" to completely uninstall it. You could also use other uninstall software, just make sure it can clean all files generated by Balsamiq Wireframe.

Change the system time to a date in the future, like 10 years from now.

Install the latest version of Balsamiq Wireframe again and open it once. The remaining trial time will show as 30 days.

Change the system date back to the correct date and reopen the software.

You'll notice that the software now says "Expires in 3683 days".

Hope that helps!

Genius!!! <3

image

@tifinag
Copy link

tifinag commented Aug 29, 2023

On my macos, there is no function getLicenseValidFromLicenseData(data)
Version 4.7.3
Just use this
https://gist.github.com/HoussemNasri/c09e55e0e5f451aa10f8621a6680ba28?permalink_comment_id=4494170#gistcomment-4494170

@mrlutton
Copy link

mrlutton commented Sep 4, 2023

Python script does not work for me but editing the RGBA value in LocalSettings.json did!

@arvelie
Copy link

arvelie commented Sep 4, 2023

Mine is still working but I recently discovered Whimsical for personal use. for those whos having problems with this, try it.

Whimsical

@tieutantan
Copy link

BalsamiqForever.py is working...

@darioesposito
Copy link

Hi,

i have this error:

IMPORTANT! please make sure to close Balsamiq before proceeding or the script won't have any effect
How many years of trial do you want :) 1
OS : macOS
Debug Mode: False
/Applications/Balsamiq Wireframes.app/Contents/Resources/editor-macos.js
Traceback (most recent call last):
File "/Users/darioesposito/Downloads/c09e55e0e5f451aa10f8621a6680ba28-b16f52b9481a49c58f23aaf2b1ae9ca2e897c5d2/BalsamiqForever.py", line 115, in
handleMacos(years * 365)
File "/Users/darioesposito/Downloads/c09e55e0e5f451aa10f8621a6680ba28-b16f52b9481a49c58f23aaf2b1ae9ca2e897c5d2/BalsamiqForever.py", line 82, in handleMacos
while not lines[index].strip():
~~~~~^^^^^^^
IndexError: list index out of range

can someone help? thanks

@m0FhR
Copy link

m0FhR commented Sep 21, 2023

ow to do it on Mac? I'm getting error using the manual way.

Hey there!

I've found a way to extend the trial period for Balsamiq Wireframe on Mac. Here's what you need to do:

If you've already installed the software, use "App Cleaner & Uninstaller" to completely uninstall it. You could also use other uninstall software, just make sure it can clean all files generated by Balsamiq Wireframe.

Change the system time to a date in the future, like 10 years from now.

Install the latest version of Balsamiq Wireframe again and open it once. The remaining trial time will show as 30 days.

Change the system date back to the correct date and reopen the software.

You'll notice that the software now says "Expires in 3683 days".

Hope that helps!


Amazing it works!!!!

@wehwahyu
Copy link

Wow, Works like a charm!!!

Uploading image.png…

@fokklz
Copy link

fokklz commented Nov 22, 2023

Thank you bro

@RobinRuf
Copy link

Godlike - Thanks!

@mahgoe
Copy link

mahgoe commented Nov 22, 2023

Thank you for your effort Houssem

@darioesposito
Copy link

Hi,

i have this error:

IMPORTANT! please make sure to close Balsamiq before proceeding or the script won't have any effect
How many years of trial do you want :) 1
OS : macOS
Debug Mode: False
/Applications/Balsamiq Wireframes.app/Contents/Resources/editor-macos.js
Traceback (most recent call last):
File "/Users/darioesposito/Downloads/c09e55e0e5f451aa10f8621a6680ba28-b16f52b9481a49c58f23aaf2b1ae9ca2e897c5d2/BalsamiqForever.py", line 115, in
handleMacos(years * 365)
File "/Users/darioesposito/Downloads/c09e55e0e5f451aa10f8621a6680ba28-b16f52b9481a49c58f23aaf2b1ae9ca2e897c5d2/BalsamiqForever.py", line 82, in handleMacos
while not lines[index].strip():

IndexError: list index out of range

can someone help? thanks

@HoussemNasri
Copy link
Author

@darioesposito The script works only on Windows, for MacOS follow the manual editing section.

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