Giter VIP home page Giter VIP logo

Comments (7)

FrenchYeti avatar FrenchYeti commented on May 18, 2024

I started to develop Dexcalibur as NPM library. So, you can perform everything from a script or node terminal.

I assume you have already configured your config.jsfile, and it is located at <CONFIG_PATH>.
(Depending of application size, i recommand to increase nodejs heap size)

$ cd dexcalibur
$ node --max-old-space-size=4096
> const Dexcalibur = require('./src/Project');
> var Project = new Dexcalibur( 'com.myapp', <CONFIG_PATH>);
..
> Project.pull();
..
> Project.fullscan();
..

At this step, web server is not started. You can explore application and generate hook. (i will give you more information asap doc)

Search can be performed by invoking Project.find.*. For example, if you want hook a method from TelephonyManager class:

1/ First: to list all methods enclosed into a class where FQCN match the regexp .TelephonyManager.

> Project.find.method("enclosingClass.name:TelephonyManager").show()
Running deep search ...
+---------------------------------------------------------------------------------------------------------------------------+
| Index  |  Class                                  |  Modifiers                       |  Method                              |
+---------------------------------------------------------------------------------------------------------------------------+
| 0      | android.telephony.TelephonyManager      | [static,public,constructor]      | <clinit>                             | 
| 1      | android.telephony.TelephonyManager      | [public,constructor]             | <init>                               | 
| 2      | android.telephony.TelephonyManager      | [public]                         | getAllCellInfo                       | 
| 3      | android.telephony.TelephonyManager      | [public]                         | getCallState                         | 
| 4      | android.telephony.TelephonyManager      | [public]                         | getCellLocation                      | 
| 5      | android.telephony.TelephonyManager      | [public]                         | getDataActivity                      | 
| 6      | android.telephony.TelephonyManager      | [public]                         | getDataState                         | 
| 7      | android.telephony.TelephonyManager      | [public]                         | getDeviceId                          | 
| 8      | android.telephony.TelephonyManager      | [public]                         | getDeviceSoftwareVersion             | 
| 9      | android.telephony.TelephonyManager      | [public]                         | getGroupIdLevel1                     | 
| 10     | android.telephony.TelephonyManager      | [public]                         | getLine1Number                       | 
| 11     | android.telephony.TelephonyManager      | [public]                         | getMmsUAProfUrl                      | 
| 12     | android.telephony.TelephonyManager      | [public]                         | getMmsUserAgent                      | 
| 13     | android.telephony.TelephonyManager      | [public]                         | getNeighboringCellInfo               | 
| 14     | android.telephony.TelephonyManager      | [public]                         | getNetworkCountryIso                 | 
| 15     | android.telephony.TelephonyManager      | [public]                         | getNetworkOperator                   | 
| 16     | android.telephony.TelephonyManager      | [public]                         | getNetworkOperatorName               | 
| 17     | android.telephony.TelephonyManager      | [public]                         | getNetworkType                       | 
| 18     | android.telephony.TelephonyManager      | [public]                         | getPhoneType                         | 
| 19     | android.telephony.TelephonyManager      | [public]                         | getSimCountryIso                     | 
| 20     | android.telephony.TelephonyManager      | [public]                         | getSimOperator                       | 
| 21     | android.telephony.TelephonyManager      | [public]                         | getSimOperatorName                   | 
| 22     | android.telephony.TelephonyManager      | [public]                         | getSimSerialNumber                   | 
| 23     | android.telephony.TelephonyManager      | [public]                         | getSimState                          | 
| 24     | android.telephony.TelephonyManager      | [public]                         | getSubscriberId                      | 
| 25     | android.telephony.TelephonyManager      | [public]                         | getVoiceMailAlphaTag                 | 
| 26     | android.telephony.TelephonyManager      | [public]                         | getVoiceMailNumber                   | 
| 27     | android.telephony.TelephonyManager      | [public]                         | hasCarrierPrivileges                 | 
| 28     | android.telephony.TelephonyManager      | [public]                         | hasIccCard                           | 
| 29     | android.telephony.TelephonyManager      | [public]                         | iccCloseLogicalChannel               | 
| 30     | android.telephony.TelephonyManager      | [public]                         | iccExchangeSimIO                     | 
| 31     | android.telephony.TelephonyManager      | [public]                         | iccOpenLogicalChannel                | 
| 32     | android.telephony.TelephonyManager      | [public]                         | iccTransmitApduBasicChannel          | 
| 33     | android.telephony.TelephonyManager      | [public]                         | iccTransmitApduLogicalChannel        | 
| 34     | android.telephony.TelephonyManager      | [public]                         | isNetworkRoaming                     | 
| 35     | android.telephony.TelephonyManager      | [public]                         | isSmsCapable                         | 
| 36     | android.telephony.TelephonyManager      | [public]                         | isVoiceCapable                       | 
| 37     | android.telephony.TelephonyManager      | [public]                         | listen                               | 
| 38     | android.telephony.TelephonyManager      | [public]                         | sendEnvelopeWithStatus               | 
| 39     | android.telephony.TelephonyManager      | [public]                         | setLine1NumberForDisplay             | 
| 40     | android.telephony.TelephonyManager      | [public]                         | setOperatorBrandOverride             | 
| 41     | android.telephony.TelephonyManager      | [public]                         | setPreferredNetworkTypeToGlobal      | 
| 42     | android.telephony.TelephonyManager      | [public]                         | setVoiceMailNumber                   | 
+---------------------------------------------------------------------------------------------------------------------------+

Next you can select an entry by its ID (1st column from left side), and generate a hook. If you would like hook getDeviceID (entry 7), then you can execute:

> var  meth = Project.find.method("enclosingClass.name:TelephonyManager").get(7)
> var  hook = Project.hook.probe(meth);

At this point a new hook has been created. Now you can spawn/attach to appp and start "hooking".

> Project.hook.startBySpawn( null, "com.myapp")

from dexcalibur.

FrenchYeti avatar FrenchYeti commented on May 18, 2024

Actually, the better solution is perhaps to create your own Inspector if you want give the control on what happens into Dexcalibur when a hook message is receipt by the HookManager

from dexcalibur.

monperrus avatar monperrus commented on May 18, 2024

from dexcalibur.

monperrus avatar monperrus commented on May 18, 2024

Thanks a lot for the information. Thanks to this, I confirm I can:

  1. use Dexcalibur as a library, with a Node shell
  2. Find methods
  3. Create hooks.

FYI I ported this info into https://github.com/FrenchYeti/dexcalibur-doc/blob/master/CLI-User-guide.md#dexcalibur-as-a-library

from dexcalibur.

monperrus avatar monperrus commented on May 18, 2024

Hi @FrenchYeti

var Dexcalibur = require("./src/project.js") does not work anymore. What's the new command to use dexcalibur as a library? Thanks!

from dexcalibur.

FrenchYeti avatar FrenchYeti commented on May 18, 2024

Hey @monperrus ,

sorry for this late reply.

Please accept my apologies: latest refactoring (>=0.7) breaks this feature.

However, I fully rewrote Dexcalibur engine and UI and plan to release it this winter. So, Dexcalibur API will be available again, and documented.

from dexcalibur.

monperrus avatar monperrus commented on May 18, 2024

from dexcalibur.

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.