profile
viewpoint
Eric Lange ericwlange Joonko Berlin, Germany https://github.com/LiquidPlayer CTO/CPO @ Joonko.de. Former CPO @ Delivery Hero AG; product at Google, Yahoo, Flipkart, Microsoft, et al

LiquidPlayer/LiquidCore 636

Node.js virtual machine for Android and iOS

ericwlange/AndroidJSCore 434

AndroidJSCore allows Android developers to use JavaScript natively in their apps.

ericwlange/hemroid 4

Because building Linux libraries for Android is a pain in the ass.

ericwlange/webkit 3

Unofficial mirror of the WebKit SVN repository

ericwlange/node 0

Node.js JavaScript runtime :sparkles::turtle::rocket::sparkles:

ericwlange/react-native 0

A framework for building native apps with React.

long1eu/liquid_core_and_firestore_test 0

Test project to demonstrate de imcompatibility between FirebaseFirestore and LiquidCore

release LiquidPlayer/LiquidCore

0.7.10

released time in 17 days

created tagLiquidPlayer/LiquidCore

tag0.7.10

Node.js virtual machine for Android and iOS

created time in 17 days

push eventLiquidPlayer/LiquidCore

Eric Lange

commit sha 9405979363f2353ac9a71ad8ab59685dd7f919c9

Bumped to 0.7.10

view details

push time in 17 days

issue commentLiquidPlayer/LiquidCore

Android Gradle Plugin 4.0.0, direct local .aar file dependencies are not supported when building an AAR

The AARs are hosted on github. If you look at include.gradle and include.V8.gradle, this is where the AAR download happens. If you can figure out a solution, please file a PR. Otherwise I am not quite sure when I can get to it.

kdarrimajou

comment created time in 23 days

push eventLiquidPlayer/LiquidCore

Eric Lange

commit sha 66adb743b32e3bce6725d6c38ce9108fa7c221cf

Fixed some more swift nullability warnings

view details

push time in a month

issue commentLiquidPlayer/LiquidCore

NodeRed in LiquidCore

I have encountered the callSiteToString problem before. It is because JavaScriptCore does not include all the fancy Error methods that V8 supports and some node modules depend on. I fixed this, coincidentally in 0.7.9, by improving the error polyfill for iOS. You can see if this gets you further.

alyberty

comment created time in a month

issue commentLiquidPlayer/LiquidCore

Android, liquidcore-V8 native crashes on production

These are sporadic failures, as in you can't reproduce them in your tests?

That's going to be tough to debug without more information. Do you see any other similarities with the crashes? Were the processes running for a short or long time? Does it seem to be device or arch related?

chalup

comment created time in a month

issue closedLiquidPlayer/LiquidCore

build failed on jitpack always

https://jitpack.io/com/github/LiquidPlayer/LiquidCore/0.7.8/build.log

closed time in a month

blueye

issue commentLiquidPlayer/LiquidCore

Accessing static assets

I'm afraid that assets won't be accessible through the filesystem. IIRC, android stores them in some binary (zip?) format. You can only get access to them through context.getAssets().open(), which provides a read stream. Thus they are not part of the filesystem, per se, so they won't be accessible using fs operations. This is a good feature request, though. I can see creating an API method that calls back to Android to get stream access to an Android asset.

rgerd

comment created time in a month

issue commentLiquidPlayer/LiquidCore

AppStore won't let upload the binary using LiquidCore

Thanks for the contribution! This has been merged and released in 0.7.9.

dsemenovsky

comment created time in a month

release LiquidPlayer/LiquidCore

0.7.9

released time in a month

created tagLiquidPlayer/LiquidCore

tag0.7.9

Node.js virtual machine for Android and iOS

created time in a month

push eventLiquidPlayer/LiquidCore

Eric Lange

commit sha 24e6a0d406725e28152b76e1a44a330b10057b8f

Bumped to 0.7.9

view details

push time in a month

pull request commentLiquidPlayer/LiquidCore

fix some compiling errors about xml

Hi @blueye , can you let me know which compiler is throwing errors? Is this recent? It makes me nervous to mess around with the boost code.

blueye

comment created time in a month

push eventLiquidPlayer/LiquidCore

Eric Lange

commit sha 3e3ce75a68a3f1ad73b4b1be2c98d7817df7f936

Fixed some swift compiler warnings regarding nullability Implemented some error-polyfill abstract functions

view details

push time in a month

issue commentLiquidPlayer/LiquidCore

unresolved module nanoid on MacOS 10.15/iOS 13/Node 10.20/ipfs 0.43.3/LC 0.7.8

I believe the issue is that IPFS is trying to use ursaNative and secp256k1 native modules, which are not built for LiquidCore. I've gotten this to work in the past. You need to hack whichever module is trying to load those native bindings to skip them and use the JS-only implementations.

emclab

