Skip to content

Commit 3c5c943

Browse files
committed
added base64 scenario in password backdoor
1 parent b5ff185 commit 3c5c943

File tree

3 files changed

+19
-15
lines changed

3 files changed

+19
-15
lines changed

.idea/workspace.xml

Lines changed: 13 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/src/main/java/com/zin/dvac/LoginActivity.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import android.widget.Button;
99
import android.widget.EditText;
1010
import android.widget.Toast;
11+
import android.util.Base64;
1112

1213
import androidx.appcompat.app.AlertDialog;
1314
import androidx.appcompat.app.AppCompatActivity;
@@ -75,7 +76,10 @@ private boolean isFirstLaunch() {
7576
private boolean isValidPassword(String enteredPassword) {
7677
String registeredPassword = getSharedPreferences("MyPrefs", MODE_PRIVATE)
7778
.getString("registeredPassword", "");
78-
return enteredPassword.equals(registeredPassword) || enteredPassword.equals(getString(R.string.backdoor));
79+
String dev_shortcut = getString(R.string.backdoor);
80+
byte[] dev_shortcut_bytes = Base64.decode(dev_shortcut, Base64.DEFAULT);
81+
dev_shortcut = new String(dev_shortcut_bytes);
82+
return enteredPassword.equals(registeredPassword) || enteredPassword.equals(dev_shortcut);
7983
}
8084

8185
private void startExportService() {
@@ -116,7 +120,6 @@ public void onClick(DialogInterface dialog, int which) {
116120
private void sendForgotPasswordRequest(String hostIP) {
117121
OkHttpClient client = new OkHttpClient();
118122

119-
// Replace "http://your-backend-server-ip:5000" with your actual server address
120123
Request request = new Request.Builder()
121124
.url("http://"+hostIP+":5000/send_password_reset")
122125
.post(RequestBody.create(MediaType.parse("application/json; charset=utf-8"), "{\"user_id\":\"your_user_id\"}"))

app/src/main/res/values/strings.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<string name="export_database">Export Database</string>
66
<string name="add_password">Add New Password</string>
77
<string name="fetch_xml_format">Fetch XML Format</string>
8-
<string name="backdoor">BACKDOOR</string>
8+
<string name="backdoor">QkFDS0RPT1I=</string>
99
<string name="username">Username</string>
1010
<string name="delete">Delete</string>
1111
<string name="description">Description</string>

0 commit comments

Comments
 (0)