- Hotfixes for 0.4.7 for editing nodes
- Better IPv6 address handling in node settings
This commit is contained in:
pokkst 2023-12-02 20:35:33 -06:00
parent c8ed32e5b0
commit c64dbfdfec
No known key found for this signature in database
GPG key ID: EC4FAAA66859FAA4
8 changed files with 18 additions and 13 deletions

View file

@ -9,8 +9,8 @@ android {
applicationId "net.mynero.wallet"
minSdkVersion 21
targetSdkVersion 34
versionCode 40700
versionName "0.4.7 'Fluorine Fermi'"
versionCode 40701
versionName "0.4.7.1 'Fluorine Fermi'"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
externalNativeBuild {
cmake {

View file

@ -91,6 +91,9 @@ public class AddNodeBottomSheetDialog extends BottomSheetDialogFragment {
jsonObject.put("password", pass);
}
if (nodeAddr.contains(":") && !nodeAddr.startsWith("[") && !nodeAddr.endsWith("]"))
nodeAddr = "[" + nodeAddr + "]";
jsonObject.put("host", nodeAddr);
jsonObject.put("rpcPort", Integer.parseInt(portString));
jsonObject.put("network", "mainnet");

View file

@ -35,7 +35,7 @@ import timber.log.Timber;
public class EditNodeBottomSheetDialog extends BottomSheetDialogFragment {
public EditNodeListener listener = null;
public JSONObject nodeJson = null;
public Node node = null;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
@ -54,7 +54,6 @@ public class EditNodeBottomSheetDialog extends BottomSheetDialogFragment {
EditText passwordEditText = view.findViewById(R.id.password_edittext);
ImageButton pastePasswordImageButton = view.findViewById(R.id.paste_password_imagebutton);
Node node = Node.fromJson(nodeJson);
if(node == null) return;
addressEditText.setText(node.getHost());
portEditText.setText(""+node.getRpcPort());
@ -87,7 +86,7 @@ public class EditNodeBottomSheetDialog extends BottomSheetDialogFragment {
addPasteListener(view, passwordEditText, R.id.paste_password_imagebutton);
deleteNodeButton.setOnClickListener(view1 -> {
listener.onNodeDeleted(Node.fromJson(nodeJson));
listener.onNodeDeleted(node);
dismiss();
});
doneEditingButton.setOnClickListener(view1 -> {
@ -114,12 +113,15 @@ public class EditNodeBottomSheetDialog extends BottomSheetDialogFragment {
jsonObject.put("password", pass);
}
if (nodeAddr.contains(":") && !nodeAddr.startsWith("[") && !nodeAddr.endsWith("]"))
nodeAddr = "[" + nodeAddr + "]";
jsonObject.put("host", nodeAddr);
jsonObject.put("rpcPort", Integer.parseInt(portString));
jsonObject.put("network", "mainnet");
jsonObject.put("name", nodeName);
listener.onNodeEdited(Node.fromJson(nodeJson), Node.fromJson(jsonObject));
listener.onNodeEdited(node, Node.fromJson(jsonObject));
dismiss();
} catch (JSONException e) {
throw new RuntimeException(e);

View file

@ -114,7 +114,7 @@ public class NodeSelectionBottomSheetDialog extends BottomSheetDialogFragment im
@Override
public boolean onSelectEditNode(Node node) {
if (listener != null) {
listener.onClickedEditNode(node.toJson());
listener.onClickedEditNode(node);
}
dismiss();
return true;
@ -122,7 +122,7 @@ public class NodeSelectionBottomSheetDialog extends BottomSheetDialogFragment im
public interface NodeSelectionDialogListener {
void onNodeSelected();
void onClickedEditNode(JSONObject nodeJson);
void onClickedEditNode(Node node);
void onClickedAddNode();
}
}

View file

@ -285,7 +285,7 @@ public class OnboardingFragment extends Fragment implements NodeSelectionBottomS
}
@Override
public void onClickedEditNode(JSONObject nodeJson) { }
public void onClickedEditNode(Node node) { }
@Override
public void onClickedAddNode() {

View file

@ -248,10 +248,10 @@ public class SettingsFragment extends Fragment implements PasswordBottomSheetDia
}
@Override
public void onClickedEditNode(JSONObject nodeJson) {
public void onClickedEditNode(Node node) {
EditNodeBottomSheetDialog editNodeDialog = new EditNodeBottomSheetDialog();
editNodeDialog.listener = this;
editNodeDialog.nodeJson = nodeJson;
editNodeDialog.node = node;
editNodeDialog.show(getActivity().getSupportFragmentManager(), "edit_node_dialog");
}

View file

@ -63,7 +63,7 @@
android:background="@drawable/edittext_bg"
android:hint="@string/node_address_hint"
android:inputType="text"
android:digits="-QWERTYUIOPASDFGHJKLZXCVBNMqwertyuiopasdfghjklzxcvbnm1234567890.:"
android:digits="QWERTYUIOPASDFGHJKLZXCVBNMqwertyuiopasdfghjklzxcvbnm1234567890.:-[]"
app:layout_constraintBottom_toTopOf="@id/username_edittext"
app:layout_constraintEnd_toStartOf="@id/node_port_edittext"
app:layout_constraintStart_toStartOf="parent" />

View file

@ -63,7 +63,7 @@
android:background="@drawable/edittext_bg"
android:hint="@string/node_address_hint"
android:inputType="text"
android:digits="-QWERTYUIOPASDFGHJKLZXCVBNMqwertyuiopasdfghjklzxcvbnm1234567890.:"
android:digits="QWERTYUIOPASDFGHJKLZXCVBNMqwertyuiopasdfghjklzxcvbnm1234567890.:-[]"
app:layout_constraintBottom_toTopOf="@id/username_edittext"
app:layout_constraintEnd_toStartOf="@id/node_port_edittext"
app:layout_constraintStart_toStartOf="parent" />