Allow to enabled debug
Optimistic update Signed-off-by: Gheorghe Pinzaru <feross95@gmail.com>
This commit is contained in:
parent
905699b686
commit
0368895edf
|
@ -9,6 +9,7 @@ import android.content.SharedPreferences;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.os.Environment;
|
import android.os.Environment;
|
||||||
|
|
||||||
import android.preference.PreferenceManager;
|
import android.preference.PreferenceManager;
|
||||||
|
|
||||||
import androidx.core.content.FileProvider;
|
import androidx.core.content.FileProvider;
|
||||||
|
@ -16,6 +17,7 @@ import androidx.core.content.FileProvider;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.Window;
|
import android.view.Window;
|
||||||
import android.view.WindowManager;
|
import android.view.WindowManager;
|
||||||
|
import android.webkit.WebView;
|
||||||
import android.webkit.CookieManager;
|
import android.webkit.CookieManager;
|
||||||
import android.webkit.CookieSyncManager;
|
import android.webkit.CookieSyncManager;
|
||||||
import android.webkit.WebStorage;
|
import android.webkit.WebStorage;
|
||||||
|
@ -1050,6 +1052,22 @@ class StatusModule extends ReactContextBaseJavaModule implements LifecycleEventL
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ReactMethod
|
||||||
|
public void toggleWebviewDebug(final boolean val) {
|
||||||
|
Log.d(TAG, "toggleWebviewDebug");
|
||||||
|
final Activity activity = getCurrentActivity();
|
||||||
|
if (activity == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
activity.runOnUiThread(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
WebView.setWebContentsDebuggingEnabled(val);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
@ReactMethod
|
@ReactMethod
|
||||||
public void clearStorageAPIs() {
|
public void clearStorageAPIs() {
|
||||||
Log.d(TAG, "clearStorageAPIs");
|
Log.d(TAG, "clearStorageAPIs");
|
||||||
|
|
|
@ -65,6 +65,11 @@
|
||||||
(fn [on]
|
(fn [on]
|
||||||
(native-module/chaos-mode-update on (constantly nil))))
|
(native-module/chaos-mode-update on (constantly nil))))
|
||||||
|
|
||||||
|
(re-frame/reg-fx
|
||||||
|
::webview-debug-changed
|
||||||
|
(fn [value]
|
||||||
|
(native-module/toggle-webview-debug value)))
|
||||||
|
|
||||||
(re-frame/reg-fx
|
(re-frame/reg-fx
|
||||||
::blank-preview-flag-changed
|
::blank-preview-flag-changed
|
||||||
(fn [flag]
|
(fn [flag]
|
||||||
|
@ -86,6 +91,15 @@
|
||||||
:dev-mode? dev-mode?
|
:dev-mode? dev-mode?
|
||||||
{}))
|
{}))
|
||||||
|
|
||||||
|
(fx/defn switch-webview-debug
|
||||||
|
{:events [:multiaccounts.ui/switch-webview-debug]}
|
||||||
|
[{:keys [db] :as cofx} value]
|
||||||
|
(fx/merge cofx
|
||||||
|
{::webview-debug-changed value}
|
||||||
|
(multiaccounts.update/multiaccount-update
|
||||||
|
:webview-debug (boolean value)
|
||||||
|
{})))
|
||||||
|
|
||||||
(fx/defn switch-chaos-mode
|
(fx/defn switch-chaos-mode
|
||||||
[{:keys [db] :as cofx} chaos-mode?]
|
[{:keys [db] :as cofx} chaos-mode?]
|
||||||
(when (:multiaccount db)
|
(when (:multiaccount db)
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
[status-im.native-module.core :as status]
|
[status-im.native-module.core :as status]
|
||||||
[status-im.transport.core :as transport]
|
[status-im.transport.core :as transport]
|
||||||
[status-im.utils.fx :as fx]
|
[status-im.utils.fx :as fx]
|
||||||
|
[status-im.multiaccounts.core :as multiaccounts]
|
||||||
[status-im.utils.keychain.core :as keychain]
|
[status-im.utils.keychain.core :as keychain]
|
||||||
[status-im.notifications.core :as notifications]))
|
[status-im.notifications.core :as notifications]))
|
||||||
|
|
||||||
|
@ -13,9 +14,10 @@
|
||||||
[{:keys [db] :as cofx} {:keys [auth-method logout?]}]
|
[{:keys [db] :as cofx} {:keys [auth-method logout?]}]
|
||||||
(let [key-uid (get-in db [:multiaccount :key-uid])]
|
(let [key-uid (get-in db [:multiaccount :key-uid])]
|
||||||
(fx/merge cofx
|
(fx/merge cofx
|
||||||
{::logout nil
|
{::logout nil
|
||||||
:keychain/clear-user-password key-uid
|
::multiaccounts/webview-debug-changed false
|
||||||
::init/open-multiaccounts #(re-frame/dispatch [::init/initialize-multiaccounts % {:logout? logout?}])}
|
:keychain/clear-user-password key-uid
|
||||||
|
::init/open-multiaccounts #(re-frame/dispatch [::init/initialize-multiaccounts % {:logout? logout?}])}
|
||||||
(notifications/logout-disable)
|
(notifications/logout-disable)
|
||||||
(keychain/save-auth-method key-uid auth-method)
|
(keychain/save-auth-method key-uid auth-method)
|
||||||
(transport/stop-whisper)
|
(transport/stop-whisper)
|
||||||
|
|
|
@ -308,6 +308,10 @@
|
||||||
(log/debug "[native-module] chaos-mode-update")
|
(log/debug "[native-module] chaos-mode-update")
|
||||||
(.chaosModeUpdate ^js (status) on on-result))
|
(.chaosModeUpdate ^js (status) on on-result))
|
||||||
|
|
||||||
|
(defn toggle-webview-debug [on]
|
||||||
|
(log/debug "[native-module] toggle-webview-debug" on)
|
||||||
|
(.toggleWebviewDebug ^js (status) on))
|
||||||
|
|
||||||
(defn get-nodes-from-contract
|
(defn get-nodes-from-contract
|
||||||
[rpc-endpoint contract-address on-result]
|
[rpc-endpoint contract-address on-result]
|
||||||
(log/debug "[native-module] get-nodes-from-contract")
|
(log/debug "[native-module] get-nodes-from-contract")
|
||||||
|
|
|
@ -11,7 +11,8 @@
|
||||||
(defn- normal-mode-settings-data [{:keys [network-name
|
(defn- normal-mode-settings-data [{:keys [network-name
|
||||||
current-log-level
|
current-log-level
|
||||||
waku-bloom-filter-mode
|
waku-bloom-filter-mode
|
||||||
current-fleet]}]
|
current-fleet
|
||||||
|
webview-debug]}]
|
||||||
[{:size :small
|
[{:size :small
|
||||||
:title (i18n/label :t/network)
|
:title (i18n/label :t/network)
|
||||||
:accessibility-label :network-button
|
:accessibility-label :network-button
|
||||||
|
@ -63,6 +64,15 @@
|
||||||
#(re-frame/dispatch [:navigate-to :notifications-advanced-settings])
|
#(re-frame/dispatch [:navigate-to :notifications-advanced-settings])
|
||||||
:chevron true})
|
:chevron true})
|
||||||
{:size :small
|
{:size :small
|
||||||
|
:title "Webview debug"
|
||||||
|
:accessibility-label :webview-debug-switch
|
||||||
|
:container-margin-bottom 8
|
||||||
|
:on-press
|
||||||
|
#(re-frame/dispatch
|
||||||
|
[:multiaccounts.ui/switch-webview-debug (not webview-debug)])
|
||||||
|
:accessory :switch
|
||||||
|
:active webview-debug}
|
||||||
|
{:size :small
|
||||||
:title (i18n/label :t/waku-bloom-filter-mode)
|
:title (i18n/label :t/waku-bloom-filter-mode)
|
||||||
:accessibility-label :waku-bloom-filter-mode-settings-switch
|
:accessibility-label :waku-bloom-filter-mode-settings-switch
|
||||||
:container-margin-bottom 8
|
:container-margin-bottom 8
|
||||||
|
@ -71,7 +81,7 @@
|
||||||
[:multiaccounts.ui/waku-bloom-filter-mode-switched (not waku-bloom-filter-mode)])
|
[:multiaccounts.ui/waku-bloom-filter-mode-switched (not waku-bloom-filter-mode)])
|
||||||
:accessory :switch
|
:accessory :switch
|
||||||
:active waku-bloom-filter-mode}
|
:active waku-bloom-filter-mode}
|
||||||
#_{:size :small
|
#_{:size :small
|
||||||
:title :t/dev-mode
|
:title :t/dev-mode
|
||||||
:accessibility-label :dev-mode-settings-switch
|
:accessibility-label :dev-mode-settings-switch
|
||||||
:container-margin-bottom 8
|
:container-margin-bottom 8
|
||||||
|
@ -119,7 +129,7 @@
|
||||||
[quo/list-item props]))
|
[quo/list-item props]))
|
||||||
|
|
||||||
(views/defview advanced-settings []
|
(views/defview advanced-settings []
|
||||||
(views/letsubs [{:keys [chaos-mode?]} [:multiaccount]
|
(views/letsubs [{:keys [chaos-mode? webview-debug]} [:multiaccount]
|
||||||
network-name [:network-name]
|
network-name [:network-name]
|
||||||
waku-bloom-filter-mode [:waku/bloom-filter-mode]
|
waku-bloom-filter-mode [:waku/bloom-filter-mode]
|
||||||
current-log-level [:log-level/current-log-level]
|
current-log-level [:log-level/current-log-level]
|
||||||
|
@ -133,6 +143,7 @@
|
||||||
:current-fleet current-fleet
|
:current-fleet current-fleet
|
||||||
:dev-mode? false
|
:dev-mode? false
|
||||||
:waku-bloom-filter-mode waku-bloom-filter-mode
|
:waku-bloom-filter-mode waku-bloom-filter-mode
|
||||||
|
:webview-debug webview-debug
|
||||||
:chaos-mode? chaos-mode?})
|
:chaos-mode? chaos-mode?})
|
||||||
:key-fn (fn [_ i] (str i))
|
:key-fn (fn [_ i] (str i))
|
||||||
:render-fn render-item}]]))
|
:render-fn render-item}]]))
|
||||||
|
|
Loading…
Reference in New Issue