comment created time in a month

issue commentLiquidPlayer/LiquidCore

Problems with metro bundler

Which version of LiquidCore are you using? There was definitely a problem using the metro bundler with the minifier turned on, which is the default for bundling. I turned it off by default in one of the latest releases. Can you confirm that the bundle is not minified?

Deepp0925

comment created time in a month

issue commentLiquidPlayer/LiquidCore

build failed on jitpack always

Jitpack is deprecated since 0.7.0

blueye

comment created time in a month

pull request commentLiquidPlayer/LiquidCore

Fix/app store validation

Thanks for the contribution. I have confirmed that this doesn't seem to cause any noticeable issues with openssl.

dsemenovsky

comment created time in a month

push eventLiquidPlayer/LiquidCore

Dmitry Semenovskiy

commit sha 5b8f4620e441a9ad397f4cfe2cc957c6d5edcdfb

Merge pull request #1 from LiquidPlayer/master Merge in 0.7.8

view details

Dmitry Semenovskiy

commit sha 2730ef0f8a8e8bb5de0529a150f8290bb19a6923

Add -DOPENSSL_NO_ASYNC flag

view details

Eric Lange

commit sha ea30600308b1157c3ced67dcbf676a1258fc78cb

Merge pull request #181 from vaultie/fix/app-store-validation Fix/app store validation

view details

push time in a month

issue closedLiquidPlayer/LiquidCore

AppStore won't let upload the binary using LiquidCore

ITMS-90338: Non-public API usage - The app references non-public symbols in Frameworks/LiquidCore.framework/LiquidCore: _getcontext, _makecontext, _setcontext. If method names in your source code match the private Apple APIs listed above, altering your method names will help prevent this app from being flagged in future submissions. In addition, note that one or more of the above APIs may be located in a static library that was included with your app. If so, they must be removed. For further information, visit the Technical Support Information at

closed time in a month

dsemenovsky

release LiquidPlayer/LiquidCore

0.7.8

released time in 2 months

created tagLiquidPlayer/LiquidCore

tag0.7.8

Node.js virtual machine for Android and iOS

created time in 2 months

push eventLiquidPlayer/LiquidCore

Eric Lange

commit sha 22ca2f48ca721830da5501254309fb9ce80d38bf

Lots of iOS-only Fixes Fixed areas where EscapableHandleScope was missing Fixed bug in deallocating ArrayBuffer Cleaned up some string accesses Removed promise_polyfill (deprecated) Proxy Object.getOwnDescriptor for better handling of V8 accessor properties Remove callAsFunction interceptor for created Object as it will resolve as Function instead Use Reflect where appropriate to ensure we return proper value Fixed problem with TypedArray.of and TypedArray.from

view details

Eric Lange

commit sha b6ebaea1d0c6a42bcec2f10e0df998ec910420d3

Updated error-polyfill Added small hack to error-polyfill Bumped to 0.7.8

view details

push time in 2 months

issue commentLiquidPlayer/LiquidCore

OpenPGP.js and LiquidCore in Android

Hi @ArtemisKS The issue is not yet resolved. I found the problem that was causing crypto to fail (TypedArray.for() and TypedArray.of() were not polyfilled properly). But once I fixed that, a memory error or buffer overrun of some sort is occurring causing the process to crash. It is very difficult to pin down the cause because it is not deterministic.

I am still working on it, but I can't give a timeframe at the moment because I don't know the root cause yet. Also, LiquidCore is a passion project for me, but not my day job, so I only have limited windows of time to devote to it.

boby1975

comment created time in 2 months

issue commentLiquidPlayer/LiquidCore

LiquidCore file system and Android/iOS app

Hi @boby1975 ,

The easiest way to do it is to use a method that I just added about two weeks ago -- #156

Android:

  android.content.Context context = ...;
  MicroService service = ...;

  // Expose the Android app's files directory to LiquidCore
  final String dir = context.getFilesDir().getAbsolutePath();
  service.getProcess().exposeHostDirectory(dir, Process.kMediaAccessPermissionsRW);

  // Write a file
  final String filename = "testExposeHostFS.txt";
  final String fileContents = "These are the file contents";
  try (FileOutputStream fos = context.openFileOutput(filename, Context.MODE_PRIVATE)) {
    fos.write(fileContents.getBytes());
  }

  // Tell MicroService about it
  service.emitString("filesDirPath", dir);

