Struggling with logging into a website from an android app? Look no further. In order to successfully submit the POST request with the necessary hashed values, you might need to delve into the website's javascript file. But what if tracing through it doesn't yield the same results as on the native website?
Fear not, for one way to tackle this issue is by downloading their javascript file and executing it within Java.
The challenge lies in running specific methods within their file. Here's a snippet of some basic code that attempts to address this:
public void hashIt(String valueForMethod1, String valueForMethod2){
final ScriptEngineManager sem = new ScriptEngineManager();
ScriptEngine engine = sem.getEngineByName("JavaScript");
try {
engine.eval(new java.io.FileReader("res/raw/theirFile.js"));
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (ScriptException e) {
e.printStackTrace();
}
}
If you have any insights or solutions to share, your input would be greatly appreciated :)
Thank you!