Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot open project UnhandledPromiseRejectionWarning #43

Open
cryptax opened this issue Feb 22, 2021 · 13 comments
Open

Cannot open project UnhandledPromiseRejectionWarning #43

cryptax opened this issue Feb 22, 2021 · 13 comments
Assignees
Labels
bug Something isn't working

Comments

@cryptax
Copy link
Contributor

cryptax commented Feb 22, 2021

I am trying to open a project, it fails and shows errors in console.

[INFO] [APK HELPER] APK extracted into : /root/dexcaliburWS/alien_0/apk
TypeError: Cannot read property 'getUID' of undefined
    at DexcaliburProject.fullscan (/usr/lib/node_modules/dexcalibur/src/DexcaliburProject.js:712:56)
    at /usr/lib/node_modules/dexcalibur/src/WebServer.js:438:49
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:695) UnhandledPromiseRejectionWarning: Error: [PROJECT] synchronizePlatform : unkow platform. Aborted
    at DexcaliburProject.synchronizePlatform (/usr/lib/node_modules/dexcalibur/src/DexcaliburProject.js:429:19)
    at /usr/lib/node_modules/dexcalibur/src/WebServer.js:434:43
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:695) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 4)
[INFO] [ADB] Enumerating connected devices ...
Execute command request : /root/dexcaliburWS/.dxc/bin/platform-tools/adb devices -l

This is running inside a Docker container which contains Android SDK + Android Emulators + NodeJS + Frida + Dexcalibur, (why? because I am trying to build such a container for people with Windows, for which Dexcalibur doesn't seem to install ok).

  • Docker container
  • Ubuntu 20.04.1 LTS
  • Dexcalibur 0.7.5
  • Frida 14.2.13
  • NodeJS 12.20.2
  • Android emulator 11 x86_64 with google apis
@cryptax cryptax added the bug Something isn't working label Feb 22, 2021
@FrenchYeti
Copy link
Owner

hi,

It is same issue than #42

I cannot reproduce the issue but i fixed a potential platform issue with 5942fa0.

Please retry with v0.7.6 (now available on NPM).

@duckness
Copy link

duckness commented Feb 22, 2021

currently facing the same problem. I'm running Android 11/API 30 but don't notice it here

chrome_XbLn6F8GMk

is it related?

Tried with both 0.7.5 and 0.7.6

@FrenchYeti
Copy link
Owner

@duckness Can you check the content of folders inside "<DEXCALIBUR_WORKSPACE>/.dxc/api/sdk_androidapi_29_google" ? Since you run Dexcalibur on Windows, this error can have a different root cause.

Is the stack trace is similar ? => Error in synchronizePlatform()

@duckness
Copy link

duckness commented Feb 23, 2021

.dxc/api/sdk_androidapi_29_google
❯ dir

    Directory: C:\Users\duckness\dexcaliburWS\.dxc\api\sdk_androidapi_29_google

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
d----           22/2/2021 10:35 pm                android
d----           22/2/2021 10:35 pm                androidx
d----           22/2/2021 10:35 pm                dalvik
d----           22/2/2021 10:35 pm                java
d----           22/2/2021 10:35 pm                javax
d----           22/2/2021 10:35 pm                org

after looking at the stacktrace a bit closer, I realised that the very first run (on 0.7.5) gave me that exact error:

TypeError: Cannot read property 'getUID' of undefined
    at DexcaliburProject.fullscan (C:\Users\duckness\Downloads\dexcalibur-master\dexcalibur-master\src\DexcaliburProject.js:712:56)
    at C:\Users\duckness\Downloads\dexcalibur-master\dexcalibur-master\src\WebServer.js:438:49
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
(node:25988) UnhandledPromiseRejectionWarning: Error: [PROJECT] synchronizePlatform : unkow platform. Aborted
    at DexcaliburProject.synchronizePlatform (C:\Users\duckness\Downloads\dexcalibur-master\dexcalibur-master\src\DexcaliburProject.js:429:19)
    at C:\Users\duckness\Downloads\dexcalibur-master\dexcalibur-master\src\WebServer.js:434:43
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)

