Giter Club home page Giter Club logo

Comments (15)

jenny-chen avatar jenny-chen commented on September 28, 2024 2

I tried the new 3.0.0 release and it seems to work! Cheers, thanks for helping :D

from blitz-app-adblock.

lulzsun avatar lulzsun commented on September 28, 2024 1

No problem, and thank you for helping me debug all this to work on macOS. Cheers!

from blitz-app-adblock.

lulzsun avatar lulzsun commented on September 28, 2024

It is very possible, the patcher can be ported over to .NET Core for cross platform compatibility.

However I currently do not have a MacOS computer so I wouldn't be able to get that done any time soon. Maybe someone else could give it a try.

from blitz-app-adblock.

lulzsun avatar lulzsun commented on September 28, 2024

I am actually in the process of rewriting the patcher in Node.js which will make it cross-platform.

If you could provide the full file location of app.asar, I could probably get it to work on MacOS.

from blitz-app-adblock.

jenny-chen avatar jenny-chen commented on September 28, 2024

Full path on Mac appears to be: /Applications/Blitz.app/Contents/Resources/app.asar

from blitz-app-adblock.

lulzsun avatar lulzsun commented on September 28, 2024

I have just released the Node.js patcher, allowing it to theoretically work on MacOS.

You can also compile and debug it for yourself using npm and Node.

Let me know if it works out.

from blitz-app-adblock.

jenny-chen avatar jenny-chen commented on September 28, 2024

It doesn't seem like it's working. I'm running into errors both running the macOS patcher and also trying to compile it myself. I'm not too familiar with these packages, is something wrong on my end?

Running .out file
image

Compiling myself
image

from blitz-app-adblock.

lulzsun avatar lulzsun commented on September 28, 2024

Have you tried npm run start and see if that does anything? If that works then must be something related to the pkg module.

from blitz-app-adblock.

jenny-chen avatar jenny-chen commented on September 28, 2024

npm run start returns an error as well

image

from blitz-app-adblock.

lulzsun avatar lulzsun commented on September 28, 2024

I think line 11 of blitz-app-adblock.js is creating the error.

I believe in the first argument of path.join(), process.env.APPDATA is undefined on macOS. Try initializing appPath to be an empty string instead and see if that does it.

from blitz-app-adblock.

jenny-chen avatar jenny-chen commented on September 28, 2024

That fixed part of the issue. Another issue was that unix systems use forward slashes in file paths while windows uses backslashes so it wasn't finding the right file. Changing it to the code below helped it find app.asar but now I get:
image

        // mac os app path
        if (process.platform === "darwin") {
            appPath = '/Applications/Blitz.app/Contents/Resources';
        }

        if(!fs.existsSync(`${appPath}/app.asar`)) {
            console.log("app.asar not found!");
        }
        else {
            console.log('Extracting app.asar...');
            await asar.extractAll(`${appPath}/app.asar`, `${appPath}/app/`);

from blitz-app-adblock.

jenny-chen avatar jenny-chen commented on September 28, 2024

Also I'll note that this slash issue also applies to the npm run build issue. Changing .\build\ to ./build/ causes this instead:
image

from blitz-app-adblock.

lulzsun avatar lulzsun commented on September 28, 2024

What node version are you using? It might only be working on my old node 10.16.3. I'll try updating in a bit and seeing if the same problem occurs.

from blitz-app-adblock.

lulzsun avatar lulzsun commented on September 28, 2024

It appears that node 15 is not supported by pkg. I think I'll update to node 14.15.4 (latest LTS version) and see if that works.

from blitz-app-adblock.

lulzsun avatar lulzsun commented on September 28, 2024

Try pulling the latest changes and use node 14.15.4 to compile. I also re-uploaded the 3.0.0 release with all the changes if you want to test that first.

from blitz-app-adblock.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.