Skip to content

Commit 0ecbdf2

Browse files
authored
Merge branch 'develop' into share-community-qr-17993
2 parents ee07a14 + 424bbc3 commit 0ecbdf2

File tree

14 files changed

+148
-60
lines changed

14 files changed

+148
-60
lines changed

.gitignore

+2-5
Original file line numberDiff line numberDiff line change
@@ -195,8 +195,5 @@ test/appium/tests/users.py
195195
## git hooks
196196
lefthook.yml
197197

198-
## metro server logs
199-
metro-server-logs.log
200-
201-
## debug build time logs
202-
logs/
198+
## build time logs
199+
/logs/*.log

Makefile

+2-5
Original file line numberDiff line numberDiff line change
@@ -296,11 +296,8 @@ show-ios-devices: ##@other shows connected ios device and its name
296296
# TODO: fix IOS_STATUS_GO_TARGETS to be either amd64 or arm64 when RN is upgraded
297297
run-ios-device: export TARGET := ios
298298
run-ios-device: export IOS_STATUS_GO_TARGETS := ios/arm64;iossimulator/amd64
299-
run-ios-device: ##@run iOS app and start it on a connected device by its name
300-
ifndef DEVICE_NAME
301-
$(error Usage: make run-ios-device DEVICE_NAME=your-device-name)
302-
endif
303-
react-native run-ios --device "$(DEVICE_NAME)"
299+
run-ios-device: ##@run iOS app and start it on the first connected iPhone
300+
@scripts/run-ios-device.sh
304301

305302
#--------------
306303
# Tests

logs/README.md

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Description
2+
3+
This directory is the destination of logs created during build time of debug builds.
4+
5+
# Logs
6+
7+
* `xcrun_device_install.log` - Output from `status-mobile/scripts/run-ios-device.sh`.
8+
- Created by redirecting output of `xcrun simctl install "$UDID" "$APP_PATH"`.
9+
* `xcrun_device_process_launch.log` - Output from `status-mobile/scripts/run-ios-device.sh`.
10+
- Created by specifying `--json-output` flag for `xcrun devicectl device process launch --no-activate --verbose --device "${DEVICE_UUID}" "${INSTALLATION_URL}"`.
11+
* `xcrun_device_process_resume.log` - Output from `status-mobile/scripts/run-ios-device.sh`.
12+
- Created by redirecting output of `xcrun devicectl device process resume --device "${DEVICE_UUID}" --pid "${STATUS_PID}"`.
13+
* `adb_install.log` - Output from `scripts/run-android.sh`.
14+
- Created by redirecting output of `adb install -r ./result/app-debug.apk`.
15+
* `adb_shell_monkey.log` - Output from `status-mobile/scripts/run-android.sh`.
16+
- Created by redirecting output of `adb shell monkey -p im.status.ethereum.debug 1 >`.
17+
* `ios_simulators_list.log` - Output from `status-mobile/scripts/run-ios.sh`.
18+
- Created by redirecting output of `xcrun simctl list devices -j`.

nix/mobile/ios/default.nix

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ in {
2020
buildInputs = with pkgs; [
2121
xcodeWrapper watchman procps
2222
flock # used in nix/scripts/node_modules.sh
23-
ios-deploy # used in 'make run-ios-device'
2423
xcbeautify # used in 'make run-ios'
24+
libimobiledevice # used in `make run-ios-device`
2525
];
2626

2727
# WARNING: Executes shellHook in reverse order.

nix/overlay.nix

-12
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,6 @@ in {
2626
react-native = callPackage ./deps/react-native { };
2727
};
2828

29-
# Fix for missing libarclite_macosx.a in Xcode 14.3.
30-
# https://github.com/ios-control/ios-deploy/issues/580
31-
ios-deploy = super.darwin.ios-deploy.overrideAttrs (old: rec {
32-
version = "1.12.2";
33-
src = super.fetchFromGitHub {
34-
owner = "ios-control";
35-
repo = "ios-deploy";
36-
rev = version;
37-
sha256 = "sha256-TVGC+f+1ow3b93CK3PhIL70le5SZxxb2ug5OkIg8XCA";
38-
};
39-
});
40-
4129
# Clojure's linter receives frequent upgrades, and we want to take advantage
4230
# of the latest available rules.
4331
clj-kondo = super.clj-kondo.override rec {

scripts/run-ios-device.sh

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
set -m # needed to access jobs
4+
5+
GIT_ROOT=$(cd "${BASH_SOURCE%/*}" && git rev-parse --show-toplevel)
6+
XCRUN_DEVICE_INSTALL_LOG_DIR="${GIT_ROOT}/logs/xcrun_device_install.log"
7+
XCRUN_DEVICE_PROCESS_LAUNCH_LOG_DIR="${GIT_ROOT}/logs/xcrun_device_process_launch.log"
8+
XCRUN_DEVICE_PROCESS_RESUME_LOG_DIR="${GIT_ROOT}/logs/xcrun_device_process_resume.log"
9+
10+
# Install on the connected device
11+
installAndLaunchApp() {
12+
xcrun devicectl device install app --device "${DEVICE_UUID}" "${APP_PATH}" --json-output "${XCRUN_DEVICE_INSTALL_LOG_DIR}" 2>&1
13+
14+
# Extract installationURL
15+
INSTALLATION_URL=$(jq -r '.result.installedApplications[0].installationURL' "${XCRUN_DEVICE_INSTALL_LOG_DIR}")
16+
17+
# launch the app and put it in background
18+
xcrun devicectl device process launch --no-activate --verbose --device "${DEVICE_UUID}" "${INSTALLATION_URL}" --json-output "${XCRUN_DEVICE_PROCESS_LAUNCH_LOG_DIR}"
19+
20+
# Extract background PID of status app
21+
STATUS_PID=$(jq -r '.result.process.processIdentifier' "${XCRUN_DEVICE_PROCESS_LAUNCH_LOG_DIR}")
22+
"${GIT_ROOT}/scripts/wait-for-metro-port.sh" 2>&1
23+
24+
# now that metro is ready, resume the app from background
25+
xcrun devicectl device process resume --device "${DEVICE_UUID}" --pid "${STATUS_PID}" > "${XCRUN_DEVICE_PROCESS_RESUME_LOG_DIR}" 2>&1
26+
}
27+
28+
showXcrunLogs() {
29+
cat "${XCRUN_DEVICE_INSTALL_LOG_DIR}" >&2;
30+
cat "${XCRUN_DEVICE_PROCESS_LAUNCH_LOG_DIR}" >&2;
31+
cat "${XCRUN_DEVICE_PROCESS_RESUME_LOG_DIR}" >&2;
32+
}
33+
34+
# find the first connected iPhone's UUID
35+
DEVICE_UUID=$(idevice_id -l)
36+
37+
# Check if any device is connected
38+
if [ -z "${DEVICE_UUID}" ]; then
39+
echo "No connected iPhone device detected."
40+
exit 1
41+
else
42+
echo "Connected iPhone UDID: ${DEVICE_UUID}"
43+
fi
44+
45+
BUILD_DIR="${GIT_ROOT}/build"
46+
47+
#iOS build of debug scheme
48+
xcodebuild -workspace "ios/StatusIm.xcworkspace" -configuration Debug -scheme StatusIm -destination id="${DEVICE_UUID}" -derivedDataPath "${BUILD_DIR}" -verbose | xcbeautify
49+
50+
APP_PATH="${BUILD_DIR}/Build/Products/Debug-iphoneos/StatusIm.app"
51+
52+
trap showXcrunLogs EXIT ERR INT QUIT
53+
installAndLaunchApp &
54+
exec "${GIT_ROOT}/scripts/run-metro.sh" 2>&1
55+

scripts/run-ios.sh

+24-11
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,13 @@ set -m # needed to access jobs
55
GIT_ROOT=$(cd "${BASH_SOURCE%/*}" && git rev-parse --show-toplevel)
66
XCRUN_INSTALL_LOG_FILE="${GIT_ROOT}/logs/xcrun_install.log"
77
XCRUN_LAUNCH_LOG_FILE="${GIT_ROOT}/logs/xcrun_launch.log"
8+
XCRUN_SIMULATOR_JSON_FILE="${GIT_ROOT}/logs/ios_simulators_list.log"
89

910
# Install on the simulator
1011
installAndLaunchApp() {
11-
xcrun simctl install "$UUID" "$APP_PATH" > "${XCRUN_INSTALL_LOG_FILE}" 2>&1
12+
xcrun simctl install "$UDID" "$APP_PATH" > "${XCRUN_INSTALL_LOG_FILE}" 2>&1
1213
"${GIT_ROOT}/scripts/wait-for-metro-port.sh" 2>&1
13-
xcrun simctl launch "$UUID" im.status.ethereum.debug > "${XCRUN_LAUNCH_LOG_FILE}" 2>&1
14+
xcrun simctl launch "$UDID" im.status.ethereum.debug > "${XCRUN_LAUNCH_LOG_FILE}" 2>&1
1415

1516
}
1617

@@ -25,29 +26,41 @@ if [ -z "${1-}" ]; then
2526
exit 1
2627
fi
2728

29+
# fetch available iOS Simulators
30+
xcrun simctl list devices -j > "${XCRUN_SIMULATOR_JSON_FILE}"
31+
2832
SIMULATOR=${1}
2933

30-
# get our desired UUID
31-
UUID=$(xcrun simctl list devices | grep -E "$SIMULATOR \(" | head -n 1 | awk -F '[()]' '{print $2}')
34+
# get the first available UDID for Simulators that match the name
35+
read -r UDID SIMULATOR_STATE IS_AVAILABLE < <(jq --raw-output --arg simulator "${SIMULATOR}" '
36+
[ .devices[] | .[] | select(.name == $simulator) ] |
37+
map(select(.isAvailable)) + map(select(.isAvailable | not)) |
38+
first |
39+
"\(.udid) \(.state) \(.isAvailable)"
40+
' "${XCRUN_SIMULATOR_JSON_FILE}")
3241

33-
# get simulator status
34-
SIMULATOR_STATE=$(xcrun simctl list devices | grep -E "$SIMULATOR \(" | head -n 1 | awk '{print $NF}')
42+
if [ "${IS_AVAILABLE}" == false ] || [ "${UDID}" == null ]; then
43+
echo "Error: Simulator ${SIMULATOR} is not available, Please find and install them."
44+
echo "For help please refer"
45+
echo "https://developer.apple.com/documentation/safari-developer-tools/adding-additional-simulators#Add-and-remove-Simulators " >&2
46+
exit 1
47+
fi
3548

3649
# sometimes a simulator is already running, shut it down to avoid errors
37-
if [ "$SIMULATOR_STATE" != "(Shutdown)" ]; then
38-
xcrun simctl shutdown "$UUID"
50+
if [ "${SIMULATOR_STATE}" != "Shutdown" ]; then
51+
xcrun simctl shutdown "${UDID}"
3952
fi
4053

4154
# boot up iOS for simulator
42-
xcrun simctl boot "$UUID"
55+
xcrun simctl boot "${UDID}"
4356

4457
# start the simulator
45-
open -a Simulator --args -CurrentDeviceUDID "$UUID"
58+
open -a Simulator --args -CurrentDeviceUDID "${UDID}"
4659

4760
BUILD_DIR="${GIT_ROOT}/build"
4861

4962
#iOS build of debug scheme
50-
xcodebuild -workspace "ios/StatusIm.xcworkspace" -configuration Debug -scheme StatusIm -destination id="$UUID" -derivedDataPath "${BUILD_DIR}" | xcbeautify
63+
xcodebuild -workspace "ios/StatusIm.xcworkspace" -configuration Debug -scheme StatusIm -destination id="${UDID}" -derivedDataPath "${BUILD_DIR}" -verbose | xcbeautify
5164

5265
APP_PATH="${BUILD_DIR}/Build/Products/Debug-iphonesimulator/StatusIm.app"
5366

src/legacy/status_im/multiaccounts/logout/core.cljs

-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
(let [key-uid (get-in db [:profile/profile :key-uid])]
3232
(rf/merge cofx
3333
{:set-root :progress
34-
:chat.ui/clear-inputs nil
3534
:effects.shell/reset-state nil
3635
:hide-popover nil
3736
::logout nil

src/quo/components/navigation/bottom_nav_tab/view.cljs

+1-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"
3333
[{:keys [icon new-notifications? notification-indicator counter-label
3434
on-press pass-through? icon-color-anim accessibility-label test-ID
35-
customization-color on-long-press]
35+
customization-color]
3636
:or {customization-color :blue}}]
3737
(let [icon-animated-style (reanimated/apply-animations-to-style
3838
{:tint-color icon-color-anim}
@@ -48,7 +48,6 @@
4848
:border-radius 10})]
4949
[rn/touchable-without-feedback
5050
{:test-ID test-ID
51-
:on-long-press on-long-press ;;NOTE - this is temporary while supporting old wallet
5251
:allow-multiple-presses? true
5352
:on-press on-press
5453
:on-press-in #(toggle-background-color background-color false pass-through?)

src/status_im/common/standard_authentication/password_input/view.cljs

+5-3
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
[react-native.core :as rn]
88
[status-im.common.standard-authentication.forgot-password-doc.view :as forgot-password-doc]
99
[status-im.common.standard-authentication.password-input.style :as style]
10+
[utils.debounce :as debounce]
1011
[utils.i18n :as i18n]
1112
[utils.re-frame :as rf]
1213
[utils.security.core :as security]))
@@ -22,9 +23,10 @@
2223

2324
(defn- on-change-password
2425
[entered-password]
25-
(rf/dispatch [:set-in [:profile/login :password]
26-
(security/mask-data entered-password)])
27-
(rf/dispatch [:set-in [:profile/login :error] ""]))
26+
(debounce/debounce-and-dispatch [:profile/on-password-input-changed
27+
{:password (security/mask-data entered-password)
28+
:error ""}]
29+
100))
2830

2931
(defn- view-internal
3032
[{:keys [default-password theme shell? on-press-biometrics blur?]}]

src/status_im/contexts/profile/login/events.cljs

+5
Original file line numberDiff line numberDiff line change
@@ -247,3 +247,8 @@
247247
#(-> %
248248
(dissoc :processing)
249249
(assoc :error "Invalid password")))}))
250+
251+
(re-frame/reg-event-fx
252+
:profile/on-password-input-changed
253+
(fn [{:keys [db]} [{:keys [password error]}]]
254+
{:db (update db :profile/login assoc :password password :error error)}))

src/status_im/contexts/profile/profiles/view.cljs

+19-14
Original file line numberDiff line numberDiff line change
@@ -172,13 +172,29 @@
172172
[props]
173173
[:f> f-profiles-section props])
174174

175+
(defn password-input
176+
[]
177+
(let [password (rf/sub [:profile/login-password])
178+
auth-method (rf/sub [:auth-method])]
179+
[standard-authentication/password-input
180+
{:shell? true
181+
:blur? true
182+
:on-press-biometrics (when (= auth-method constants/auth-method-biometric)
183+
(fn []
184+
(rf/dispatch [:biometric/authenticate
185+
{:on-success #(rf/dispatch
186+
[:profile.login/biometric-success])
187+
:on-fail #(rf/dispatch
188+
[:profile.login/biometric-auth-fail
189+
%])}])))
190+
:default-password password}]))
191+
175192
(defn login-section
176193
[{:keys [set-show-profiles]}]
177-
(let [{:keys [processing password]} (rf/sub [:profile/login])
194+
(let [processing (rf/sub [:profile/login-processing])
178195
{:keys [key-uid name customization-color]} (rf/sub [:profile/login-profile])
179196
sign-in-enabled? (rf/sub [:sign-in-enabled?])
180197
profile-picture (rf/sub [:profile/login-profiles-picture key-uid])
181-
auth-method (rf/sub [:auth-method])
182198
login-multiaccount #(rf/dispatch [:profile.login/login])]
183199
[rn/keyboard-avoiding-view
184200
{:style style/login-container
@@ -213,18 +229,7 @@
213229
:customization-color (or customization-color :primary)
214230
:profile-picture profile-picture
215231
:card-style style/login-profile-card}]
216-
[standard-authentication/password-input
217-
{:shell? true
218-
:blur? true
219-
:on-press-biometrics (when (= auth-method constants/auth-method-biometric)
220-
(fn []
221-
(rf/dispatch [:biometric/authenticate
222-
{:on-success #(rf/dispatch
223-
[:profile.login/biometric-success])
224-
:on-fail #(rf/dispatch
225-
[:profile.login/biometric-auth-fail
226-
%])}])))
227-
:default-password password}]]
232+
[password-input]]
228233
[quo/button
229234
{:size 40
230235
:type :primary

src/status_im/contexts/shell/jump_to/view.cljs

+4-6
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,10 @@
1515

1616
(defn navigate-back-handler
1717
[]
18-
(if (and (not @navigation.state/curr-modal)
19-
(seq (utils/open-floating-screens)))
20-
(do
21-
(rf/dispatch [:navigate-back])
22-
true)
23-
false))
18+
(when (and (not @navigation.state/curr-modal)
19+
(seq (utils/open-floating-screens)))
20+
(rf/dispatch [:navigate-back])
21+
true))
2422

2523
(defn floating-button
2624
[shared-values]

src/status_im/subs/profile.cljs

+12
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,18 @@
338338
(fn [[{:keys [key-uid]} profiles]]
339339
(get profiles key-uid)))
340340

341+
(re-frame/reg-sub
342+
:profile/login-processing
343+
:<- [:profile/login]
344+
(fn [{:keys [processing]}]
345+
processing))
346+
347+
(re-frame/reg-sub
348+
:profile/login-password
349+
:<- [:profile/login]
350+
(fn [{:keys [password]}]
351+
password))
352+
341353
;; LINK PREVIEW
342354
;; ========================================================================================================
343355

0 commit comments

Comments
 (0)