diff --git a/app/src/main/java/net/mynero/wallet/fragment/dialog/NodeSelectionBottomSheetDialog.java b/app/src/main/java/net/mynero/wallet/fragment/dialog/NodeSelectionBottomSheetDialog.java index 4803d87..c8f8f39 100644 --- a/app/src/main/java/net/mynero/wallet/fragment/dialog/NodeSelectionBottomSheetDialog.java +++ b/app/src/main/java/net/mynero/wallet/fragment/dialog/NodeSelectionBottomSheetDialog.java @@ -78,7 +78,7 @@ public class NodeSelectionBottomSheetDialog extends BottomSheetDialogFragment im Node node = Node.fromString(nodeString); if (node != null) { nodes.add(node); - jsonArray.put(i, node.toJson().toString()); + jsonArray.put(i, node.toJson()); } else { jsonArray.remove(i); } diff --git a/app/src/main/java/net/mynero/wallet/fragment/settings/SettingsFragment.java b/app/src/main/java/net/mynero/wallet/fragment/settings/SettingsFragment.java index cfebaf9..376ad44 100644 --- a/app/src/main/java/net/mynero/wallet/fragment/settings/SettingsFragment.java +++ b/app/src/main/java/net/mynero/wallet/fragment/settings/SettingsFragment.java @@ -300,7 +300,7 @@ public class SettingsFragment extends Fragment implements PasswordBottomSheetDia JSONObject nodeJsonObject = jsonArray.getJSONObject(i); Node savedNode = Node.fromJson(nodeJsonObject); if (savedNode.toNodeString().equals(oldNode.toNodeString())) - jsonArray.put(i, newNode.toNodeString()); + jsonArray.put(i, newNode.toJson()); } saveNodesAndReopen(jsonArray); } catch (Exception e) { diff --git a/app/src/main/java/net/mynero/wallet/fragment/settings/SettingsViewModel.java b/app/src/main/java/net/mynero/wallet/fragment/settings/SettingsViewModel.java index 9d1342a..523bcd9 100644 --- a/app/src/main/java/net/mynero/wallet/fragment/settings/SettingsViewModel.java +++ b/app/src/main/java/net/mynero/wallet/fragment/settings/SettingsViewModel.java @@ -6,6 +6,7 @@ import androidx.lifecycle.ViewModel; import net.mynero.wallet.MoneroApplication; import net.mynero.wallet.data.DefaultNodes; +import net.mynero.wallet.data.Node; import net.mynero.wallet.model.WalletManager; import net.mynero.wallet.service.PrefService; import net.mynero.wallet.util.Constants; @@ -18,8 +19,8 @@ public class SettingsViewModel extends ViewModel { public void updateProxy(MoneroApplication application) { application.getExecutor().execute(() -> { boolean usesProxy = PrefService.getInstance().getBoolean(Constants.PREF_USES_TOR, false); - String currentNodeString = PrefService.getInstance().getNode().toNodeString(); - boolean isNodeLocalIp = currentNodeString.startsWith("10.") || currentNodeString.startsWith("192.168.") || currentNodeString.equals("localhost") || currentNodeString.equals("127.0.0.1"); + Node curretNode = PrefService.getInstance().getNode(); + boolean isNodeLocalIp = curretNode.getAddress().startsWith("10.") || curretNode.getAddress().startsWith("192.168.") || curretNode.getAddress().equals("localhost") || curretNode.getAddress().equals("127.0.0.1"); if (!usesProxy || isNodeLocalIp) { WalletManager.getInstance().setProxy("");