Skip to content

Instantly share code, notes, and snippets.

@GameTec-live
Last active April 24, 2024 16:27
Show Gist options
  • Save GameTec-live/0d5fe22a97cf989010aa9957a31b3348 to your computer and use it in GitHub Desktop.
Save GameTec-live/0d5fe22a97cf989010aa9957a31b3348 to your computer and use it in GitHub Desktop.
A git patch to remove ads and startup animation from gdlauncher. it uses the ability to compile the app.asar file without loosing functionality (no api key needed) to generate a new one with the react components for showing ads stripped out
diff --git a/apps/desktop/packages/main/adSize.ts b/apps/desktop/packages/main/adSize.ts
index 8ab38784..bdf2777a 100644
--- a/apps/desktop/packages/main/adSize.ts
+++ b/apps/desktop/packages/main/adSize.ts
@@ -17,8 +17,8 @@ export default function getAdSize(display?: Display) {
adSize: {
useFallbackAd,
useVertical: true,
- width: 160,
- height: 600
+ width: 0,
+ height: 0
}
};
} else {
@@ -30,9 +30,9 @@ export default function getAdSize(display?: Display) {
adSize: {
useFallbackAd,
useVertical: false,
- width: 400,
- height: 600
+ width: 0,
+ height: 0
}
};
}
-}
+}
\ No newline at end of file
diff --git a/apps/desktop/packages/mainWindow/src/components/AdBanner.tsx b/apps/desktop/packages/mainWindow/src/components/AdBanner.tsx
index 657870ca..5231cbd0 100644
--- a/apps/desktop/packages/mainWindow/src/components/AdBanner.tsx
+++ b/apps/desktop/packages/mainWindow/src/components/AdBanner.tsx
@@ -2,13 +2,7 @@ import adSize from "@/utils/adhelper";
export const AdsBanner = () => {
return (
- <div
- style={{
- height: `${adSize.height}px`,
- width: `${adSize.width}px`
- }}
- >
- <owadview class="relative z-100" />
+ <div>
</div>
);
};
diff --git a/apps/desktop/packages/mainWindow/src/global.d.ts b/apps/desktop/packages/mainWindow/src/global.d.ts
index 8a25b565..17f1b75e 100644
--- a/apps/desktop/packages/mainWindow/src/global.d.ts
+++ b/apps/desktop/packages/mainWindow/src/global.d.ts
@@ -56,9 +56,9 @@ declare global {
declare module "solid-js" {
namespace JSX {
- interface IntrinsicElements {
+ /*interface IntrinsicElements {
owadview: any;
- }
+ }*/
}
}
diff --git a/apps/desktop/packages/mainWindow/src/pages/withAds.tsx b/apps/desktop/packages/mainWindow/src/pages/withAds.tsx
index 50c6462a..c19b7699 100644
--- a/apps/desktop/packages/mainWindow/src/pages/withAds.tsx
+++ b/apps/desktop/packages/mainWindow/src/pages/withAds.tsx
@@ -69,35 +69,7 @@ function withAdsLayout() {
<Outlet />
</div>
<div class="flex flex-col justify-between h-[calc(100vh-100px)]">
- <div
- class="bg-darkSlate-800 py-4"
- style={{
- width: `${adSize.width}px`,
- height: `${adSize.height}px`
- }}
- >
- <Show when={adSize.shouldShow}>
- <Switch>
- <Match when={adSize.useFallbackAd}>
- <BisectBanner />
- </Match>
- <Match when={!adSize.useFallbackAd}>
- <AdsBanner />
- </Match>
- </Switch>
- </Show>
- </div>
<div class="flex justify-center">
- <div
- class="text-center hover:text-darkSlate-50 transition-colors duration-200 text-darkSlate-200"
- onClick={() => {
- modalContext?.openModal({
- name: "whyAreAdsNeeded"
- });
- }}
- >
- <Trans key="why_are_ads_needed" />
- </div>
</div>
</div>
<div class="absolute top-0 left-0 right-0 bottom-0 bg-image-gdlauncher_pattern.svg -z-10" />
@Freedbot
Copy link

Freedbot commented Apr 14, 2024

Wha..? No dude. I'm saying the program has release channels. When you download the source from the default "develop" branch, you get the latest version. If you download it when it's similar to the stable release version, then no problem. I'm guessing the version number is stored in app.asar. If the latest source... for example, happens to have a version number that ends in "-beta". Then you'll see a banner saying as much. Also, while getting pictures for this I've found another problem. This program automatically self updates on close, and it doesn't have a setting to disable this. If I don't go into settings and select the "beta" branch to match the app.asar I've built, then it gets wiped on close to put me back on "stable". So the next question is how do I disable the update check? Would finding and incrementing the version number to 9999999 and removing the "-beta" be a better solution?

image
image

@Freedbot
Copy link

The version info is "packages/config/version.json". I've edited it for myself to increase the version number and edit the "channel": "beta" line to "channel": "AdlessPatch" as an alternative way to remove the banner and possibly prevent auto-updating. It's a dumb way to do it, and might not work, but I'm too lazy and lacking confidence to properly disable the auto-update function without breaking things.

@RhapsodySL
Copy link

Hi, would you be able to provide a copy of the app.asar? I've been trying to set up a build environment for this but have been running into a similar issue as above and am unable to resolve it.

@GameTec-live
Copy link
Author

@RhapsodySL You can contact me via discord or similar if you want, but setting it up yourself is the ideal as i dont know your update freqency and youd want to avoid a version mismatch...

@RhapsodySL
Copy link

The version info is "packages/config/version.json". I've edited it for myself to increase the version number and edit the "channel": "beta" line to "channel": "AdlessPatch" as an alternative way to remove the banner and possibly prevent auto-updating. It's a dumb way to do it, and might not work, but I'm too lazy and lacking confidence to properly disable the auto-update function without breaking things.

Gave this a try and it does indeed work, but I found that every time the application opens or whenever you switch to the Library tab from another tap, it opens a popup showing the changelog for the version even if it's already displayed it before. I don't suppose anyone would know anything about how to get rid of that?

@Freedbot
Copy link

I don't have that problem, so you've got something edited differently or they did an update in the last week that messes with it. It's been working for me, but I've had other minor bugginess from using this jank home built beta.

@RhapsodySL
Copy link

I don't have that problem, so you've got something edited differently or they did an update in the last week that messes with it. It's been working for me, but I've had other minor bugginess from using this jank home built beta.

The only changes I've made are applying the patch file from the original post, and changing my version.json to this:

{
"version": "3.0.0",
"channel": "AdlessPatch"
}

Did you change anything else? What did you set the contents of your version.json to?

@GameTec-live
Copy link
Author

id not touch the versions.json but just change the updater .yml file in the resources folder...

@RhapsodySL
Copy link

id not touch the versions.json but just change the updater .yml file in the resources folder...

What file? I wasn't able to find that.

@GameTec-live
Copy link
Author

theres a .yml file next to the asar in the resources folder (of the installed launcher)... Changing that should work better...

@Freedbot
Copy link

@RhapsodySL that's not significantly different from what I did except that I set my version to 999.999.999 just to be extreme about it. It should have still worked the same. GameTec is right of course. The best answer is to edit and disable the updater altogether. I didn't post the contents directly because I knew it was a hacky trick, but it was relatively easy to find and mess with. It's worth repeating that this is the active source we're using. They're doing edits there every couple days that could cause as many bugs as they're fixing until they build and release it themselves.

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