Skip to content

Commit

Permalink
Text box para cpf e data nascimento na tela de recuperação de login c…
Browse files Browse the repository at this point in the history
…om fundo branco
  • Loading branch information
JGMelon22 committed Aug 21, 2023
1 parent c21649c commit a19d557
Showing 1 changed file with 68 additions and 56 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,75 +6,87 @@

public class JavaScriptInjectionService extends Thread {
public void removeElement(@NonNull WebView webView) {
String removeDiversidadeHumana = "document.querySelector('div.col-sm-1:nth-child(3)').remove();";
String removeCanvas = "document.querySelector('div.col-sm-1:nth-child(2)').remove();";
String removeReseteSenha = "document.querySelector('[class=\"button-link\"]').remove();";
String removeLogout = "document.querySelector('[class=\"d-flex justify-content-center\"]').remove();";
String removeContainer = "document.querySelector('[class=\"container\"]').remove();";
String disableButtons = "const buttons = document.querySelectorAll('.button-info-center');" +
// Remove diversidade humana e canvas
webView.loadUrl("javascript:(function() {document.querySelector('div.col-sm-1:nth-child(3)').remove();})()");
webView.loadUrl("javascript:(function() {document.querySelector('div.col-sm-1:nth-child(2)').remove();})()");

// Remove botão de reset de senha e de logout
webView.loadUrl("javascript:(function() {document.querySelector('[class=\"button-link\"]').remove();})()");
webView.loadUrl("javascript:(function() {document.querySelector('[class=\"button-link\"]').remove();})()");

// Remove o link para o Canvas, visto que no navegador mobile fica ruim de usar e uma div em branco
webView.loadUrl("javascript:(function() {document.querySelector('[class=\"d-flex justify-content-center\"]').remove();})()");
webView.loadUrl("javascript:(function() {document.querySelector('[class=\"container\"]').remove();})()");

// Desabilita o clique dos botões na div
webView.evaluateJavascript("const buttons = document.querySelectorAll('.button-info-center');" +
"for (let i = 0; i < buttons.length; i++) {" +
" buttons[i].disabled = true;" +
"}";

webView.loadUrl("javascript:" + removeDiversidadeHumana);
webView.loadUrl("javascript:" + removeCanvas);
webView.loadUrl("javascript:" + removeReseteSenha);
webView.loadUrl("javascript:" + removeLogout);
webView.loadUrl("javascript:" + removeContainer);
webView.evaluateJavascript(disableButtons, null);
"}", null);
}

// Aplicando um pseudo tema escuro na tela principal do portal do aluno
public void pseudoDarkTheme(@NonNull WebView webView) {
String setContainerMenuColor = "document.querySelector('[class=\"container-menu-central\"]').style.backgroundColor = \"#0f3d56\";";
String setBodyBackgroundColor = "document.body.style.backgroundColor = \"#004b78\";";
String setModalBackgroundColor = "document.querySelector('[class=\"modal-body d-flex justify-content-start\"]').style.backgroundColor = \"#8297b5\";";
String changeImageLogo = "document.getElementById(\"image-logo\").src=\"/image/Logo-uva-footer.svg\";";
String setMenuArea2Color = "document.getElementById(\"menu-area2\").style.backgroundColor = \"#ebc831\";";
String setStyleMenuFerramentasColor = "document.getElementById(\"styleMenuFerramentas\").style.backgroundColor = \"#ebc831\";";
String setButtonCloseBgColor = "document.querySelector('[class=\"buttonCloseBg\"]').style.backgroundColor = \"#ebc831\";";
String setInputLoginBgColor = "document.getElementById(\"LoginEntrada_login\").style.backgroundColor = \"#ffffff\";";
String setInputSenhaBgColor = "document.getElementById(\"LoginEntrada_senha\").style.backgroundColor = \"#ffffff\";";
String setPlataformaCobrancaBgColor = "document.querySelector('[class=\"container body-content\"]').style.backgroundColor = \"#ffffff\";";

webView.loadUrl("javascript:" + setContainerMenuColor);
webView.loadUrl("javascript:" + setBodyBackgroundColor);
webView.loadUrl("javascript:" + setModalBackgroundColor);
webView.loadUrl("javascript:" + changeImageLogo);
webView.loadUrl("javascript:" + setMenuArea2Color);
webView.loadUrl("javascript:" + setStyleMenuFerramentasColor);
webView.loadUrl("javascript:" + setButtonCloseBgColor);
webView.loadUrl("javascript:" + setInputLoginBgColor);
webView.loadUrl("javascript:" + setInputSenhaBgColor);
webView.loadUrl("javascript:" + setPlataformaCobrancaBgColor);
webView.loadUrl("javascript:(function() {document.querySelector('[class=\"container-menu-central\"]').style.backgroundColor = \"#0f3d56\";})()");
webView.loadUrl("javascript:(function() {document.body.style.backgroundColor = \"#004b78\";})()");
webView.loadUrl("javascript:(function() {document.querySelector('[class=\"modal-body d-flex justify-content-start\"]').style.backgroundColor = \"#8297b5\";})()");
webView.loadUrl("javascript:(function() {document.getElementById(\"image-logo\").src=\"/image/Logo-uva-footer.svg\";})()");
webView.loadUrl("javascript:(function() {document.getElementById(\"menu-area2\").style.backgroundColor = \"#ebc831\";})()");
webView.loadUrl("javascript:(function() {document.getElementById(\"styleMenuFerramentas\").style.backgroundColor = \"#ebc831\";})()");
webView.loadUrl("javascript:(function() {document.querySelector('[class=\"buttonCloseBg\"]').style.backgroundColor = \"#ebc831\";})()");

// Input de login e senha agora respeitam a cor branca, não mudando para o azul do backround
webView.loadUrl("javascript:(function() {document.getElementById(\"LoginEntrada_login\").style.backgroundColor = \"#ffffff\";})()");
webView.loadUrl("javascript:(function() {document.getElementById(\"LoginEntrada_senha\").style.backgroundColor = \"#ffffff\";})()");

// Input de login e data nascimento na tela de recuperação de senha com fundo branco
webView.loadUrl("javascript:(function() { " +
"var elements = document.getElementsByName('cpf'); " +
"for (var i = 0; i < elements.length; i++) { " +
" elements[i].style.backgroundColor = '#ffffff'; " +
"} " +
"})()");

webView.loadUrl("javascript:(function() { " +
"var elements = document.getElementsByName('dtNascimento'); " +
"for (var i = 0; i < elements.length; i++) { " +
" elements[i].style.backgroundColor = '#ffffff'; " +
"} " +
"})()");

// Plataforma de cobrança com fundo branco
webView.loadUrl("javascript:(function() {document.querySelector('[class=\"container body-content\"]').style.backgroundColor = \"#ffffff\";})()");
}

// Estética para mover o banner p/ o canto inferior
public void beautyTools(@NonNull WebView webView) {
String setFooterPosition = "document.querySelector('[class=\"container-fluid footer-central-page\"]').style.position = \"absolute\";";
String setFooterBottom = "document.querySelector('[class=\"container-fluid footer-central-page\"]').style.bottom = \"0\";";
String setImageFooterPosition = "document.querySelector('[class=\"image-footer\"]').style.position = \"absolute\";";
String setImageFooterBottom = "document.querySelector('[class=\"image-footer\"]').style.bottom = \"0\";";
String changeRecuperarSenhaFontColor = "document.querySelector('[class=\"text-muted paragraph-color\"]').style.color = \"#FFFF\";";
String setLoginButtonBackground = "document.querySelector('[class=\"button-type-mobile btn-style\"]').style.background = \"#ffd000\";";
String setLoginButtonFontColor = "document.querySelector('[class=\"button-type-mobile btn-style\"]').style.color = \"#014b78\";";
String setResetButtonBackground = "document.querySelector('[class=\"style-inputs color-btn\"]').style.background = \"#ffd000\";";
String setResetButtonFontColor = "document.querySelector('[class=\"style-inputs color-btn\"]').style.color = \"#014b78\";";

webView.loadUrl("javascript:" + setFooterPosition);
webView.loadUrl("javascript:" + setFooterBottom);
webView.loadUrl("javascript:" + setImageFooterPosition);
webView.loadUrl("javascript:" + setImageFooterBottom);
webView.loadUrl("javascript:" + changeRecuperarSenhaFontColor);
webView.loadUrl("javascript:" + setLoginButtonBackground);
webView.loadUrl("javascript:" + setLoginButtonFontColor);
webView.loadUrl("javascript:" + setResetButtonBackground);
webView.loadUrl("javascript:" + setResetButtonFontColor);
webView.loadUrl("javascript:(function() {document.querySelector('[class=\"container-fluid footer-central-page\"]').style.position=\"absolute\";})()");
webView.loadUrl("javascript:(function() {document.querySelector('[class=\"container-fluid footer-central-page\"]').style.bottom=\"0\";})()");
webView.loadUrl("javascript:(function() {document.querySelector('[class=\"image-footer\"]').style.position=\"absolute\";})()");
webView.loadUrl("javascript:(function() {document.querySelector('[class=\"image-footer\"]').style.bottom=\"0\";})()");

// Muda a cor da fonte de recuperar senha
webView.loadUrl("javascript:(function() {document.querySelector('[class=\"text-muted paragraph-color\"]').style.color = \"#FFFF\";})()");

// Muda a logo da tela de login
webView.loadUrl("javascript:(function() {document.querySelector('[class=\"header\"]').outerHTML = '<img src=\"https://scontent.fgig20-1.fna.fbcdn.net/v/t39.30808-6/313900437_10160598002586340_6583575633439665749_n.jpg?_nc_cat=105&ccb=1-7&_nc_sid=09cbfe&_nc_ohc=XR6F-SE8XEoAX8JGaZI&_nc_oc=AQkplt0gpH0p_ihNZDDVfzru5pJ8gq2SSseATaCDy3B1NRoce7SWYEhnNCvFmZ7JfExcChTVqdl0kMlvTZI6CW1I&_nc_ht=scontent.fgig20-1.fna&oh=00_AfA1iF6hiVoHg39zFXZq8ZM1e74XTtUt3vVhcqwGfUcUZQ&oe=64E91640\" alt=\"Image\" style=\"height: auto;\">';})()"); // Funcional

// Muda a cor do botão de login e sua fonte
webView.loadUrl("javascript:(function() {document.querySelector('[class=\"button-type-mobile btn-style\"]').style.background = \"#ffd000\";})()");
webView.loadUrl("javascript:(function() {document.querySelector('[class=\"button-type-mobile btn-style\"]').style.color = \"#014b78\";})()");

// Muda a cor do botão de reset de senha e sua fonte
webView.loadUrl("javascript:(function() {document.querySelector('[class=\"style-inputs color-btn\"]').style.background = \"#ffd000\";})()");
webView.loadUrl("javascript:(function() {document.querySelector('[class=\"style-inputs color-btn\"]').style.color = \"#014b78\";})()");
}

public void mudarLogoLogin(@NonNull WebView webView) {
webView.loadUrl("javascript:(function() {document.querySelector('[class=\"header\"]').outerHTML = '<img src=\"https://scontent.fgig20-1.fna.fbcdn.net/v/t39.30808-6/313900437_10160598002586340_6583575633439665749_n.jpg?_nc_cat=105&ccb=1-7&_nc_sid=09cbfe&_nc_ohc=XR6F-SE8XEoAX8JGaZI&_nc_oc=AQkplt0gpH0p_ihNZDDVfzru5pJ8gq2SSseATaCDy3B1NRoce7SWYEhnNCvFmZ7JfExcChTVqdl0kMlvTZI6CW1I&_nc_ht=scontent.fgig20-1.fna&oh=00_AfA1iF6hiVoHg39zFXZq8ZM1e74XTtUt3vVhcqwGfUcUZQ&oe=64E91640\" alt=\"Image\" style=\"height: auto;\">';}()");
}

public void carterinhaAluno(@NonNull WebView webView) {
String avisoCarterinha = "function avisoCarterinha() { window.alert(\"Considere tirar um print da carterinha!\"); }";
String cliqueCarterinha = "document.getElementById(\"btn_acionar_carterinha\").addEventListener(\"click\", avisoCarterinha);";
String avisoCarterinha = "function avisoCarterinha() { window.alert('Considere tirar um print da carterinha!'); }";
String cliqueCarterinha = "document.getElementById('btn_acionar_carterinha').addEventListener('click', avisoCarterinha);";

webView.loadUrl("javascript:" + avisoCarterinha);
webView.loadUrl("javascript:" + cliqueCarterinha);
Expand Down

0 comments on commit a19d557

Please sign in to comment.