Skip to content

Commit

Permalink
javascriptinterface-userpass
Browse files Browse the repository at this point in the history
  • Loading branch information
banditAmit committed Oct 3, 2023
1 parent d386411 commit 6a7d0f5
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/src/main/java/com/BugBazaar/controller/UserAuthSave.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ public static void savepasscode(int passcode) {
editor.apply();
}



public static String getSavedUsername() {
return sharedPreferences.getString(KEY_USERNAME, "");
}
Expand Down
10 changes: 10 additions & 0 deletions app/src/main/java/com/BugBazaar/ui/CreatePasscode.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

import androidx.appcompat.app.AppCompatActivity;

import com.BugBazaar.Models.User;
import com.BugBazaar.R;
import com.BugBazaar.controller.UserAuthSave;

Expand Down Expand Up @@ -71,13 +72,22 @@ public void onClick(View view) {

UserAuthSave.savepasscode(Integer.parseInt(enteredPasscode));
Toast.makeText(CreatePasscode.this, " New Passcode created!", Toast.LENGTH_SHORT).show();
CreateSessiontoken(UserAuthSave.getSavedUsername(),UserAuthSave.getpasscode(),UserAuthSave.getpasscode());

startActivity(new Intent(getApplicationContext(),NavigationDrawer_Dashboard.class));



}
});
}

private void CreateSessiontoken(String savedUsername, String getpasscode, String getpasscode1) {



}

//Numpad click handling
private View.OnClickListener numpadClickListener = new View.OnClickListener() {
@Override
Expand Down
13 changes: 13 additions & 0 deletions app/src/main/java/com/BugBazaar/ui/TermsAndConditionsActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import android.webkit.WebViewClient;

import com.BugBazaar.R;
import com.BugBazaar.controller.UserAuthSave;
import com.BugBazaar.utils.AppConstants;

import android.widget.TextView;
Expand Down Expand Up @@ -100,5 +101,17 @@ public String gettoken(){
return String.valueOf(UUID.randomUUID());
}

@android.webkit.JavascriptInterface
public String getusername(){

return UserAuthSave.getSavedUsername();
}

@android.webkit.JavascriptInterface
public String getpassword(){

return UserAuthSave.getSavedPassword();
}

}
}

0 comments on commit 6a7d0f5

Please sign in to comment.