File tree Expand file tree Collapse file tree 4 files changed +27
-3
lines changed
Expand file tree Collapse file tree 4 files changed +27
-3
lines changed Original file line number Diff line number Diff line change 1+ ## 5.5.1
2+ ### Bug Fixes/Improvements
3+ + MS-3958: Added Security check to see if it's a valid HTTP URL before loading it.
4+
15## 5.5
26### New Features
37+ MS-3778: Added new API to get Video Orientation for BannerVideo and Video Ads
Original file line number Diff line number Diff line change 11// Project properties
2- version = " 5.5"
2+ version = " 5.5.1 "
33group= ' com.appnexus.opensdk'
44
55// Android build
@@ -9,7 +9,7 @@ android {
99 compileSdkVersion 28
1010 buildToolsVersion ' 29.0.0'
1111 defaultConfig {
12- versionCode 58 // An integer value that represents the version of the code, relative to other versions. Increase for each release.
12+ versionCode 59 // An integer value that represents the version of the code, relative to other versions. Increase for each release.
1313 versionName version
1414 consumerProguardFiles ' proguard-project.txt'
1515 minSdkVersion 9
Original file line number Diff line number Diff line change 3535import android .os .Handler ;
3636import android .util .DisplayMetrics ;
3737import android .util .Pair ;
38+ import android .util .Patterns ;
3839import android .view .Gravity ;
3940import android .view .MotionEvent ;
4041import android .view .View ;
7374import java .io .Reader ;
7475import java .io .StringWriter ;
7576import java .io .Writer ;
77+ import java .net .MalformedURLException ;
78+ import java .net .URISyntaxException ;
79+ import java .net .URL ;
7680import java .util .Date ;
7781import java .util .HashMap ;
7882
@@ -559,6 +563,16 @@ private boolean openNativeIntent(String url) {
559563 }
560564 }
561565
566+ private boolean isValidUrl (String url ) {
567+ try {
568+ new URL (url ).toURI ();
569+ return Patterns .WEB_URL .matcher (url ).matches ();
570+ } catch (MalformedURLException | URISyntaxException e ) {
571+ e .printStackTrace ();
572+ return false ;
573+ }
574+ }
575+
562576 // returns success or failure
563577 private boolean checkForApp (String url ) {
564578 if (url .contains ("://play.google.com" ) || (!url .startsWith ("http" ) && !url .startsWith ("about:blank" ))) {
@@ -605,6 +619,12 @@ void loadURLInCorrectBrowser(String url) {
605619 return ;
606620 }
607621
622+
623+ //If it's an invalid http url return without loading it.
624+ if (!isValidUrl (url )) {
625+ return ;
626+ }
627+
608628 try {
609629
610630 final WebView out ;
Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ public class Settings {
4545 public boolean debug_mode = false ; // This should always be false here.
4646 public String ua = null ;
4747
48- public final String sdkVersion = "5.5" ;
48+ public final String sdkVersion = "5.5.1 " ;
4949
5050 public String mcc ;
5151 public String mnc ;
You can’t perform that action at this time.
0 commit comments