Python App Bundle Shield
Welcome to the Python App Bundle Shield! This page provides comprehensive documentation and guidance on how to use the Python App Bundle Shield Script to create standalone protected applications and executable files based on your Python scripts.
Version: 1.3 GUI
© 2024 αβ.net (alphabetanet.com) - Alpha Beta Network. All Rights Reserved.
Introduction
The Python App Bundle Shield Script is a powerful, user-friendly tool designed to help developers create standalone protected applications and executable files from Python scripts of varying complexity. This cross-platform solution supports Python versions 3.6 and above, allowing you to package your Python code into self-contained executables for secure distribution.
Key benefits of using this script include:
- Secure Code Sharing: Utilize advanced encryption and obfuscation methods to protect your Python code during distribution.
- Source Code Protection: Prevent unauthorized access to your code with multi-level protection mechanisms.
- Seamless Application Updates: Update your applications without requiring end-users to reinstall them when using Alpha Beta Network cloud platform protection tools.
- Usage Restrictions: Implement restrictions on each instance of your application, such as expiration dates, hardware-bound licensing, usage frequency limits, and more.
- Cross-Platform Compatibility: Create applications that work on Windows, macOS, Linux/Unix, and other operating systems where Python 3.6+ is installed.
- Ease of Use: Package applications with just a few clicks using a simple graphical interface or automate the process with command-line arguments, without the need for complex configurations.
By combining the Python App Bundle Shield Script with other tools from the Alpha Beta Network, developers can achieve the widest and most flexible possibilities for secure code sharing, source code protection, and secure distribution of their applications.
Key Features
- Unique Code Analysis Technology: Automatically analyzes and collects data about imported modules and dependencies, allowing the use of obfuscated
.py
code and compiled .pyc
files from Python version 3.6 onwards.
- Automatic Embedding of Python Environment: Embeds your complete configured Python environment with all imported modules and packages installed via
pip
into the application build.
- Additional Protection Layers: Implements code obfuscation and encryption of created executable files for enhanced security.
- Seamless Updating of Applications: Allows updating of created applications without the need to reinstall them when using Alpha Beta Network cloud protection tools like the Secure Python Code Manager Script.
- Usage Restrictions: Enables implementation of restrictions on the use of each instance of your program when using scripts protected by Alpha Beta Network tools.
- Support for Cloud-Protected Scripts: Provides extensive capabilities to use Python scripts protected by the Alpha Beta Network cloud platform.
- Ease of Use: Features a simple, user-friendly graphical interface and command-line support that requires no complex configurations.
Main Functions of the Script
- Packaging Python Scripts into Executables: Converts Python source files (
.py
) and compiled files (.pyc
) into standalone executables, making them runnable on systems without requiring Python installation. This can be done via a user-friendly graphical interface or through command-line arguments for automation and scripting capabilities.
- Command-Line Interface Support: Provides flexible command-line arguments for advanced users who prefer automation or need to integrate the packaging process into scripts and build processes.
- Embedding Full Python Runtime: Optionally embeds the entire Python runtime environment and all necessary dependencies into the executable, ensuring functionality even on systems without Python installed.
- Code Obfuscation and Encryption: Applies multi-level protection with dynamic encryption and obfuscation techniques to enhance Python code security.
- Integration with Cloud Protection Tools: Facilitates the use of scripts protected by Alpha Beta Network cloud platform tools, enabling seamless updates and implementation of usage restrictions.
Getting Started
Prerequisites
- Python 3.6+ installed on your system.
Installation
Clone the repository and navigate to the project directory:
git clone https://github.com/alphabetanetcom/python-app-bundle-shield.git
cd python-app-bundle-shield
Installing Required Packages
The script requires the following Python packages:
- requests
- psutil
- cryptography
- decompyle3
- xdis
- astor
- pyinstaller
- tkinter (usually included with Python)
Install them using pip
:
pip install requests psutil cryptography decompyle3 xdis astor pyinstaller
Note: For Windows users, tkinter
may not be included by default. You may need to run the Python installer again and select the option to install tkinter
.
Ensure that you are using the correct version of pip
associated with your Python 3 installation. If you are using a virtual environment, activate it before installing the packages.
User Interface Overview
The Python App Bundle Shield features both a graphical user interface (GUI) and a command-line interface (CLI) to accommodate different user preferences.
Graphical User Interface (GUI)
The GUI includes the following components:
- File Selection: Browse and select the Python file (
.py
or .pyc
) you wish to package.
- Options:
- Auto embed full python runtime: Includes the full Python environment and all installed
pip
packages in the build.
- Disable Console Window: Hides the console window when running the application (useful for GUI applications).
- Create a One-File Bundled Executable: Packages everything into a single executable file.
- Additional Modules: Specify any additional modules (comma-separated) that need to be included.
- Progress Display: Shows the progress of the packaging process.
- Messages: Displays logs and messages during the process.
Command-Line Interface (CLI)
The CLI offers the same functionality as the GUI but allows for automation and integration into scripts.
Basic Usage:
python python_app_bundle_shield.py -f <path_to_file> [options]
Options:
-f
, --file
: (Required) Path to the Python source file (.py
) or compiled file (.pyc
).
-a
, --autoembed
: Auto embed the full Python runtime and all installed pip
packages.
-w
, --windowed
: Disable the console window for the packaged application.
-o
, --onefile
: Create a one-file bundled executable.
-m
, --module
: Specify additional modules to include (comma-separated).
Usage
The Python App Bundle Shield provides the following main functionalities:
- Packaging Python Scripts into Executables
- Embedding Full Python Runtime
- Code Obfuscation and Encryption
- Integration with Cloud Protection Tools
Basic Usage
Packaging a Python Source File using the GUI
- Launch the Script:
python python_app_bundle_shield.py
- Select Your File: Click "Browse" and select your
.py
file.
- Click "Start": The script will package your file into an executable in the
dist
directory.
Packaging with Full Python Runtime using the GUI
- Select Your File: As above.
- Enable "Auto embed full python runtime": Check the option.
- Optional: Specify any additional modules in the "Additional Modules" field.
- Click "Start": The script will package your file into an executable, including the full Python runtime.
Packaging with Cloud-Protected Scripts using the GUI
- Obtain Cloud-Protected Script: Use the Python Obfuscator Online or Secure Python Code Manager Script to obtain your protected script.
- Select Your File: Choose the cloud-protected
.py
file.
- Enable "Auto embed full python runtime": Check the option.
- Click "Start": The script will create an executable optimized for cloud-protected scripts.
Note: If your application requires additional modules that are not automatically detected, you can specify them (comma-separated) in the Additional Modules field.
Command-Line Usage Examples
The Python App Bundle Shield supports operation via command-line arguments, enabling automation and scripting capabilities.
Basic Packaging of a Source File
To package a Python source file into an executable using the command line:
python python_app_bundle_shield.py -f /path/to/your_script.py
This command will package your_script.py
into an executable in the dist
directory.
Packaging with Full Python Runtime
If your script uses additional modules or requires the full Python environment:
python python_app_bundle_shield.py -f /path/to/your_script.py -a
The -a
or --autoembed
flag instructs the script to embed the full Python runtime and all installed packages.
Packaging a Compiled Python File
To package a compiled Python file (.pyc
):
python python_app_bundle_shield.py -f /path/to/your_compiled_script.pyc
The script will handle version detection and packaging appropriately.
Packaging with Additional Options
You can combine multiple options to customize the packaging process:
python python_app_bundle_shield.py -f /path/to/your_script.py -w
- Create a One-File Executable:
python python_app_bundle_shield.py -f /path/to/your_script.py -o
- Specify Additional Modules:
python python_app_bundle_shield.py -f /path/to/your_script.py -m module1,module2
Full Example with All Options
python python_app_bundle_shield.py -f /path/to/your_script.py -a -w -o -m requests,psutil
This command will:
- Package
your_script.py
into a one-file executable.
- Embed the full Python runtime (
-a
).
- Disable the console window (
-w
).
- Include the additional modules
requests
and psutil
(-m requests,psutil
).
Additional Features
Command-Line Interface Support
The Python App Bundle Shield now supports operation via command-line arguments, enabling automation and scripting capabilities.
You can use the command-line interface to package your Python scripts without using the graphical user interface (GUI), which is especially useful for automating the packaging process in scripts and build environments.
Command-Line Usage
python python_app_bundle_shield.py -f <path_to_file> [options]
Options:
-f
, --file
: (Required) Path to the Python source file (.py
) or compiled file (.pyc
).
-a
, --autoembed
: Automatically embed the full Python runtime and all installed pip
packages.
-w
, --windowed
: Disable the console window for the packaged application (useful for GUI applications).
-o
, --onefile
: Create a one-file bundled executable.
-m
, --module
: Specify additional modules to include (comma-separated).
Command-Line Examples
Packaging a Python Script
To package a Python script into an executable:
python python_app_bundle_shield.py -f /path/to/your_script.py
Packaging with Full Python Runtime
If your script requires the full Python runtime and installed packages:
python python_app_bundle_shield.py -f /path/to/your_script.py -a
Creating a One-File Executable Without Console Window
To create a one-file executable without a console window:
python python_app_bundle_shield.py -f /path/to/your_script.py -o -w
Specifying Additional Modules
If your script requires additional modules that are not automatically detected, specify them using the -m
option:
python python_app_bundle_shield.py -f /path/to/your_script.py -m module1,module2
Full Example
A full example combining multiple options:
python python_app_bundle_shield.py -f /path/to/your_script.py -a -w -o -m requests,psutil
This command will:
- Package
your_script.py
into a one-file executable.
- Embed the full Python runtime (
-a
).
- Disable the console window (
-w
).
- Include the additional modules
requests
and psutil
(-m requests,psutil
).
Application Areas
The Python App Bundle Shield can be effectively applied in the following areas:
- Commercial Distribution: Safely distribute applications to clients or customers with advanced code protection.
- Collaborative Development: Share applications securely with colleagues or team members without exposing the source code.
- Intellectual Property Protection: Maintain control over your code to prevent unauthorized usage or copying.
- Educational Purposes: Teach concepts of code protection and secure application distribution.
- Secure Code Sharing: Implement code encryption and obfuscation to securely share your applications.
Security and Best Practices
By using the Python App Bundle Shield, you adhere to Python code security best practices, ensuring that your applications are better protected during distribution.
Recommendations:
- Use Separate Environments: When embedding the full Python runtime, use a separate environment configured specifically for your script to keep the build size compact.
- Test on Clean Systems: Test your application's autonomy on a clean virtual machine or sandbox where only the operating system is installed.
- Handle External Dependencies: If your script uses external programs, include them in the
_internal
directory of the application build.
- Avoid Untrusted Scripts: Do not use this tool to create applications based on Python scripts from unreliable or unknown sources.
- Match Operating Systems: Create standalone applications on the operating system where future use is planned and with the same architecture.
- Use Appropriate Python Version: Use the tool in an environment with the Python version that is directly required for your script's operation.
- Leverage Command-Line Interface for Automation: Utilize the command-line interface for integrating the packaging process into your build automation scripts or continuous integration pipelines.
- Stay Updated: Regularly update your tools and environments to benefit from the latest security enhancements.
Licensing
This project is currently in Beta Testing and available for free.
License Agreement
© 2024 αβ.net (alphabetanet.com) - Alpha Beta Network. All Rights Reserved.
For detailed license information, please refer to the License Agreement file.
Frequently Asked Questions (FAQ)
Q1: Can I use this tool to package scripts that require external programs?
A1: Yes, but you may need to manually include these external programs in the _internal
directory of the application build.
Q2: Do I need to make any changes to my original Python scripts before packaging?
A2: No, you can package your existing .py
or .pyc
files directly. However, if your script uses additional modules, ensure they are installed in your environment.
Q3: Can I update my application without requiring users to reinstall it?
A3: Yes, when using scripts protected by the Alpha Beta Network cloud platform, you can update the code seamlessly without end-users needing to reinstall the application.
Q4: Is it possible to implement usage restrictions on my packaged applications?
A4: Yes, by using scripts protected by Alpha Beta Network tools, you can implement various usage restrictions such as expiration dates, hardware-bound licensing, and usage frequency limits.
Q5: Does the executable work on any operating system?
A5: The executable is platform-specific. You'll need to create the executable on the target operating system for best compatibility.
Alternative Solutions
Alpha Beta Network offers additional tools for code protection and optimization:
Appendices
Appendix A: Installation of Required Packages
Ensure the following packages are installed:
pip install requests psutil cryptography decompyle3 xdis astor pyinstaller
If you encounter issues related to package versions or compatibility, consider creating a virtual environment for your project.
Appendix B: Cross-Platform Compatibility
The Python App Bundle Shield supports packaging applications for:
Notes:
- Create the executable on the target operating system for best compatibility.
- For Windows, the executable will have a
.exe
extension.
- On macOS and Linux, you may need to run
chmod +x
on the executable to make it runnable.
Official Repositories
You can find the official repositories for this tool at the following links: