Skip to content
This repository has been archived by the owner on Oct 28, 2023. It is now read-only.

Commit

Permalink
Escape $ within the regex (see #3)
Browse files Browse the repository at this point in the history
  • Loading branch information
HaarigerHarald committed Apr 29, 2016
1 parent 039d520 commit ce3733c
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -399,15 +399,17 @@ private boolean decipherSignature(final SparseArray<String> encSignatures) throw
if (LOGGING)
Log.d(LOG_TAG, "Decipher Functname: " + decipherFunctionName);

Pattern patMainVariable = Pattern.compile("(var |,)" + decipherFunctionName + "(=function\\((.{1,3})\\)\\{)");
Pattern patMainVariable = Pattern.compile("(var |,)" + decipherFunctionName.replace("$", "\\$") +
"(=function\\((.{1,3})\\)\\{)");

String mainDecipherFunct;

mat = patMainVariable.matcher(javascriptFile);
if (mat.find()) {
mainDecipherFunct = "var " + decipherFunctionName + mat.group(2);
} else {
Pattern patMainFunction = Pattern.compile("(function |,)" + decipherFunctionName + "(\\((.{1,3})\\)\\{)");
Pattern patMainFunction = Pattern.compile("(function |,)" + decipherFunctionName.replace("$", "\\$") +
"(\\((.{1,3})\\)\\{)");
mat = patMainFunction.matcher(javascriptFile);
if (!mat.find())
return false;
Expand Down

0 comments on commit ce3733c

Please sign in to comment.