Files
GDevelop-Unlocked/patches/01-usage-predicate.patch
T
BillyOutlast 30da3f8b4e Surgical conversion: Tier-1 patcher + launcher hook, Tier-2 extraction (Phases 1-5)
Replaces the 205-file fork delivery vehicle with patches/ + launcher/
+ versioned packages, per the implementation plan:

Phase 1: seam tripwires (27 tests) freezing every surgical target in
upstream (Usage predicate, %16 gate, SubscriptionChecker, debugger,
LoadingScreen branding, Electron hook surface, no-plugin-registry
verdict).

Phase 2: 5 generated Tier-1 hunks (round-trip verified; 3 files reach
byte-identical fork parity) + apply driver (dry-run gate, marker
verify, asar extract/repack).

Phase 3: launcher hook (preload fetch/XHR spoof of the two usage GETs,
BrowserWindow wrap, webRequest fallback, updater pin) + 06 loader
patch. Module._load interception dropped: renderers run a webpack
bundle, so the spoof rides the axios/XHR path the provider hydrates
from instead.

Phase 4: Tier-2 verbatim extraction (CustomAIClient + 12 Studio
modules + offline mock harness, manifest-pinned) + 07/08 verbatim
glue patches + pure generation shim with fail-closed leak guard.

Phase 5: web userscript demo (Tier-1 only, documented CORS/LAN/churn
limits). Phase 6 runbook + upstream provider-interface RFC draft
included; fork archiving left to owners (destructive).

Suite: 66 tests green (seams, patcher incl. re-apply refusal,
launcher incl. vm-sandbox fallback eval, tier-2 provenance, web).
2026-10-10 20:41:35 -04:00

75 lines
2.0 KiB
Diff

--- a/newIDE/app/src/Utils/GDevelopServices/Usage.js
+++ b/newIDE/app/src/Utils/GDevelopServices/Usage.js
@@ -602,21 +602,59 @@
return !!subscription && subscription.pricingSystemId === 'TEAM_MEMBER';
};
+export const UNLOCKED_HERETEK_SUBSCRIPTION: Subscription = {
+ userId: 'local-byok-user',
+ planId: 'gdevelop_startup',
+ pricingSystemId: 'HERETEK_UNLOCKED',
+ createdAt: 0,
+ updatedAt: 0,
+};
+
+export const UNLOCKED_HERETEK_CAPABILITIES: Capabilities = {
+ analytics: {
+ sessions: true,
+ players: true,
+ retention: true,
+ sessionsTimeStats: true,
+ platforms: true,
+ },
+ cloudProjects: {
+ maximumCount: 999,
+ canMaximumCountBeIncreased: true,
+ maximumGuestCollaboratorsPerProject: 99,
+ projectRestorationTimeWindowInSeconds: -1,
+ deletedProjectRetentionInDays: 365,
+ },
+ leaderboards: {
+ maximumCountPerGame: 999,
+ canMaximumCountPerGameBeIncreased: true,
+ themeCustomizationCapabilities: 'FULL',
+ canUseCustomCss: true,
+ canDisableLoginInLeaderboard: true,
+ },
+ multiplayer: {
+ lobbiesCount: 99,
+ maxPlayersPerLobby: 64,
+ themeCustomizationCapabilities: 'FULL',
+ },
+ versionHistory: {
+ enabled: true,
+ retentionDays: 365,
+ },
+ ai: {
+ availablePresets: [],
+ versionHistory: {
+ enabled: true,
+ retentionDays: 365,
+ },
+ },
+};
+
export const hasValidSubscriptionPlan = (
subscription: ?Subscription
): boolean => {
- const hasValidSubscription =
- !!subscription &&
- !!subscription.planId &&
- (!subscription.redemptionCodeValidUntil || // No redemption code
- subscription.redemptionCodeValidUntil > Date.now()); // Redemption code is still valid
-
- if (hasValidSubscription) {
- // The user has a subscription registered in the backend (classic "Registered" user).
- return true;
- }
-
- return false;
+ // In GDevelop-Heretek, all client-side and offline features are unlocked for all users.
+ return true;
};
type UploadType = 'build' | 'preview';