Skip to content

Commit

Permalink
fix sig null bug
Browse files Browse the repository at this point in the history
  • Loading branch information
tastelessjolt committed Jul 13, 2019
1 parent 93d34e9 commit 792e985
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -134,21 +134,17 @@ public String extractSignatureFunction(String video_id, String player_url, Strin
funcPatterns.add(new Pair<>("\\bc\\s*&&\\s*[a-zA-Z0-9]+\\.set\\([^,]+\\s*,\\s*\\([^)]*\\)\\s*\\(\\s*(?P<sig>[a-zA-Z0-9$]+)\\(", 1));

func_name = findFuncName(funcPatterns, response);
if (func_name == null) {
if (func_name == null || func_name.isEmpty()) {
Log.e("DECSIG", "Couldn't find func name. (New function name detected)");
return null;
}



if (func_name.isEmpty()){
this.func_name = func_name;
Fun fun = jsInterpreter.extractFunction(func_name);
jsInterpreter.setSigFun(fun);
Fun fun = jsInterpreter.extractFunction(func_name);
jsInterpreter.setSigFun(fun);

player_cache.put(playerID, jsInterpreter);
} else {
return null ;
}
player_cache.put(playerID, jsInterpreter);

} catch (Exception e) {
e.printStackTrace();
Expand Down Expand Up @@ -208,8 +204,12 @@ public String decryptSignature(String s, String video_id, String player_url) {

String sig = extractSignatureFunction(video_id, player_url, s);

Log.d(TAG + "enc", s);
Log.d(TAG + "dec", sig);
if (sig == null) {
return null;
}

Log.d(TAG + "enc", "" + s);
Log.d(TAG + "dec", "" + sig);
Log.d(TAG, video_id);
Log.d(TAG, player_url);

Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath 'com.android.tools.build:gradle:3.4.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Sat Aug 25 00:46:48 IST 2018
#Sat Jul 13 11:54:48 IST 2019
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip

0 comments on commit 792e985

Please sign in to comment.