# How the ActivatePro Patch Works in Wand-Enhancer: Technical Implementation Guide

> Discover how the ActivatePro patch works in Wand-Enhancer. This technical guide explains how it injects a yearly subscription object into the JavaScript bundle to grant permanent Pro access.

- Repository: [k1tbyte/Wand-Enhancer](https://github.com/k1tbyte/Wand-Enhancer)
- Tags: technical-implementation-guide
- Published: 2026-09-01

---

**The ActivatePro patch forces the Wand desktop client to permanently recognize the user as a Pro subscriber by injecting an active yearly subscription object into four critical account-related code paths within the application's JavaScript bundle.**

The ActivatePro patch is a built-in modification system within Wand-Enhancer designed to prevent the Wand application from clearing Pro features during normal operations. By intercepting API responses and state management functions, this patch ensures that `subscription = { period: "yearly", state: "active" }` remains present in the account object regardless of subsequent server responses or user actions.

## The Four Injection Points of the ActivatePro Patch

The patch operates by rewriting four distinct account-related code paths in Wand’s minified JavaScript bundle. Each target serves a specific purpose in maintaining the spoofed subscription status.

### Patching getUserAccount API Responses

The first target is the `getUserAccount` function, which performs the API call to `/v3/account`. According to the source code in [`EnhancerConfig.cs`](https://github.com/k1tbyte/Wand-Enhancer/blob/main/EnhancerConfig.cs), the patch wraps the original fetch response to inject the subscription object before the promise resolves.

```csharp
// https://github.com/k1tbyte/Wand-Enhancer/blob/master/WandEnhancer/Core/EnhancerConfig.cs#L124-L125
Patch = "getUserAccount(){return this.#<service_name>.fetch({endpoint:\"/v3/account\",method:\"GET\",name:\"/v3/account\",collectMetrics:0}).then(response=>{response.subscription={period:\"yearly\",state:\"active\"};return response;})}"

```

This ensures that whenever Wand fetches user data, the response always contains an active yearly subscription, bypassing the actual account status check.

### Intercepting setAccountWandBrandExperience

The second injection point targets `setAccountWandBrandExperience`, which handles POST requests to `/v3/account/brand_experience_wand`. The patch applies the same subscription injection pattern to the returned response, ensuring that brand experience updates do not inadvertently reset the Pro status.

### Modifying setAccountLanguage Method Bodies

The third target, `setAccountLanguage`, handles POST requests to `/v3/account/language`. This patch is particularly critical because language changes normally trigger account state refreshes that could clear Pro features. The implementation uses a **PatchFactory** to rebuild the method body while preserving original parameter names, inserting the subscription object into the response handling logic.

### Guarding setAccountReducer State Updates

The fourth and final target is `setAccountReducer`, the Redux-style reducer that processes the `ACTION_SET_ACCOUNT` action. This patch adds a guard clause that ensures any store update preserving the account object maintains the `subscription` field, catching updates that might bypass the patched API methods.

## Configuration and Patch Architecture

All four patches are defined in **[`EnhancerConfig.cs`](https://github.com/k1tbyte/Wand-Enhancer/blob/main/EnhancerConfig.cs)** under the `EPatchType.ActivatePro` dictionary entry. The configuration maps patch types to arrays of `PatchEntry` objects, each specifying a regex target, service name resolver, and replacement string.

```csharp
// https://github.com/k1tbyte/Wand-Enhancer/blob/master/WandEnhancer/Core/EnhancerConfig.cs#L100-L128
public static Dictionary<EPatchType, PatchEntry[]> GetInstance()
{
    return new Dictionary<EPatchType, PatchEntry[]>()
    {
        {
            EPatchType.ActivatePro,
            new[]
            {
                // getUserAccount()
                new PatchEntry { … },

                // setAccountWandBrandExperience()
                new PatchEntry { … },

                // setAccountLanguage()
                new PatchEntry { … },

                // setAccountReducer
                new PatchEntry { … }
            }
        },
        …
    };
}

```

Each `PatchEntry` contains three critical components:
- **Regex Target**: Matches the original function signature in the minified bundle
- **Service Resolver**: Discovers the private service name placeholder (`<#service_name>`)
- **Patch String**: The replacement code body containing the instrumentation

## UI Integration and Activation Flow

The user-facing component resides in **[`PatchVectorsPopup.xaml.cs`](https://github.com/k1tbyte/Wand-Enhancer/blob/main/PatchVectorsPopup.xaml.cs)**. The dialog presents an `ActivateProBox` checkbox that, when selected, adds `EPatchType.ActivatePro` to the active patch configuration.

```csharp
// https://github.com/k1tbyte/Wand-Enhancer/blob/master/WandEnhancer/View/Popups/PatchVectorsPopup.xaml.cs#L78-L81
if (ActivateProBox.IsChecked == true)
{
    result.Add(EPatchType.ActivatePro);
}

```

The resulting `PatchConfig` object is defined in **[`Models/PatchConfig.cs`](https://github.com/k1tbyte/Wand-Enhancer/blob/main/Models/PatchConfig.cs)**, which includes the `EPatchType` enum containing the `ActivatePro` value. When the user clicks *Patch*, the enhancer engine reads the configuration, extracts the `app.asar` JavaScript bundle, applies the regex replacements defined in [`EnhancerConfig.cs`](https://github.com/k1tbyte/Wand-Enhancer/blob/main/EnhancerConfig.cs), and repacks the modified bundle.

## Implementation Example

To programmatically activate the patch, instantiate a `PatchConfig` with the `ActivatePro` type enabled:

```csharp
var config = new PatchConfig
{
    PatchTypes = new HashSet<EPatchType> { EPatchType.ActivatePro },
    AutoApplyPatches = true,
    Path = @"C:\Program Files\Wand\resources\app.asar"
};
// Pass to the enhancer engine – it will invoke the patches defined in EnhancerConfig.cs

```

The engine then processes the `app.asar` file, applies the four regex substitutions to inject the subscription spoofing logic, and ensures that Wand’s runtime always perceives an active Pro subscription.

## Summary

- The **ActivatePro patch** targets four specific account-related functions: `getUserAccount`, `setAccountWandBrandExperience`, `setAccountLanguage`, and `setAccountReducer`.
- Configuration resides in **[`EnhancerConfig.cs`](https://github.com/k1tbyte/Wand-Enhancer/blob/main/EnhancerConfig.cs)**, which maps `EPatchType.ActivatePro` to an array of `PatchEntry` objects containing regex patterns and replacement strings.
- The **UI activation** occurs through [`PatchVectorsPopup.xaml.cs`](https://github.com/k1tbyte/Wand-Enhancer/blob/main/PatchVectorsPopup.xaml.cs), where the `ActivateProBox` checkbox adds the patch type to the configuration set.
- Each patch injection forces the subscription object to `{period: "yearly", state: "active"}`, ensuring Pro features persist through language changes and account updates.

## Frequently Asked Questions

### What specific files does the ActivatePro patch modify?

The patch modifies the extracted JavaScript bundle from Wand's `app.asar` archive, specifically targeting minified code sections containing the `getUserAccount`, `setAccountWandBrandExperience`, `setAccountLanguage`, and `setAccountReducer` functions. The source definitions reside in **[`WandEnhancer/Core/EnhancerConfig.cs`](https://github.com/k1tbyte/Wand-Enhancer/blob/main/WandEnhancer/Core/EnhancerConfig.cs)**, while the activation logic is handled in **[`WandEnhancer/View/Popups/PatchVectorsPopup.xaml.cs`](https://github.com/k1tbyte/Wand-Enhancer/blob/main/WandEnhancer/View/Popups/PatchVectorsPopup.xaml.cs)**.

### How does the patch survive language changes in the Wand application?

The patch specifically targets `setAccountLanguage`, which handles POST requests to `/v3/account/language`. By injecting the subscription object into this method's response handling via the **PatchFactory**, the patch ensures that language updates—which normally trigger account state refreshes—preserve the spoofed Pro status rather than clearing it.

### Is the ActivatePro patch reversible?

Yes, because Wand-Enhancer operates on a copy of the `app.asar` bundle (or modifies it with backup capability), restoring the original client files removes all patches. The patch does not modify server-side account records; it only affects local client-side JavaScript execution.

### What distinguishes the setAccountReducer patch from the API method patches?

While the `getUserAccount`, `setAccountWandBrandExperience`, and `setAccountLanguage` patches intercept HTTP responses, the `setAccountReducer` patch adds a guard clause to the Redux-style reducer that processes `ACTION_SET_ACCOUNT`. This ensures that any direct state updates to the account store—bypassing the patched API methods—still preserve the `subscription` field, providing defense-in-depth for the Pro status spoofing.