Skip to content
This repository was archived by the owner on Sep 3, 2021. It is now read-only.
This repository was archived by the owner on Sep 3, 2021. It is now read-only.

Can't select apk to bind with #272

Open

Description

@tremon36

I believe this is a problem with electron version. However, I don't know which version I should use
When I click "browse apk", file manager opens, I select the apk file and click on confirm, but it's not selected after that, and build says "Browse the apk which you want to bind".
Maybe it has something to do with this warning? "Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead."
Also, if I install the latest stable version of electron, interface in general doesn't work.

Activity

  1. Morsmalleo commented on Mar 23, 2021

    @Morsmalleo

    I solved this problem by installing openjdk-8-jdk

  2. vUdav commented on Mar 23, 2021

    @vUdav

    I solved this problem. On file AhMyth-Server/app/app/assets/js/controllers/AppCtrl.js change $appCtrl.BrowseApk method to promise:

        $appCtrl.BrowseApk = () => {
            dialog.showOpenDialog({}, {
                properties: ['openFile']
            }).then(result => {
                if(result.canceled) {
                    $appCtrl.Log("No file selected");
                } else {
                    $appCtrl.Log("File choosen  " + result.filePaths[0]);
                    readFile(result.filePaths[0]);
                }
            }).catch(() => {
                $appCtrl.Log("No file selected");
            })
    
            function readFile(filepath) {
                $appCtrl.filePath = filepath;
                $appCtrl.$apply();
            }
        }
    
  3. Morsmalleo commented on Mar 24, 2021

    @Morsmalleo

    I solved this problem. On file AhMyth-Server/app/app/assets/js/controllers/AppCtrl.js change $appCtrl.BrowseApk method to promise:

        $appCtrl.BrowseApk = () => {
            dialog.showOpenDialog({}, {
                properties: ['openFile']
            }).then(result => {
                if(result.canceled) {
                    $appCtrl.Log("No file selected");
                } else {
                    $appCtrl.Log("File choosen  " + result.filePaths[0]);
                    readFile(result.filePaths[0]);
                }
            }).catch(() => {
                $appCtrl.Log("No file selected");
            })
    
            function readFile(filepath) {
                $appCtrl.filePath = filepath;
                $appCtrl.$apply();
            }
        }
    

    Your a life saver, i forgot it was openjdk-8-jdk that solves the signing failed error when binding with APK's.

    This browsing for the APK problem however, used to be solved by running npm install electron-nightly, but doing that now causes the user interface to not work all together.

    changing what was in the AppCtrl.js file to what you have posted here has fixed the browsing problem. AhMyth now selects APK files to bind with.

    The Signing failed error that follows afterwards is solved by installing openjdk-8-jdk from Debian Stretch for Kali users, Parrot users they can still install it from the Parrot mirror software repos

  4. tremon36 commented on Mar 24, 2021

    @tremon36
    Author

    I solved this problem. On file AhMyth-Server/app/app/assets/js/controllers/AppCtrl.js change $appCtrl.BrowseApk method to promise:

        $appCtrl.BrowseApk = () => {
            dialog.showOpenDialog({}, {
                properties: ['openFile']
            }).then(result => {
                if(result.canceled) {
                    $appCtrl.Log("No file selected");
                } else {
                    $appCtrl.Log("File choosen  " + result.filePaths[0]);
                    readFile(result.filePaths[0]);
                }
            }).catch(() => {
                $appCtrl.Log("No file selected");
            })
    
            function readFile(filepath) {
                $appCtrl.filePath = filepath;
                $appCtrl.$apply();
            }
        }
    

    Man thank you very much. I was myself going crazy searching for THAT method haha. Couldn't find it so I gave up. May I ask how did you find it?

  5. vUdav commented on Mar 24, 2021

    @vUdav

    Man thank you very much. I was myself going crazy searching for THAT method haha. Couldn't find it so I gave up. May I ask how did you find it?

    Just read official documentation) https://www.electronjs.org/docs/api/dialog#dialogshowopendialogbrowserwindow-options

  6. depthab commented on Mar 27, 2021

    @depthab

    I solved this problem. On file AhMyth-Server/app/app/assets/js/controllers/AppCtrl.js change $appCtrl.BrowseApk method to promise:

        $appCtrl.BrowseApk = () => {
            dialog.showOpenDialog({}, {
                properties: ['openFile']
            }).then(result => {
                if(result.canceled) {
                    $appCtrl.Log("No file selected");
                } else {
                    $appCtrl.Log("File choosen  " + result.filePaths[0]);
                    readFile(result.filePaths[0]);
                }
            }).catch(() => {
                $appCtrl.Log("No file selected");
            })
    
            function readFile(filepath) {
                $appCtrl.filePath = filepath;
                $appCtrl.$apply();
            }
        }
    

    after doing this port forwarding doesn't work but the binding works tho. any fix for that?

  7. kernelhun commented on Apr 9, 2021

    @kernelhun

    @Morsmalleo I updated AppCtrl.js, I installed java 8, but at the same time,when I build an apk file,I show: Building failed.
    if you do not merge two apk files,but simply build an apk without merging with another apk, then everything works perfectly!
    but without merging apk files, it makes little sense.I've already tried everything, and it doesn't work.

  8. kernelhun commented on Apr 9, 2021

    @kernelhun

    @Morsmalleo do you have the apk file merge working?

  9. Morsmalleo commented on Apr 13, 2021

    @Morsmalleo

    Yes I do, you have to understand that this wont bind with modern APK files, it will only work on older APK files as well as older Android versions, I do believe anything from Android 6.0 and up will have issues with AhMyth,

  10. Morsmalleo commented on Apr 14, 2021

    @Morsmalleo

    @Morsmalleo do you have the apk file merge working?

    if you git clone AhMyth from my GitHub, and install it the same way you would with this one, then you should find that problem you are experiencing is fixed, if it hasn't create an issue and ill have a look at the code some more.

    or you can run the Setup.sh file that installs AhMyth and the required version of openjdk for AhMyth to work properly, after that you can just run npm start

    NOTE: If you keep your software repo's in /etc/apt/sources.list.d/ then it would be a good idea to move your software repo's to /etc/apt/sources.list instead if you are planning on running the Setup.sh file to install AhMyth completely

    either way it should work now, it has every time Ive tested it from my GitHub via git clone and running the Setup.sh I made for it

  11. Morsmalleo commented on Apr 16, 2021

    @Morsmalleo

    @Morsmalleo do you have the apk file merge working?

    Another thing try running update-alternatives --config java to switch your Java version to 8

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions