Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1f6b42c844 | ||
|
|
c53bbc74e1 | ||
|
|
69c49a5557 | ||
|
|
2ed3b50663 | ||
|
|
8dd75205f3 | ||
|
|
081f1a2115 | ||
|
|
99b2809532 | ||
|
|
7f1e83672e | ||
|
|
faaf6d5f94 | ||
|
|
0e3b645695 | ||
|
|
bcf919fcbb | ||
|
|
f7fedf1338 | ||
|
|
7f71c01460 | ||
|
|
b4d95b240d | ||
|
|
260f342bb7 | ||
|
|
20ac0eb2c7 | ||
|
|
30e7ad585a | ||
|
|
ca144fbe1b | ||
|
|
ba1ff91cdd | ||
|
|
5fa203c6f2 | ||
|
|
1fb71bdfc8 | ||
|
|
1d3a44b933 | ||
|
|
9fea5c9704 | ||
|
|
9a1f0a337e | ||
|
|
fac5301ace | ||
|
|
3d2c6a9333 | ||
|
|
5422c02da3 | ||
|
|
d707230b17 | ||
|
|
e582ba4169 | ||
|
|
2266d87ade | ||
|
|
147958dd13 | ||
|
|
17fd6df773 | ||
|
|
6794273dbf | ||
|
|
c4da42b4d2 | ||
|
|
c4eeda5df0 | ||
|
|
17bb87bb87 | ||
|
|
36c4052039 | ||
|
|
468d827aa2 | ||
|
|
f32781a8e9 | ||
|
|
8ba4f9ebae | ||
|
|
d97a7fb325 | ||
|
|
b47fdc6698 | ||
|
|
56cb2b747a | ||
|
|
afbdb4c0b4 | ||
|
|
528d05eec1 | ||
|
|
0c83801209 | ||
|
|
552c85d6c7 | ||
|
|
6c135e2570 | ||
|
|
8b809ec1bc | ||
|
|
bac2bb8b8e | ||
|
|
00a503bf84 | ||
|
|
3e7f7232fb | ||
|
|
6992b625d6 | ||
|
|
5a55c6ccb2 | ||
|
|
38bbf84de4 | ||
|
|
74743630b7 | ||
|
|
a489e07bd1 | ||
|
|
8205368e5c | ||
|
|
aa0d9ba41f | ||
|
|
3e8ac1939e | ||
|
|
b71853c92a |
@@ -176,7 +176,7 @@ fdroid-fix-tmp: ##@prepare Fix TMPDIR permissions so Vagrant user is the owner
|
||||
|
||||
fdroid-build-env: fdroid-max-watches fdroid-nix-dir fdroid-fix-tmp ##@prepare Setup build environment for F-Droud build
|
||||
|
||||
fdroid-pr: export TARGET := android
|
||||
fdroid-pr: export TARGET := android-sdk
|
||||
fdroid-pr: ##@prepare Create F-Droid release PR
|
||||
ifndef APK
|
||||
$(error APK env var not defined)
|
||||
@@ -285,7 +285,7 @@ endif
|
||||
|
||||
lint: export TARGET := clojure
|
||||
lint: ##@test Run code style checks
|
||||
yarn clj-kondo --confg .clj-kondo/config.edn --lint src && \
|
||||
yarn clj-kondo --config .clj-kondo/config.edn --cache false --lint src && \
|
||||
TARGETS=$$(git diff --diff-filter=d --cached --name-only src && echo src) && \
|
||||
clojure -Scp "$$CLASS_PATH" -m cljfmt.main check --indents indentation.edn $$TARGETS
|
||||
|
||||
@@ -314,7 +314,7 @@ test: ##@test Run tests once in NodeJS
|
||||
# Other
|
||||
#--------------
|
||||
|
||||
geth-connect: export TARGET := android-env
|
||||
geth-connect: export TARGET := android-sdk
|
||||
geth-connect: ##@other Connect to Geth on the device
|
||||
adb forward tcp:8545 tcp:8545 && \
|
||||
build/bin/geth attach http://localhost:8545
|
||||
@@ -324,22 +324,22 @@ android-clean: ##@prepare Clean Gradle state
|
||||
git clean -dxf -f ./android/app/build; \
|
||||
[[ -d android/.gradle ]] && cd android && ./gradlew clean
|
||||
|
||||
android-ports: export TARGET := android-env
|
||||
android-ports: export TARGET := android-sdk
|
||||
android-ports: ##@other Add proxies to Android Device/Simulator
|
||||
adb reverse tcp:8081 tcp:8081 && \
|
||||
adb reverse tcp:3449 tcp:3449 && \
|
||||
adb reverse tcp:4567 tcp:4567 && \
|
||||
adb forward tcp:5561 tcp:5561
|
||||
|
||||
android-devices: export TARGET := android-env
|
||||
android-devices: export TARGET := android-sdk
|
||||
android-devices: ##@other Invoke adb devices
|
||||
adb devices
|
||||
|
||||
android-logcat: export TARGET := android-env
|
||||
android-logcat: export TARGET := android-sdk
|
||||
android-logcat: ##@other Read status-mobile logs from Android phone using adb
|
||||
adb logcat | grep -e RNBootstrap -e ReactNativeJS -e ReactNative -e StatusModule -e StatusNativeLogs -e 'F DEBUG :' -e 'Go :' -e 'GoLog :' -e 'libc :'
|
||||
|
||||
android-install: export TARGET := android-env
|
||||
android-install: export TARGET := android-sdk
|
||||
android-install: export BUILD_TYPE ?= release
|
||||
android-install: ##@other Install APK on device using adb
|
||||
adb install result/app-$(BUILD_TYPE).apk
|
||||
|
||||
@@ -76,13 +76,22 @@ import com.sun.org.apache.xalan.internal.xsltc.compiler.Copy
|
||||
* extraPackagerArgs: []
|
||||
* ]
|
||||
*/
|
||||
|
||||
/*
|
||||
Enabling Hermes on x86 devices is crashing the app after a few reloads,
|
||||
this flag can be used to disable Hermes while building app.
|
||||
https://github.com/status-im/status-mobile/issues/14031
|
||||
*/
|
||||
|
||||
def disableHermes = System.getenv('DISABLE_HERMES') == 'true'
|
||||
|
||||
project.ext.react = [
|
||||
nodeExecutableAndArgs: ["node", "--max-old-space-size=16384"],
|
||||
entryFile: "index.js",
|
||||
/* NOTE: Hermes engine is required for Android 64-bit builds running on 64 devices,
|
||||
* to guard against a hang in the UI thread after invoking status-go.
|
||||
* Also a clean and rebuild is required when changing this. */
|
||||
enableHermes: true,
|
||||
enableHermes: !disableHermes,
|
||||
/* Disable 'The first definition was here.' warnings */
|
||||
hermesFlagsRelease: ["-w"],
|
||||
bundleInPr: true,
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
<meta-data android:name="commitHash" android:value="${commitHash}"/>
|
||||
<activity
|
||||
android:name=".MainActivity"
|
||||
android:exported="true"
|
||||
android:label="@string/app_name"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="adjustResize"
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
# Version requirements used throughout the Gradle scripts
|
||||
kotlinVersion=1.3.50
|
||||
minSdkVersion=23
|
||||
compileSdkVersion=30
|
||||
targetSdkVersion=30
|
||||
compileSdkVersion=31
|
||||
targetSdkVersion=31
|
||||
buildToolsVersion=31.0.0
|
||||
supportLibVersion=28.0.0
|
||||
# This should match version from nix/mobile/android/maven-and-npm-deps/maven/default.nix
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
library 'status-jenkins-lib@v1.5.3'
|
||||
library 'status-jenkins-lib@v1.6.0'
|
||||
|
||||
/* Options section can't access functions in objects. */
|
||||
def isPRBuild = utils.isPRBuild()
|
||||
|
||||
pipeline {
|
||||
agent { label 'linux && x86_64 && nix-2.8' }
|
||||
agent { label 'linux && x86_64 && nix-2.11' }
|
||||
|
||||
options {
|
||||
timestamps()
|
||||
@@ -49,10 +49,9 @@ pipeline {
|
||||
stage('Prep') {
|
||||
steps {
|
||||
script {
|
||||
btype = utils.getBuildType()
|
||||
print "Running ${btype} build!"
|
||||
/* Cleanup and Prep */
|
||||
commonPrep(btype)
|
||||
utils.doGitRebasePR()
|
||||
utils.symlinkEnv()
|
||||
println("Build Number: ${utils.genBuildNumber()}")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
library 'status-jenkins-lib@v1.5.3'
|
||||
library 'status-jenkins-lib@v1.6.0'
|
||||
|
||||
pipeline {
|
||||
agent { label 'linux' }
|
||||
@@ -33,7 +33,7 @@ pipeline {
|
||||
stages {
|
||||
stage('Prep') {
|
||||
steps { script {
|
||||
println "Current JOB: ${env.JOB_NAME}"
|
||||
println("Current JOB: ${env.JOB_NAME}")
|
||||
/* just for a shorter access */
|
||||
btype = utils.getBuildType()
|
||||
} }
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
library 'status-jenkins-lib@v1.5.3'
|
||||
library 'status-jenkins-lib@v1.6.0'
|
||||
|
||||
/* Options section can't access functions in objects. */
|
||||
def isPRBuild = utils.isPRBuild()
|
||||
|
||||
pipeline {
|
||||
agent { label 'macos && x86_64 && nix-2.8 && xcode-13.4' }
|
||||
agent { label 'macos && x86_64 && nix-2.11 && xcode-13.4' }
|
||||
|
||||
parameters {
|
||||
string(
|
||||
@@ -48,10 +48,9 @@ pipeline {
|
||||
stage('Prep') {
|
||||
steps {
|
||||
script {
|
||||
btype = utils.getBuildType()
|
||||
print "Running ${btype} build!"
|
||||
/* Cleanup and Prep */
|
||||
commonPrep(btype)
|
||||
utils.doGitRebasePR()
|
||||
utils.symlinkEnv()
|
||||
println("Build Number: ${utils.genBuildNumber()}")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
library 'status-jenkins-lib@v1.5.3'
|
||||
library 'status-jenkins-lib@v1.6.0'
|
||||
|
||||
pipeline {
|
||||
agent { label params.AGENT_LABEL }
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
library 'status-jenkins-lib@v1.5.0'
|
||||
library 'status-jenkins-lib@v1.6.0'
|
||||
|
||||
/* Options section can't access functions in objects. */
|
||||
def isPRBuild = utils.isPRBuild()
|
||||
|
||||
pipeline {
|
||||
agent { label 'linux && x86_64 && nix-2.8' }
|
||||
agent { label 'linux && x86_64 && nix-2.11' }
|
||||
|
||||
options {
|
||||
timestamps()
|
||||
@@ -44,10 +44,7 @@ pipeline {
|
||||
stage('Prep') {
|
||||
steps {
|
||||
script {
|
||||
btype = utils.getBuildType()
|
||||
print "Running ${btype} build!"
|
||||
/* Cleanup and Prep */
|
||||
commonPrep(btype)
|
||||
utils.doGitRebasePR()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
library 'status-jenkins-lib@v1.5.3'
|
||||
library 'status-jenkins-lib@v1.6.0'
|
||||
|
||||
pipeline {
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
library 'status-jenkins-lib@v1.5.3'
|
||||
library 'status-jenkins-lib@v1.6.0'
|
||||
|
||||
pipeline {
|
||||
agent { label 'macos' }
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
library 'status-jenkins-lib@v1.5.3'
|
||||
library 'status-jenkins-lib@v1.6.0'
|
||||
|
||||
pipeline {
|
||||
agent { label 'linux' }
|
||||
|
||||
@@ -84,7 +84,8 @@ At the bottom of the file you should also update the following keys:
|
||||
* `CurrentVersion` - Same as the new `versionName` added
|
||||
* `CurrentVersionCode` - Same as the `versionCode` added
|
||||
|
||||
Then submit a merge request to the [fdroid/fdroiddata](https://gitlab.com/fdroid/fdroiddata) repository.
|
||||
Then submit a merge request with `Draft: ` prefix to the [fdroid/fdroiddata](https://gitlab.com/fdroid/fdroiddata) repository.
|
||||
Prefix is necessary to avoid F-Droid people merging the PR before it's ready.
|
||||
|
||||
:warning: __WARNING__: Currently GitLab PR builds will fail due to running as `root` instead of `vagrant` and failing to install Nix.
|
||||
|
||||
|
||||
@@ -97,3 +97,32 @@ System's local adb and Nix's adb differ. As adb include of server/client process
|
||||
Always use respective `make` commands, e.g. `make android-ports`, `make android-devices`, etc.
|
||||
|
||||
Alternatively, run adb commands only from `make shell TARGET=android` shell. Don't forget the `TARGET=android` env var setting - otherwise `adb` will still be selected from the system's default location. You can double-check this by running `which adb`.
|
||||
|
||||
# Hot Reloading Crashes
|
||||
## APP Crashes on reloading changes
|
||||
|
||||
### Cause
|
||||
Status-mobile uses `shadow-cljs` for hot reloading changes and uses its own [reloader](https://github.com/status-im/status-mobile/blob/develop/src/status_im/reloader.cljs) for updating them in the running app. If react-native's fast refresh is also enabled then it creates conflicts and crashes the app.
|
||||
|
||||
### Solution
|
||||
Open react native's [In-App Developer Menu](https://reactnative.dev/docs/debugging#accessing-the-in-app-developer-menu) and press "Disable Fast Refresh" or "Disable Hot Reloading"
|
||||
|
||||
## App Crashes after few reloads
|
||||
|
||||
### Cause
|
||||
For x86 CPU architecture Android Devices, Hermes is creating the issue and the app crashes after a few reloads.
|
||||
([Original Issue](https://github.com/status-im/status-mobile/issues/14031))
|
||||
|
||||
<details>
|
||||
<summary>How to Find CPU architecture</summary>
|
||||
|
||||
CPU architecture of android device can be found using
|
||||
- `adb shell uname -m` or
|
||||
- `adb shell getprop ro.product.cpu.abilist`
|
||||
|
||||
</details>
|
||||
|
||||
### Solution
|
||||
Disable Hermes while building the app
|
||||
|
||||
`make run-android DISABLE_HERMES=true`
|
||||
@@ -1411,6 +1411,31 @@ class StatusModule extends ReactContextBaseJavaModule implements LifecycleEventL
|
||||
return Statusgo.identicon(seed);
|
||||
}
|
||||
|
||||
@ReactMethod(isBlockingSynchronousMethod = true)
|
||||
public String encodeTransfer(final String to, final String value) {
|
||||
return Statusgo.encodeTransfer(to, value);
|
||||
}
|
||||
|
||||
@ReactMethod(isBlockingSynchronousMethod = true)
|
||||
public String encodeFunctionCall(final String method, final String paramsJSON) {
|
||||
return Statusgo.encodeFunctionCall(method, paramsJSON);
|
||||
}
|
||||
|
||||
@ReactMethod(isBlockingSynchronousMethod = true)
|
||||
public String decodeParameters(final String decodeParamJSON) {
|
||||
return Statusgo.decodeParameters(decodeParamJSON);
|
||||
}
|
||||
|
||||
@ReactMethod(isBlockingSynchronousMethod = true)
|
||||
public String hexToNumber(final String hex) {
|
||||
return Statusgo.hexToNumber(hex);
|
||||
}
|
||||
|
||||
@ReactMethod(isBlockingSynchronousMethod = true)
|
||||
public String numberToHex(final String numString) {
|
||||
return Statusgo.numberToHex(numString);
|
||||
}
|
||||
|
||||
@ReactMethod
|
||||
public void identiconAsync(final String seed, final Callback callback) {
|
||||
Log.d(TAG, "identiconAsync");
|
||||
@@ -1572,5 +1597,6 @@ class StatusModule extends ReactContextBaseJavaModule implements LifecycleEventL
|
||||
|
||||
StatusThreadPoolExecutor.getInstance().execute(r);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -78,9 +78,10 @@ public class ForegroundService extends Service {
|
||||
|
||||
|
||||
|
||||
PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, intent, 0);
|
||||
PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, intent, PendingIntent.FLAG_MUTABLE);
|
||||
Intent stopIntent = new Intent(PushNotificationHelper.ACTION_TAP_STOP);
|
||||
PendingIntent stopPendingIntent = PendingIntent.getBroadcast(context, 0, stopIntent, PendingIntent.FLAG_CANCEL_CURRENT);
|
||||
PendingIntent stopPendingIntent = PendingIntent.getBroadcast(context, 0, stopIntent,
|
||||
PendingIntent.FLAG_CANCEL_CURRENT | PendingIntent.FLAG_MUTABLE);
|
||||
|
||||
Notification notification = new NotificationCompat.Builder(context, CHANNEL_ID)
|
||||
.setSmallIcon(R.drawable.ic_stat_notify_status)
|
||||
|
||||
@@ -522,7 +522,7 @@ public class PushNotificationHelper {
|
||||
actionIntent.setPackage(packageName);
|
||||
|
||||
PendingIntent pendingActionIntent = PendingIntent.getBroadcast(context, notificationID, actionIntent,
|
||||
PendingIntent.FLAG_UPDATE_CURRENT);
|
||||
PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_MUTABLE);
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||
notification.addAction(new NotificationCompat.Action.Builder(icon, action, pendingActionIntent).build());
|
||||
@@ -708,26 +708,30 @@ public class PushNotificationHelper {
|
||||
Intent intent = new Intent(ACTION_DELETE_NOTIFICATION);
|
||||
intent.putExtra("im.status.ethereum.deepLink", deepLink);
|
||||
intent.putExtra("im.status.ethereum.groupId", groupId);
|
||||
return PendingIntent.getBroadcast(context.getApplicationContext(), notificationId, intent, PendingIntent.FLAG_CANCEL_CURRENT);
|
||||
return PendingIntent.getBroadcast(context.getApplicationContext(), notificationId, intent,
|
||||
PendingIntent.FLAG_CANCEL_CURRENT | PendingIntent.FLAG_MUTABLE);
|
||||
}
|
||||
|
||||
private PendingIntent createGroupOnTapIntent(Context context, int notificationId, String groupId, String deepLink) {
|
||||
Intent intent = new Intent(ACTION_TAP_NOTIFICATION);
|
||||
intent.putExtra("im.status.ethereum.deepLink", deepLink);
|
||||
intent.putExtra("im.status.ethereum.groupId", groupId);
|
||||
return PendingIntent.getBroadcast(context.getApplicationContext(), notificationId, intent, PendingIntent.FLAG_CANCEL_CURRENT);
|
||||
return PendingIntent.getBroadcast(context.getApplicationContext(), notificationId, intent,
|
||||
PendingIntent.FLAG_CANCEL_CURRENT | PendingIntent.FLAG_MUTABLE);
|
||||
}
|
||||
|
||||
private PendingIntent createOnTapIntent(Context context, int notificationId, String deepLink) {
|
||||
Intent intent = new Intent(ACTION_TAP_NOTIFICATION);
|
||||
intent.putExtra("im.status.ethereum.deepLink", deepLink);
|
||||
return PendingIntent.getBroadcast(context.getApplicationContext(), notificationId, intent, PendingIntent.FLAG_CANCEL_CURRENT);
|
||||
return PendingIntent.getBroadcast(context.getApplicationContext(), notificationId, intent,
|
||||
PendingIntent.FLAG_CANCEL_CURRENT | PendingIntent.FLAG_MUTABLE);
|
||||
}
|
||||
|
||||
private PendingIntent createOnDismissedIntent(Context context, int notificationId, String deepLink) {
|
||||
Intent intent = new Intent(ACTION_DELETE_NOTIFICATION);
|
||||
intent.putExtra("im.status.ethereum.deepLink", deepLink);
|
||||
return PendingIntent.getBroadcast(context.getApplicationContext(), notificationId, intent, PendingIntent.FLAG_CANCEL_CURRENT);
|
||||
return PendingIntent.getBroadcast(context.getApplicationContext(), notificationId, intent,
|
||||
PendingIntent.FLAG_CANCEL_CURRENT | PendingIntent.FLAG_MUTABLE);
|
||||
}
|
||||
|
||||
public void removeStatusMessage(Bundle bundle) {
|
||||
|
||||
@@ -164,16 +164,27 @@ RCT_EXPORT_METHOD(sendLogs:(NSString *)dbJson
|
||||
NSString *networkDirPath = @"ethereum/mainnet_rpc";
|
||||
#endif
|
||||
|
||||
#if DEBUG
|
||||
NSString *goerliNetworkDirPath = @"ethereum/goerli_rpc_dev";
|
||||
#else
|
||||
NSString *goerliNetworkDirPath = @"ethereum/goerli_rpc";
|
||||
#endif
|
||||
|
||||
NSURL *networkDir = [rootUrl URLByAppendingPathComponent:networkDirPath];
|
||||
NSURL *originalGethLogsFile = [networkDir URLByAppendingPathComponent:@"geth.log"];
|
||||
NSURL *gethLogsFile = [logsFolderName URLByAppendingPathComponent:@"geth.log"];
|
||||
|
||||
NSURL *goerliNetworkDir = [rootUrl URLByAppendingPathComponent:goerliNetworkDirPath];
|
||||
NSURL *goerliGethLogsFile = [goerliNetworkDir URLByAppendingPathComponent:@"geth.log"];
|
||||
NSURL *goerliLogsFile = [logsFolderName URLByAppendingPathComponent:@"goerli_geth.log"];
|
||||
|
||||
[dbJson writeToFile:dbFile.path atomically:YES encoding:NSUTF8StringEncoding error:nil];
|
||||
[jsLogs writeToFile:jsLogsFile.path atomically:YES encoding:NSUTF8StringEncoding error:nil];
|
||||
|
||||
//NSString* gethLogs = StatusgoExportNodeLogs();
|
||||
//[gethLogs writeToFile:gethLogsFile.path atomically:YES encoding:NSUTF8StringEncoding error:nil];
|
||||
[fileManager copyItemAtPath:originalGethLogsFile.path toPath:gethLogsFile.path error:nil];
|
||||
[fileManager copyItemAtPath:goerliGethLogsFile.path toPath:goerliLogsFile.path error:nil];
|
||||
|
||||
[SSZipArchive createZipFileAtPath:zipFile.path withContentsOfDirectory:logsFolderName.path];
|
||||
[fileManager removeItemAtPath:logsFolderName.path error:nil];
|
||||
@@ -820,6 +831,28 @@ RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(identicon:(NSString *)publicKey) {
|
||||
return StatusgoIdenticon(publicKey);
|
||||
}
|
||||
|
||||
RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(encodeTransfer:(NSString *)to
|
||||
value:(NSString *)value) {
|
||||
return StatusgoEncodeTransfer(to,value);
|
||||
}
|
||||
|
||||
RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(encodeFunctionCall:(NSString *)method
|
||||
paramsJSON:(NSString *)paramsJSON) {
|
||||
return StatusgoEncodeFunctionCall(method,paramsJSON);
|
||||
}
|
||||
|
||||
RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(decodeParameters:(NSString *)decodeParamJSON) {
|
||||
return StatusgoDecodeParameters(decodeParamJSON);
|
||||
}
|
||||
|
||||
RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(hexToNumber:(NSString *)hex) {
|
||||
return StatusgoHexToNumber(hex);
|
||||
}
|
||||
|
||||
RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(numberToHex:(NSString *)numString) {
|
||||
return StatusgoNumberToHex(numString);
|
||||
}
|
||||
|
||||
RCT_EXPORT_METHOD(validateMnemonic:(NSString *)seed
|
||||
callback:(RCTResponseSenderBlock)callback) {
|
||||
#if DEBUG
|
||||
|
||||
@@ -386,6 +386,182 @@ void _Identicon(const FunctionCallbackInfo<Value>& args) {
|
||||
|
||||
}
|
||||
|
||||
void _EncodeTransfer(const FunctionCallbackInfo<Value>& args) {
|
||||
Isolate* isolate = args.GetIsolate();
|
||||
Local<Context> context = isolate->GetCurrentContext();
|
||||
|
||||
if (args.Length() != 2) {
|
||||
// Throw an Error that is passed back to JavaScript
|
||||
isolate->ThrowException(Exception::TypeError(
|
||||
String::NewFromUtf8Literal(isolate, "Wrong number of arguments for EncodeTransfer")));
|
||||
return;
|
||||
}
|
||||
|
||||
// Check the argument types
|
||||
|
||||
if (!args[0]->IsString()) {
|
||||
isolate->ThrowException(Exception::TypeError(
|
||||
String::NewFromUtf8Literal(isolate, "Wrong argument type for 'to'")));
|
||||
return;
|
||||
}
|
||||
|
||||
if (!args[1]->IsString()) {
|
||||
isolate->ThrowException(Exception::TypeError(
|
||||
String::NewFromUtf8Literal(isolate, "Wrong argument type for 'value'")));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
String::Utf8Value arg0Obj(isolate, args[0]->ToString(context).ToLocalChecked());
|
||||
char *arg0 = *arg0Obj;
|
||||
String::Utf8Value arg1Obj(isolate, args[1]->ToString(context).ToLocalChecked());
|
||||
char *arg1 = *arg1Obj;
|
||||
|
||||
// Call exported Go function, which returns a C string
|
||||
char *c = EncodeTransfer(arg0, arg1);
|
||||
|
||||
Local<String> ret = String::NewFromUtf8(isolate, c).ToLocalChecked();
|
||||
args.GetReturnValue().Set(ret);
|
||||
delete c;
|
||||
|
||||
}
|
||||
|
||||
void _EncodeFunctionCall(const FunctionCallbackInfo<Value>& args) {
|
||||
Isolate* isolate = args.GetIsolate();
|
||||
Local<Context> context = isolate->GetCurrentContext();
|
||||
|
||||
if (args.Length() != 2) {
|
||||
// Throw an Error that is passed back to JavaScript
|
||||
isolate->ThrowException(Exception::TypeError(
|
||||
String::NewFromUtf8Literal(isolate, "Wrong number of arguments for EncodeFunctionCall")));
|
||||
return;
|
||||
}
|
||||
|
||||
// Check the argument types
|
||||
|
||||
if (!args[0]->IsString()) {
|
||||
isolate->ThrowException(Exception::TypeError(
|
||||
String::NewFromUtf8Literal(isolate, "Wrong argument type for 'method'")));
|
||||
return;
|
||||
}
|
||||
|
||||
if (!args[1]->IsString()) {
|
||||
isolate->ThrowException(Exception::TypeError(
|
||||
String::NewFromUtf8Literal(isolate, "Wrong argument type for 'paramsJSON'")));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
String::Utf8Value arg0Obj(isolate, args[0]->ToString(context).ToLocalChecked());
|
||||
char *arg0 = *arg0Obj;
|
||||
String::Utf8Value arg1Obj(isolate, args[1]->ToString(context).ToLocalChecked());
|
||||
char *arg1 = *arg1Obj;
|
||||
|
||||
// Call exported Go function, which returns a C string
|
||||
char *c = EncodeFunctionCall(arg0, arg1);
|
||||
|
||||
Local<String> ret = String::NewFromUtf8(isolate, c).ToLocalChecked();
|
||||
args.GetReturnValue().Set(ret);
|
||||
delete c;
|
||||
|
||||
}
|
||||
|
||||
void _DecodeParameters(const FunctionCallbackInfo<Value>& args) {
|
||||
Isolate* isolate = args.GetIsolate();
|
||||
Local<Context> context = isolate->GetCurrentContext();
|
||||
|
||||
if (args.Length() != 1) {
|
||||
// Throw an Error that is passed back to JavaScript
|
||||
isolate->ThrowException(Exception::TypeError(
|
||||
String::NewFromUtf8Literal(isolate, "Wrong number of arguments for DecodeParameters")));
|
||||
return;
|
||||
}
|
||||
|
||||
// Check the argument types
|
||||
|
||||
if (!args[0]->IsString()) {
|
||||
isolate->ThrowException(Exception::TypeError(
|
||||
String::NewFromUtf8Literal(isolate, "Wrong argument type for 'decodeParamJSON'")));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
String::Utf8Value arg0Obj(isolate, args[0]->ToString(context).ToLocalChecked());
|
||||
char *arg0 = *arg0Obj;
|
||||
|
||||
// Call exported Go function, which returns a C string
|
||||
char *c = DecodeParameters(arg0);
|
||||
|
||||
Local<String> ret = String::NewFromUtf8(isolate, c).ToLocalChecked();
|
||||
args.GetReturnValue().Set(ret);
|
||||
delete c;
|
||||
|
||||
}
|
||||
|
||||
void _HexToNumber(const FunctionCallbackInfo<Value>& args) {
|
||||
Isolate* isolate = args.GetIsolate();
|
||||
Local<Context> context = isolate->GetCurrentContext();
|
||||
|
||||
if (args.Length() != 1) {
|
||||
// Throw an Error that is passed back to JavaScript
|
||||
isolate->ThrowException(Exception::TypeError(
|
||||
String::NewFromUtf8Literal(isolate, "Wrong number of arguments for HexToNumber")));
|
||||
return;
|
||||
}
|
||||
|
||||
// Check the argument types
|
||||
|
||||
if (!args[0]->IsString()) {
|
||||
isolate->ThrowException(Exception::TypeError(
|
||||
String::NewFromUtf8Literal(isolate, "Wrong argument type for 'hex'")));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
String::Utf8Value arg0Obj(isolate, args[0]->ToString(context).ToLocalChecked());
|
||||
char *arg0 = *arg0Obj;
|
||||
|
||||
// Call exported Go function, which returns a C string
|
||||
char *c = HexToNumber(arg0);
|
||||
|
||||
Local<String> ret = String::NewFromUtf8(isolate, c).ToLocalChecked();
|
||||
args.GetReturnValue().Set(ret);
|
||||
delete c;
|
||||
|
||||
}
|
||||
|
||||
void _NumberToHex(const FunctionCallbackInfo<Value>& args) {
|
||||
Isolate* isolate = args.GetIsolate();
|
||||
Local<Context> context = isolate->GetCurrentContext();
|
||||
|
||||
if (args.Length() != 1) {
|
||||
// Throw an Error that is passed back to JavaScript
|
||||
isolate->ThrowException(Exception::TypeError(
|
||||
String::NewFromUtf8Literal(isolate, "Wrong number of arguments for NumberToHex")));
|
||||
return;
|
||||
}
|
||||
|
||||
// Check the argument types
|
||||
|
||||
if (!args[0]->IsString()) {
|
||||
isolate->ThrowException(Exception::TypeError(
|
||||
String::NewFromUtf8Literal(isolate, "Wrong argument type for 'numString'")));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
String::Utf8Value arg0Obj(isolate, args[0]->ToString(context).ToLocalChecked());
|
||||
char *arg0 = *arg0Obj;
|
||||
|
||||
// Call exported Go function, which returns a C string
|
||||
char *c = NumberToHex(arg0);
|
||||
|
||||
Local<String> ret = String::NewFromUtf8(isolate, c).ToLocalChecked();
|
||||
args.GetReturnValue().Set(ret);
|
||||
delete c;
|
||||
|
||||
}
|
||||
|
||||
void _Logout(const FunctionCallbackInfo<Value>& args) {
|
||||
Isolate* isolate = args.GetIsolate();
|
||||
|
||||
@@ -1583,6 +1759,11 @@ void init(Local<Object> exports) {
|
||||
NODE_SET_METHOD(exports, "initKeystore", _InitKeystore);
|
||||
NODE_SET_METHOD(exports, "stopCPUProfiling", _StopCPUProfiling);
|
||||
NODE_SET_METHOD(exports, "identicon", _Identicon);
|
||||
NODE_SET_METHOD(exports, "encodeTransfer", _EncodeTransfer);
|
||||
NODE_SET_METHOD(exports, "encodeFunctionCall", _EncodeFunctionCall);
|
||||
NODE_SET_METHOD(exports, "decodeParameters", _DecodeParameters);
|
||||
NODE_SET_METHOD(exports, "hexToNumber", _HexToNumber);
|
||||
NODE_SET_METHOD(exports, "numberToHex", _NumberToHex);
|
||||
NODE_SET_METHOD(exports, "logout", _Logout);
|
||||
NODE_SET_METHOD(exports, "hashMessage", _HashMessage);
|
||||
NODE_SET_METHOD(exports, "resetChainData", _ResetChainData);
|
||||
|
||||
@@ -20,14 +20,10 @@ And use `sudo sysctl --system` to load these new settings.
|
||||
|
||||
### Multi-User Installation
|
||||
|
||||
The other reason why this error could appear are limits fo `nix-daemon` service:
|
||||
https://github.com/NixOS/nix/issues/6007
|
||||
This has been fixed in Nix `2.9.0`:
|
||||
|
||||
Since Systemd services ignore system-wide limits you will have to add the following line:
|
||||
```
|
||||
LimitNOFILE=4096:1048576
|
||||
```
|
||||
To the `/etc/systemd/system/nix-daemon.service` service definition.
|
||||
* https://github.com/NixOS/nix/issues/6007
|
||||
* https://github.com/NixOS/nix/pull/6553
|
||||
|
||||
## Cache Downloads Timing Out
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ androidenv.composeAndroidPackages {
|
||||
toolsVersion = "26.1.1";
|
||||
platformToolsVersion = "33.0.1";
|
||||
buildToolsVersions = [ "31.0.0" ];
|
||||
platformVersions = [ "30" ];
|
||||
platformVersions = [ "31" ];
|
||||
cmakeVersions = [ "3.18.1" ];
|
||||
ndkVersion = "22.1.7171670";
|
||||
includeNDK = true;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{ mkShell, openjdk, androidPkgs }:
|
||||
|
||||
mkShell {
|
||||
name = "android-env-shell";
|
||||
name = "android-sdk-shell";
|
||||
shellHook = ''
|
||||
export JAVA_HOME="${openjdk}"
|
||||
|
||||
|
||||
@@ -6,9 +6,9 @@ GIT_ROOT=$(cd "${BASH_SOURCE%/*}" && git rev-parse --show-toplevel)
|
||||
source "${GIT_ROOT}/nix/scripts/lib.sh"
|
||||
source "${GIT_ROOT}/scripts/colors.sh"
|
||||
|
||||
NIX_VERSION="2.8.0"
|
||||
NIX_VERSION="2.11.1"
|
||||
NIX_INSTALL_URL="https://nixos.org/releases/nix/nix-${NIX_VERSION}/install"
|
||||
NIX_INSTALL_SHA256="f43bfedfca9151479462d8bc11f238615a2d52f19b14894d8e2b59980e75ef72"
|
||||
NIX_INSTALL_SHA256="4569a01dc5f62056f29f3195673bc3242fc70bf2474927fb5d8549c4d997402d"
|
||||
NIX_INSTALL_PATH="/tmp/nix-install-${NIX_VERSION}"
|
||||
|
||||
install_nix() {
|
||||
|
||||
@@ -56,8 +56,8 @@ let
|
||||
buildInputs = with pkgs; [ openjdk8 apksigner ];
|
||||
};
|
||||
|
||||
# for targets that need 'adb' and other SDK/NDK tools
|
||||
android-env = pkgs.androidShell;
|
||||
# for targets needing 'adb', 'apkanalyzer' and other SDK/NDK tools
|
||||
android-sdk = pkgs.androidShell;
|
||||
|
||||
# helpers for use with target argument
|
||||
ios = targets.mobile.ios.shell;
|
||||
|
||||
@@ -68,7 +68,7 @@
|
||||
"react-native-safe-area-context": "^2.0.0",
|
||||
"react-native-shake": "^3.3.1",
|
||||
"react-native-share": "^7.0.1",
|
||||
"react-native-status-keycard": "git+https://github.com/status-im/react-native-status-keycard.git#refs/tags/v2.5.37",
|
||||
"react-native-status-keycard": "git+https://github.com/status-im/react-native-status-keycard.git#refs/tags/v2.5.38",
|
||||
"react-native-svg": "^9.8.4",
|
||||
"react-native-touch-id": "^4.4.1",
|
||||
"react-native-webview": "git+https://github.com/status-im/react-native-webview.git#refs/tags/v11.16.0-status",
|
||||
@@ -83,7 +83,7 @@
|
||||
"@babel/preset-env": "7.1.0",
|
||||
"@babel/register": "7.0.0",
|
||||
"@mapbox/node-pre-gyp": "^1.0.9",
|
||||
"clj-kondo": "^2020.1.13",
|
||||
"clj-kondo": "^2022.9.8",
|
||||
"jest": "^25.1.0",
|
||||
"nodemon": "^2.0.16",
|
||||
"nyc": "^14.1.1",
|
||||
|
||||
|
After Width: | Height: | Size: 806 B |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 437 B |
|
After Width: | Height: | Size: 622 B |
|
After Width: | Height: | Size: 459 B |
|
After Width: | Height: | Size: 613 B |
|
After Width: | Height: | Size: 2.6 KiB |
|
After Width: | Height: | Size: 2.6 KiB |
|
After Width: | Height: | Size: 888 B |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 1.0 KiB |
|
After Width: | Height: | Size: 1.5 KiB |
|
After Width: | Height: | Size: 415 B |
|
After Width: | Height: | Size: 594 B |
|
After Width: | Height: | Size: 424 B |
|
After Width: | Height: | Size: 637 B |
|
After Width: | Height: | Size: 464 B |
|
After Width: | Height: | Size: 716 B |
|
After Width: | Height: | Size: 939 B |
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 808 B |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 769 B |
|
After Width: | Height: | Size: 1016 B |
|
After Width: | Height: | Size: 747 B |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 565 B |
|
After Width: | Height: | Size: 812 B |
|
After Width: | Height: | Size: 678 B |
|
After Width: | Height: | Size: 902 B |
|
After Width: | Height: | Size: 1.6 KiB |
|
After Width: | Height: | Size: 1.6 KiB |
|
After Width: | Height: | Size: 514 B |
|
After Width: | Height: | Size: 636 B |
|
After Width: | Height: | Size: 514 B |
|
After Width: | Height: | Size: 636 B |
|
After Width: | Height: | Size: 1010 B |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 1010 B |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 838 B |
|
After Width: | Height: | Size: 1.0 KiB |
|
After Width: | Height: | Size: 340 B |
|
After Width: | Height: | Size: 488 B |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 1.6 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 1.6 KiB |
|
After Width: | Height: | Size: 815 B |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 995 B |
|
After Width: | Height: | Size: 1.6 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 672 B |
|
After Width: | Height: | Size: 903 B |
|
After Width: | Height: | Size: 729 B |
|
After Width: | Height: | Size: 1.0 KiB |
|
After Width: | Height: | Size: 547 B |
|
After Width: | Height: | Size: 774 B |
|
Before Width: | Height: | Size: 625 B After Width: | Height: | Size: 913 B |
|
Before Width: | Height: | Size: 904 B After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 501 B |
|
After Width: | Height: | Size: 688 B |
|
After Width: | Height: | Size: 590 B |
|
After Width: | Height: | Size: 807 B |
|
After Width: | Height: | Size: 590 B |
|
After Width: | Height: | Size: 807 B |
|
After Width: | Height: | Size: 720 B |
|
After Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 521 B After Width: | Height: | Size: 888 B |
|
Before Width: | Height: | Size: 677 B After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 580 B |
|
After Width: | Height: | Size: 804 B |
|
After Width: | Height: | Size: 580 B |