JavaScript:

  const fs = require('fs')

  LiquidCore.on('filesDirPath', (path) => {
     // Read the file
     let contents = String(fs.readFileSync(path + '/testExposeHostFS.txt'))
     console.log(contents)
  }
boby1975

comment created time in 3 months

issue commentLiquidPlayer/LiquidCore

OpenPGP.js and LiquidCore in Android

Hi @ArtemisKS . There are some bugs in iOS, it seems. There isn't a workaround at the moment. I fixed some of the issues on my local machine, but some crypto functionality doesn't seem to work properly yet. I will have to dig deeper.

boby1975

comment created time in 3 months

issue commentLiquidPlayer/LiquidCore

App Transport Security in DEBUG mode [iOS]

Thanks @daetal-us . Yes, you have to enable cleartext HTTP. I should make that clear in the documentation. I also just discovered that this doesn't work in Android at all because if you use the distribution (rather than build from source), it is never in debug mode since the library is distributed in release mode. Hence, the logic to hit the dev server is compiled out. I need to figure out if I can detect the build flavor of the client app, not the library itself. So I will use this issue to cover both the problems in iOS and Android.

daetal-us

comment created time in 3 months

issue commentLiquidPlayer/LiquidCore

OpenPGP.js and LiquidCore in Android

Hi @boby1975 ,

You will have to hack around it. It looks like openpgp is using its own bundled code, and then LiquidCore is bundling on top of it. I have managed to work around it by replacing offending require() statements with LiquidCore.require(). This bypasses the bundler override and uses stock node require().

Also, for whatever reason, they have chosen not to package asn1.js into openpgp.js. I am guessing they had a problem with packaging it due to some circular references or something. So it is looking for that module at runtime. I already built some intelligence into the LiquidCore bundler so that it can handle circular requires.

To get this to work, you need to add to the top of your javascript file:

const asn1 = require('asn1.js')
global.requireASN1 = () => asn1
const openpgp = require('openpgp')

It is important that you create the requireASN1() function before you require openpgp.

Then you must patch your node_modules/openpgp/dist/openpgp.js file:

8016c8016
<     var crypto = require('crypto');
---
>     var crypto = LiquidCore.require('crypto');
23792c23792
<     crypto = require('crypto');
---
>     crypto = LiquidCore.require('crypto');
23821c23821
< const NodeReadableStream = _util.isNode && require('stream').Readable;
---
> const NodeReadableStream = _util.isNode && LiquidCore.require('stream').Readable;
24139c24139
< const NodeBuffer = _util.isNode && require('buffer').Buffer;
---
> const NodeBuffer = _util.isNode && LiquidCore.require('buffer').Buffer;
24596c24596
< const NodeReadableStream = isNode && require('stream').Readable;
---
> const NodeReadableStream = isNode && LiquidCore.require('stream').Readable;
30022c30022,30023
< const asn1 = nodeCrypto ? require('asn1.js') : undefined;
---
> //const asn1 = nodeCrypto ? require('asn1.js') : undefined;
> const asn1 = nodeCrypto ? requireASN1() : undefined;
30622c30623,30624
< const asn1 = nodeCrypto ? require('asn1.js') : undefined;
---
> //const asn1 = nodeCrypto ? require('asn1.js') : undefined;
> const asn1 = nodeCrypto ? requireASN1() : undefined;
31185c31187
< const nodeCrypto = _util2.default.detectNode() && require('crypto');
---
> const nodeCrypto = _util2.default.detectNode() && LiquidCore.require('crypto');
43138c43140
<     return require(module);
---
>     return LiquidCore.require(module);

I was able to get it to generate a key with the following code:

const asn1 = require('asn1.js')
global.requireASN1 = () => asn1
const openpgp = require('openpgp')

var options = {
  userIds: [{ name: 'Alice', email: 'alice@example.com' }],
  numBits: 2048,
  passphrase: 'secret'
}
var pubKey, privKey
openpgp.generateKey(options).then(key => {
  privKey = key.privateKeyArmored
  pubKey = key.publicKeyArmored
  console.log('Key generated')
  console.log('Public key = ' + pubKey)
})
2020-04-17 12:03:22.833 9200-9252/org.liquidplayer.testapp I/stdout: Key generated
2020-04-17 12:03:22.833 9200-9252/org.liquidplayer.testapp I/stdout: Public key = -----BEGIN PGP PUBLIC KEY BLOCK-----
    Version: OpenPGP.js v4.10.2
    Comment: https://openpgpjs.org
    
    xsBNBF6ZfukBCAC96Fk1Z+dD0CMOAzL0OSewNovtQVDmpb+9SHEjB4LdhH5o
    obreI2Ua7+MrJkg6K06C7ED21qKI1+HDXtiTUALj1ZsCKxcuy3lx8ZjJNo+d
    4WrcFarPBL3KOe8aSjYKqMzrlM4MzXWbfb5W7gUxGExILuuU8a9GkeshtgFE
    8l6/rZwdiAm7FcWAwZC1geZdIw/xu7tNKZ1PAtzFPHxioxHpsMoXS/4d8w/L
    BjJDqfWWEERLZ+EK12vwX3Ftxh6OWsfC5Oeb9B/JSKC8YoDpV3zG1DDUiXF6
    yx7Zp/Pk7feKLZI1tPnh/EyHFehNylHcltF8ErgEfsVl83vzMH3VQU8DABEB
    AAHNGUFsaWNlIDxhbGljZUBleGFtcGxlLmNvbT7CwHYEEAEIACAFAl6ZfukG
    CwkHCAMCBBUICgIEFgIBAAIZAQIbAwIeAQAKCRCxwSPraGOBAN87B/9kFRf1
    ZA65mwAWCwnGuoFX425pcP08b9Kquykx9KKYpt2I5/NbCIBdGFbYA0VPJMV/
    /h6Lwr2wqEc3MR4uoKm8EQReMEp2MdrxJunwVC+2j7OTngxz6EKBpgxSkYos
    KlFH+VmTtKtoY8sQ8NhgUpumRhC1c2Gg8Kp00A+zXmgwA1GN3+4pEB0uiQtT
    Cjls3TJT1xTRMhR2GWM96y+zSmiAMofQOOBnPlnIq9Bxl96ylaOo13h/Q75i
    BAplNVOX8j59eET/o4G8cG2uG715SV/RJ7MRJxCEgijnIZXmAr5FPtKQ+OUV
    QqOAPIIJE4bn3zkBiLVcpG61Fk7GfeWk+5YXzsBNBF6ZfukBCADclvmuQUa2
    F4A8qromgtN9ayyn4SKX588YSF6F/ZGFqK6f5Q2fb01k8hgwpOoW64YjfOQj
    nO5Ub3tnxes5dIwOOKXktT1bbf9DOLISH9Wip1rER3cVdSTuYxN98oJBiZpd
    xqAAWo8vU7REAw7wN0bRpSpZRlYT1GK7nYBid07oS5rEHxAFzfQN97Ih2gEW
    kaH2LHuXD/5zhoi3J2ulNoZ0AvjznFCtWV7idiBFdXMyEyRMHXNUTbd81SmF
    IRkD28iUxMzzt37o3cmqnN6/cq8+SM0crxhibRhFwYRuLzZeMBJLZ9+0aQO3
    1Ylrop01yQ0zj4hYoCExg86qcKgtzINLABEBAAHCwF8EGAEIAAkFAl6ZfukC
    GwwACgkQscEj62hjgQBPhQf/TW5kvv5JI/8kpuRs7lvWeHED/qVcwCDeTGF4
    96fH8zXsi1/cz/c9ntXSeBD6oB91d53GfQLCwQSx9eDLo/UG6T4IWfDQvMB3
    l8q4Hgc6ynQsm3qMANZdMSvQ3hS16bR70vCkYCPSyuG1rZ1o8XUp3R1Be5l0
    1IZHJBMkFbpTyNwHtBvq5WIDAVi+Cm8Mv1JmX4STbS5tRs3yNpK/ASIEmm6W
    tGJMOhjLxAGhwyMHBIKLhjEHEiaSHYlEDiXDwaZ4GWg/5qKBjSW0X/aDlpNf
    C6/0thIGSt6P4WnN6LXxBg5NL1PWNdK9IVa9B8pDbL/dpMZcJXCFuMCsKZEC
    gIn9Mg==
    =X7se
    -----END PGP PUBLIC KEY BLOCK-----

It is possible that I missed other require statements that need to be hacked, but you will discover that through testing. Finally, if you want your new openpgp.js file to work in regular (non-LiquidCore) node, you will have to add some logic to detect the presence of global.LiquidCore before using it. But I leave that up to you.

Hope this helps.

boby1975

comment created time in 3 months

issue commentLiquidPlayer/LiquidCore

Can't find exception message text

I know this is a late reply. But if this is still relevant, you can always console.log(e.message) to get the actual human error message.

str11ngfello

comment created time in 3 months

issue commentLiquidPlayer/LiquidCore

Npm packages

You can use any npm package that does not have native bindings. That is, any package that is a pure JS implementation, or any of the Node.js built-in modules. You cannot use a module that requires compilation of a C/C++ addon, unless that addon has been modified for use with LiquidCore. For example, I have created a LiquidCore-compliant version of node-sqlite3 which is a fork of the original, but updated to work with LiquidCore. Other native modules would require some work, but it can be done.

Deepp0925

comment created time in 3 months

issue commentLiquidPlayer/LiquidCore

Pre Built Libraries

Are you sure this is the issue?

From android-configure:

    ./configure \
        --dest-cpu=$DEST_CPU \
        --dest-os=android \
        --with-intl=small-icu \
        --openssl-no-asm \
        --cross-compiling \
        --with-snapshot \
        --shared

From configure.py:

def configure_inspector(o):
  disable_inspector = (options.without_inspector or
                       options.with_intl in (None, 'none') or
                       options.without_ssl)
  o['variables']['v8_enable_inspector'] = 0 if disable_inspector else 1

So, theoretically, the inspector has not been disabled in the build. It should only be disabled if ICU or SSL have been disabled, or if --without-inspector was explicitly specified. None of these should be the case.

ackava

comment created time in 3 months

release LiquidPlayer/LiquidCore

0.7.7

released time in 3 months

push eventLiquidPlayer/LiquidCore

And42

commit sha 5212b13eea0ae4d6bb17cfdf0184c2d7d1b649cf

Fixed gradle build scripts on Windows

view details

Eric Lange

commit sha 56df13bb9355cb14ee49dfcf91d512c14fc0e7ad

Merge pull request #162 from And42/master Fixed gradle build scripts on Windows

view details

push time in 3 months

PR merged LiquidPlayer/LiquidCore

Fixed gradle build scripts on Windows

Tested on Windows 10 and Kubuntu. Can't check on Mac OS as don't have it. There were two options for slashes: either escape them ("\" > "\\") or replace them with forward slashes ("\" > "/"). Chose the latter one as this style is a bit more common across OSes and is supported by Windows

+5 -2

0 comment

1 changed file

And42

pr closed time in 3 months

GollumEvent

push eventLiquidPlayer/LiquidCore

Eric Lange

commit sha 8d6784e1dd92fe6d4541f76bd7cd07acc058e8e4

Fixed iOS issue where Value::IsXXXObject() throws exception in some cases

view details

push time in 3 months

created tagLiquidPlayer/caraml-console

tag0.2.2

An ANSI console addon for caraml

created time in 3 months

push eventLiquidPlayer/caraml-console

Eric Lange

commit sha 0b684225773b50ab870ea134397d2ed4ba5e1a68

Updated for LiquidCore 0.7.7

view details

push time in 3 months

push eventLiquidPlayer/caraml-console

Eric Lange

commit sha d1eb3ecc5998c841639868b17fe85cc8368b5e8d

Update README.md

view details

push time in 3 months

created tagLiquidPlayer/node-sqlite3

tag0.2.1

Asynchronous, non-blocking SQLite3 bindings for LiquidCore

created time in 3 months

push eventLiquidPlayer/node-sqlite3

Eric Lange

commit sha ab73718ef81795b4eb85d4eb891155d3a7d3de02

Updated for LiquidCore 0.7.7

view details

push time in 3 months

created tagLiquidPlayer/caraml-core

tag0.2.2

Native mobile UI addon for LiquidCore

created time in 3 months

push eventLiquidPlayer/caraml-core

Eric Lange

commit sha 8e57d7265e61554f4adfe3ff9695040757ad0ca3

Updated for LiquidCore 0.7.7

view details

push time in 3 months

created tagLiquidPlayer/LiquidCore

tag0.7.7

Node.js virtual machine for Android and iOS

created time in 3 months

push eventLiquidPlayer/LiquidCore

Eric Lange

commit sha a86aa81094c42c85921f83f91d851bcb10df0010

LiquidCore-headers is back Unfortunately, I could think of no way to get rid of it entirely. However, LiquidCore and LiquidCore-headers are now decoupled (not dependent on each other), which makes deployment easier.

view details

push time in 3 months

created tagLiquidPlayer/LiquidCore

tag0.7.6

Node.js virtual machine for Android and iOS

created time in 3 months

push eventLiquidPlayer/LiquidCore

Eric Lange

commit sha f881cc0dba4fd025ba3cc0cfb78a11aafefcf12f

Added LiquidCore/addon podspec

view details

push time in 3 months

issue closedLiquidPlayer/LiquidCore

Handling Promise, Async, and Javascript 'new' objects?

Re: issue 64

I am actually trying to run Ether JS library. The official documentation is available here.

I am trying to create a Wallet using the fromBrainWallet constructor. It takes in an emailID, password and a callback function.

When I use your code, the promise object does not have a property called then.

I have absolutely no idea about how I should handle this.

This is the code I am using (https://docs.ethers.io/ethers.js/html/api-providers.html#connecting-to-ethereum for reference) is able to get a reference to:

let defaultProvider = ethers.getDefaultProvider('ropsten');

but has an error when trying to use a 'new' object re:

let etherscanProvider = new ethers.providers.EtherscanProvider('ropsten');

which is the following:

I/System.out(17764): providerSetupFunction :: function EtherscanProvider(network, apiKey) {
I/System.out(17764):         var _this = _super.call(this, network) || this;
I/System.out(17764):         errors.checkNew(_this, EtherscanProvider);
I/System.out(17764):         var name = 'invalid';
I/System.out(17764):         if (_this.network) {
I/System.out(17764):             name = _this.network.name;
I/System.out(17764):         }
I/System.out(17764):         var baseUrl = null;
I/System.out(17764):         switch (name) {
I/System.out(17764):             case 'homestead':
I/System.out(17764):                 baseUrl = 'https://api.etherscan.io';
I/System.out(17764):                 break;
I/System.out(17764):             case 'ropsten':
I/System.out(17764):                 baseUrl = 'https://api-ropsten.etherscan.io';
I/System.out(17764):                 break;
I/System.out(17764):             case 'rinkeby':
I/System.out(17764):                 baseUrl = 'https://api-rinkeby.etherscan.io';
I/System.out(17764):                 break;
I/System.out(17764):             case 'kovan':
I/System.out(17764):                 baseUrl = 'https://api-kovan.etherscan.io';
I/System.out(17764):                 break;
I/System.out(17764):             case 'goerli':
I/System.out(17764):                 baseUrl = 'https://api-goerli.etherscan.io';
I/System.out(17764):                 break;
I/System.out(17764):             default:
I/System.out(17764):                 throw new Error('unsupported network');
I/System.out(17764):         }
I/System.out(17764):         properties_1.defineReadOnly(_this, 'baseUrl', baseUrl);
I/System.out(17764):         properties_1.defineReadOnly(_this, 'apiKey', apiKey);
I/System.out(17764):         return _this;
I/System.out(17764):     }
E/AndroidRuntime(17764): FATAL EXCEPTION: Thread-3
E/AndroidRuntime(17764): Process: com.shyftnetwork.wx, PID: 17764
E/AndroidRuntime(17764): TypeError: Object.defineProperty called on non-object
E/AndroidRuntime(17764): 	at org.liquidplayer.javascript.JSFunction.apply(JSFunction.java:416)
E/AndroidRuntime(17764): 	at org.liquidplayer.javascript.JSFunction.call(JSFunction.java:377)

further, re:

let defaultProvider = ethers.getDefaultProvider('ropsten');

Getting that (which does work) and then calling a function on one of its members, I'm getting the following error when using "getProviderBlockNumber" (which should return a promise object, though it crashes before returning the object):

I/System.out(14807):     myProviderObjectFunction ::function () {
I/System.out(14807):         var _this = this;
I/System.out(14807):         return this.ready.then(function () {
I/System.out(14807):             return _this.perform('getBlockNumber', {}).then(function (result) {
I/System.out(14807):                 var value = parseInt(result);
I/System.out(14807):                 if (value != result) {
I/System.out(14807):                     throw new Error('invalid response - getBlockNumber');
I/System.out(14807):                 }
I/System.out(14807):                 _this._setFastBlockNumber(value);
I/System.out(14807):                 return value;
I/System.out(14807):             });
I/System.out(14807):         });
I/System.out(14807):     }
E/AndroidRuntime(14807): FATAL EXCEPTION: Thread-3
E/AndroidRuntime(14807): Process: com.shyftnetwork.wx, PID: 14807
E/AndroidRuntime(14807): TypeError: Cannot read property 'ready' of null
E/AndroidRuntime(14807): 	at org.liquidplayer.javascript.JSFunction.apply(JSFunction.java:416)
E/AndroidRuntime(14807): 	at org.liquidplayer.javascript.JSFunction.call(JSFunction.java:377)

If you could point me to a framework example which work in this case, that would be excellent.

q1) Why would getting a JSObject of the type "new" have internal issues referencing itself? q2) How do I get a promise object returned without it crashing inside of the function call?

I'm assuming these issues are directly related?

Thanks for your help, I'd vastly prefer understanding how your microservices work and then extending the same mechanisms in the IOS realm rather than patching together different implementations on various platforms.

Fyi: I'm using the format:

var service = MicroService(this@MainActivity, uri, startListener)

where in the service object I'm starting a new Thread inside of the onStart function, and then running the code that results in the errors referenced above inside of the "run" of the Runnable (which I'm assuming maintains the object references to the various JSObjects, as I thought that may have been the issue with the "new" objects)

closed time in 3 months

chris-shyft

issue commentLiquidPlayer/LiquidCore

Handling Promise, Async, and Javascript 'new' objects?

Please try the latest version of LiquidCore (0.7.5+) and see if this is still a problem. IPFS seems to work ok, which uses ethereum. Please re-open if there is still a problem.

chris-shyft

comment created time in 3 months

issue closedLiquidPlayer/LiquidCore

Execution failed for task ':app:bundleLiquidCoreCode'.

This is what I am getting from Gradle;

* What went wrong:
Execution failed for task ':app:bundleLiquidCoreCode'.
> A problem occurred starting process 'command '/usr/bin/env''

I checked the liquidcore.build.gradle and there's a line executable '/usr/bin/env' which I feel might be the source of the error. Is there a way to resolve it?

closed time in 3 months

Iyamu-J

issue commentLiquidPlayer/LiquidCore

Execution failed for task ':app:bundleLiquidCoreCode'.

I do not have a Windows device. If someone wants to submit a PR for this, I will happily merge it. Please reopen if needed.

Iyamu-J

comment created time in 3 months

issue closedLiquidPlayer/LiquidCore

Android Jitpack builds failing

Refer to https://jitpack.io/#LiquidPlayer/LiquidCore

From 0.70 onward the Android Jitpack builds are failing, causing gradle sync failures when trying to use 0.7.0+ in my project.

The alternative of using % npm i -g liquidcore-cli yields the same gradle sync failures.

closed time in 3 months

kaneelyster

issue closedLiquidPlayer/LiquidCore

Expose service.getProcess().getContext()

Hi @ericwlange, in relation to https://github.com/LiquidPlayer/LiquidCore/issues/138#issuecomment-558262820, it's totally up to you if it's safe to expose service.getProcess().getContext() and in what manner to expose the context. But it would really be handy if there was a standard way for this to be exposed especially that I could not get it from payload.getContext() https://github.com/LiquidPlayer/LiquidCore/issues/141.

closed time in 3 months

bangonkali

release LiquidPlayer/LiquidCore

0.7.5

released time in 3 months

created tagLiquidPlayer/LiquidCore

tag0.7.5

Node.js virtual machine for Android and iOS

created time in 3 months

push eventLiquidPlayer/LiquidCore

Eric Lange

commit sha 0c4bc1868bc11d19c5aa90448c36da9d70f6ffa1

Fixed podpsec issue

view details

push time in 3 months

push eventLiquidPlayer/LiquidCore

Eric Lange

commit sha e4868de626ce63cf21fd30bfc8615727620ff12b

Update README.md

view details

push time in 3 months

push eventLiquidPlayer/LiquidCore

Eric Lange

commit sha b921ee94fd258317a2f7d378647881c90c7dccfa

Update README.md

view details

push time in 3 months

push eventLiquidPlayer/LiquidCore

Eric Lange

commit sha da92c36a65c5d2e71571a8318e2763a00b851940

Fixed issues with npx, fixed usage descriptions

view details

push time in 3 months

push eventLiquidPlayer/LiquidCore

Eric Lange

commit sha c4ed2ff9e4e80f87d4c8071712d82eeee9348cbd

Removed need for LiquidCore-headers.podspec

view details

push time in 3 months

issue closedLiquidPlayer/LiquidCore

iOS build faild

image image

xcode: 11.4 macos: 10.15.4

closed time in 3 months

pantaopt

push eventLiquidPlayer/LiquidCore

Eric Lange

commit sha c6f9710d53aa0a77c9183a9e3416b719103d5491

Feature Request #142: Added access to context from Process Android: Process.getJSContext() iOS: LCProcess.context property

view details

push time in 3 months

issue commentLiquidPlayer/LiquidCore

node: command not found [iOS]

Interesting. I am also using nvm and it never occurred to me that the build script is ignoring that.

This is the only place that it matters, though, no? You could change the line to:

s.script_phase = { :name => 'Bundle JavaScript Files', :script => '(cd ..; nvm use 10.15.3; node node_modules/liquidcore/lib/cli.js bundle --platform=ios)' }

Including the nvm use xxx line should do what you want but I haven't tried it.

Is there somewhere else it causes a problem?

daetal-us

comment created time in 3 months

issue commentLiquidPlayer/LiquidCore

iOS build faild

This is an incredibly strange set of symbols to be undefined (and just those?). Very odd.

I cannot reproduce this. What does your podfile look like?

pantaopt

comment created time in 3 months

issue commentLiquidPlayer/LiquidCore

Update to v12 LTS

Hi @okhiroyuki,

Glad you like the project. I only just upgraded to v10 LTS from v8 LTS a few months ago! I do not have a current timeframe for moving to v12 LTS. For Android, this is a lot of work, but manageable. It is iOS that concerns me because JavaScriptCore is not advancing at the same rate as V8. For instance, in v10, node makes use of BigInt. If you scroll down to the compatibility table, you will see that it is not available on "Safari for iOS". To work around that, I had to polyfill it, but it is unfortunately not a perfect replacement. Same goes for SharedArrayBuffer. This one I have not polyfilled. Fortunately most native modules don't use it. But the further we move ahead, the more incompatibilities I expect until Apple catches up. So from that perspective, I have been intentionally a little behind the state-of-the-art.

At some point, however, I will take a look at it. But I would like v0.7.x to stabilize first.

As for libnode.so, it is no longer used in LiquidCore. Now I only use the static V8 libraries. Instead, node and its other dependencies are built directly inside of LiquidCore from source. I never liked the idea of having prebuilt binaries. It feels like a scary security hole. However, I have not found a way to build V8 directly yet in the build process. There are several reasons for this, but snapshots play an outsized role. I do most of my development work on a Mac. In Catalina, Apple dropped support for 32-bit processors. But to build the snapshots for older ARM and x86 Android devices, this is required. So my workaround has been to open Ubuntu in a VirtualBox and build the 32-bit libraries from there. It is a massive hack and I really do not like it. So I haven't really documented it. I want to find a better way.

Out of curiosity, what features in v12 do you need?

okhiroyuki

comment created time in 3 months

pull request commentLiquidPlayer/LiquidCore

Leverage `bin` property of package.json

This has been merged and released in 0.7.4, thank you!

daetal-us

comment created time in 3 months

issue closedLiquidPlayer/LiquidCore

getting full file system access

I understand the idea of sandboxing file system access, but I'm working on a project where I fully trust the script I'm running inside LiquidCore and the virtual file system makes things quite difficult for me, i.e. I need to constantly map between paths of the environment and my script.

I would highly welcome an option to allow full access to the hosts file system. If there already is such an option, I'm afraid I haven't found it.

closed time in 3 months

Znerole

issue commentLiquidPlayer/LiquidCore

getting full file system access

This has been added to 0.7.4

Znerole

comment created time in 3 months

release LiquidPlayer/LiquidCore

0.7.4

released time in 3 months

created tagLiquidPlayer/LiquidCore

tag0.7.4

Node.js virtual machine for Android and iOS

created time in 3 months

push eventLiquidPlayer/LiquidCore

Eric Lange

commit sha 16e40ddd45c3a0a8aaeada3a779ef1813605e6b4

Update README.md

view details

push time in 3 months

push eventLiquidPlayer/LiquidCore

Jon Adams

commit sha 94bf0277bab06e6ffd52b0dca739589626b8ad96

update to leverage package.json `bin`

view details

Jon Adams

commit sha e1e7d1393300507cfacb83b8083b2c45118168c0

updated init scripts + updated readme to reflect new bin/npx utilization

view details

Eric Lange

commit sha 1e324e688846755ca231527e4997ce424c39e445

Merge pull request #157 from daetal-us/master Leverage `bin` property of package.json

view details

push time in 3 months

PR merged LiquidPlayer/LiquidCore

Leverage `bin` property of package.json

Updated the bin parameter to be able to more conveniently run the cli commands via npx. Updated init.js and README to reflect usage. Could even consider dropping the addition the scripts properties to userland package?

+27 -26

0 comment

5 changed files

daetal-us

pr closed time in 3 months

push eventLiquidPlayer/LiquidCore

Eric Lange

commit sha 89d6a1af618e7aa5e07973a204c26ff3b3388752

iOS code cleanup for easier reading Fixed issue when cleaning dead microservices on iOS

view details

push time in 3 months

issue commentLiquidPlayer/LiquidCore

Expose service.getProcess().getContext()

BTW, here is the workaround to get the context in Android.

JSContext getJSContextFromMicroService(MicroService service) {
    final JSContext[] context_ = new JSContext[1];
    final Semaphore sync_ = new Semaphore(0);
    Process.EventListener listener = new Process.EventListener() {
        @Override public void onProcessStart(Process process, JSContext ctx) {
            context_[0] = ctx;
            sync_.release();
        }
        @Override public void onProcessAboutToExit(Process process, int exitCode) {}
        @Override public void onProcessExit(Process process, int exitCode) {}
        @Override public void onProcessFailed(Process process, Exception error) {}
    });
    service.getProcess().addEventListener(listener);
    sync_.acquireUninterruptibly();
    service.getProcess().removeEventListener(listener);
    return context_[0];
}
bangonkali

comment created time in 3 months

issue commentLiquidPlayer/LiquidCore

getting full file system access

Hi @Znerole - I have added this functionality which will get pushed with the next release.

Android Example

  android.content.Context context = ...;
  MicroService service = ...;

  final String dir = context.getFilesDir().getAbsolutePath();
  service.getProcess().exposeHostDirectory(dir, Process.kMediaAccessPermissionsRW);

Assuming dir is something like /data/data/0/org.foo.bar/blahblah, this directory will now be available to the micro service:

  const fs = require('fs')
  let content = String(fs.readFileSync('/data/data/0/org.foo.bar/blahblah/SomeFile.txt'))

iOS Example

  service.process.exposeHostDirectory(NSHomeDirectory(), mediaAccessMask:PermissionsRW)
Znerole

comment created time in 3 months

push eventLiquidPlayer/LiquidCore

Eric Lange

commit sha 01a3b5d5478301d46fe1adf6741c76f12e595bcb

Feature request (#156) to enable access to host filesystem Added `Process.exposeHostDirectory()` (Android) and `-LCProcess.exposeHostDirectory:mediaAccessMask:` (iOS) to allow exposing raw host filesystem directories to a node.js process. Re-added iOS tests that got lost in transition to 0.7.x

view details

push time in 3 months

more