subsequent runs on 0.7.5 and 0.7.6 gave me a slightly different error, instead of undefined, it is null. I have been unable to reproduce the undefined:

TypeError: Cannot read property 'getUID' of null
    at DexcaliburProject.fullscan (C:\Users\duckness\Downloads\dexcalibur-master\dexcalibur-master\src\DexcaliburProject.js:714:56)
    at C:\Users\duckness\Downloads\dexcalibur-master\dexcalibur-master\src\WebServer.js:438:49
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
(node:19708) UnhandledPromiseRejectionWarning: Error: [PROJECT] synchronizePlatform : unkow platform. Aborted
    at DexcaliburProject.synchronizePlatform (C:\Users\duckness\Downloads\dexcalibur-master\dexcalibur-master\src\DexcaliburProject.js:431:19)
    at C:\Users\duckness\Downloads\dexcalibur-master\dexcalibur-master\src\WebServer.js:434:43
    at processTicksAndRejections (internal/process/task_queues.js:93:5)

@FrenchYeti
Copy link
Owner

FrenchYeti commented Feb 23, 2021

Very good information :)

As i cannot reproduce the error, can you patch your code with the commit dbba59a ?

Can you say me if an error occurs and if there are more error messages into terminal ?

Thanks !

EDIT: Only src/PlatformManager.js and src/WebServer.jsshould be patched.

@duckness
Copy link

[ERROR] Platform Manager : undefined is not a valid platform

I get this and nothing else

@FrenchYeti
Copy link
Owner

@cryptax can you check if v0.7.8 solves your issue ?

@FrenchYeti
Copy link
Owner

I close this issue. Feel free to update this issue, if problem persists.

@cryptax
Copy link
Contributor Author

cryptax commented Mar 8, 2021

Just tried. The problem persists with 0.7.8.

[INFO] [APK HELPER] APK extracted into : /root/dexcaliburWS/Alien/apk
TypeError: Cannot read property 'getUID' of null
    at DexcaliburProject.fullscan (/usr/lib/node_modules/dexcalibur/src/DexcaliburProject.js:710:56)
    at /usr/lib/node_modules/dexcalibur/src/WebServer.js:445:49
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:64) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'getMinApiVersion' of null
    at DexcaliburProject.synchronizePlatform (/usr/lib/node_modules/dexcalibur/src/DexcaliburProject.js:411:78)
    at /usr/lib/node_modules/dexcalibur/src/WebServer.js:441:43
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:64) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:64) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Would you like me to join my Dockerfile to help you reproduce?

@cryptax
Copy link
Contributor Author

cryptax commented Mar 12, 2021

By the way, I am getting the same error, even without using a Dockerfile, i.e straight on the host.
Version 0.7.8.
Can you re-open the bug?

TypeError: Cannot read property 'getUID' of null
    at DexcaliburProject.fullscan (/home/axelle/.nvm/versions/node/v12.20.0/lib/node_modules/dexcalibur/src/DexcaliburProject.js:710:56)
    at /home/axelle/.nvm/versions/node/v12.20.0/lib/node_modules/dexcalibur/src/WebServer.js:445:49
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:276651) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'getMinApiVersion' of null
    at DexcaliburProject.synchronizePlatform (/home/axelle/.nvm/versions/node/v12.20.0/lib/node_modules/dexcalibur/src/DexcaliburProject.js:411:78)
    at /home/axelle/.nvm/versions/node/v12.20.0/lib/node_modules/dexcalibur/src/WebServer.js:441:43
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:276651) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:276651) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

@FrenchYeti FrenchYeti reopened this Mar 12, 2021
@FrenchYeti
Copy link
Owner

Did you select a device for the project ?
Is this devices is successfully enrolled ?
Is it an emulator or a physical device ?

@cryptax
Copy link
Contributor Author

cryptax commented Mar 12, 2021

  • yes the device is enrolled
  • it is an emulator. Actually an ARM7 emulator. But I don't think it is related to ARM or x86.

dexcalibur

@cryptax
Copy link
Contributor Author

cryptax commented Mar 12, 2021

With more tests, note this error only happens at the creation of the project. Actually, the project gets created, so, if after that you choose to open an existing project, it works, and you manage to open and analyze the APK.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants