[jira] [Commented] (CB-13684) Not be able to sign apk with 6.4.0 and 7.0.0 without specifying passwords in build.json

2018-04-22 Thread Rodrigo (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-13684?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16447431#comment-16447431
 ] 

Rodrigo commented on CB-13684:
--

I'm facing the same issue when doing "cordova build --release"

Here is my build.json file:

 
{code:java}
{
"android": {
"release": {
"keystore": "my-release-key.keystore",
"storePassword": "",
"alias": "alias_name",
"password": "",
"keystoreType": ""
}
}
}
{code}
some enviroment info:

 
{code:java}
@ionic/cli-utils : 1.19.0
ionic (Ionic CLI) : 3.19.0

global packages:

cordova (Cordova CLI) : 8.0.0 

local packages:

Cordova Platforms : android 7.1.0
Ionic Framework : unknown

System:

Android SDK Tools : 26.1.1
Node : v7.0.0
npm : 5.6.0 
OS : Linux 4.13

{code}
and the error it self:

 
{code:java}
Parallel execution with configuration on demand is an incubating feature.
publishNonDefault is deprecated and has no effect anymore. All variants are now 
published.
Configuration 'compile' in project ':app' is deprecated. Use 'implementation' 
instead.
The Task.leftShift(Closure) method has been deprecated and is scheduled to be 
removed in Gradle 5.0. Please use Task.doLast(Action) instead.
at 
build_f2pg7yypviczce27famopi55d.run(/home/unknown/git/APP/platforms/android/app/build.gradle:145)

FAILURE: Build failed with an exception.

* Where:
Script '/home/unknown/git/APP/platforms/android/CordovaLib/cordova.gradle' 
line: 147

* What went wrong:
Failed to create component for 'dialog' reason: java.awt.HeadlessException
> java.awt.HeadlessException (no error message)

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug 
option to get more log output.

* Get more help at https://help.gradle.org

BUILD FAILED in 0s
(node:25541) UnhandledPromiseRejectionWarning: Unhandled promise rejection 
(rejection id: 1): Error: /home/unknown/git/APP/platforms/android/gradlew: 
Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.

* Where:
Script '/home/unknown/git/APP/platforms/android/CordovaLib/cordova.gradle' 
line: 147

* What went wrong:
Failed to create component for 'dialog' reason: java.awt.HeadlessException
> java.awt.HeadlessException (no error message)

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug 
option to get more log output.

* Get more help at https://help.gradle.org

BUILD FAILED in 0s
{code}
before I upgraded to android 7.1.0 it used to prompt me to input the passwords 
and carry on.
I placed the passwords on "storePassword" and "keystoreType" and worked 
fine. but I don't want them there so please fix this. Thanks

> Not be able to sign apk with 6.4.0 and 7.0.0 without specifying passwords in 
> build.json
> ---
>
> Key: CB-13684
> URL: https://issues.apache.org/jira/browse/CB-13684
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: cordova-android
>Reporter: Kevin Lot
>Assignee: Joe Bowser
>Priority: Major
>
> Since 6.4.0, sign APK without specify passwords in config file does not work.
> Cause gradle 4.1.0 has this issue [#2826] - Use SwingBuilder in customize 
> task on Android studio throw java.awt.HeadlessException. 
> ([link|https://github.com/gradle/gradle/issues/2826]).
> If you don't specify passwords in config file to sign your APK, compilation 
> launches a window with SwingBuilder to prompt passwords.
> {code:java}
> def doPromptForPassword(msg) {
> if (System.console() == null) {
> def ret = null
> new SwingBuilder().edt {
> dialog(modal: true, title: 'Enter password', alwaysOnTop: true, 
> resizable: false, locationRelativeTo: null, pack: true, show: true) {
> vbox {
> label(text: msg)
> def input = passwordField()
> button(defaultButton: true, text: 'OK', actionPerformed: {
> ret = input.password;
> dispose();
> })
> }
> }
> }
> if (!ret) {
> throw new GradleException('User canceled build')
> }
> return new String(ret)
> } else {
> return System.console().readPassword('\n' + msg);
> }
> }
> {code}
> On Linux Mint 18.3 and MacOs High sierra, even in terminal, System.console() 
> return null and compilation crashes due to gradle issue.
> Thanks for help.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Updated] (CB-14048) Inappbrowser allowedSchemes doesn't check empty string

2018-04-22 Thread Reed Richards (JIRA)

 [ 
https://issues.apache.org/jira/browse/CB-14048?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Reed Richards updated CB-14048:
---
Description: 
The new AllowSchemes introduced with inappbrowser@3.0.0 doesn't check if  
_AllowSchemes_ contains  empty string after having being loaded, respectively 
only if _null_, which could lead to error in case a custom scheme is use but 
not set as white listed schema 

What I mean is that, if no _preference_ would be set in _config.xml_ but a 
custom scheme would be used (my case) then the variable _allowSchemes_ won't be 
_null_ but will contains an _empty string_

 

In InAppBrowser.java

 
{code:java}
else if (!url.startsWith("http:") && !url.startsWith("https:") && 
url.matches("^[a-z]*://.*?$")) {
if (allowedSchemes == null) {
String allowed = preferences.getString("AllowedSchemes", "");
allowedSchemes = allowed.split(",");
}
if (allowedSchemes != null) { // <--- If  preference AllowedSchemes is 
not specified, variable allowedSchemes not gonna be null but an array 
containing an empty string
   for (String scheme : allowedSchemes) { 
   if (url.startsWith(scheme)) { 
  if (url.startsWith(scheme)) { // <-- which leads to the 
problem "urlidontwanttowhilelist://".startsWith("") == true{code}
  

I would like to improve this check for example like following

 
{code:java}
if (url.startsWith(scheme) && !"".equals(scheme)) {

{code}
 

 Thx in advance for the improvement

 

  was:
The new AllowSchemes introduced with inappbrowser@3.0.0 doesn't check if  
_AllowSchemes_ is empty after having being loaded, respectively only if _null_, 
which could lead to error in case a custom scheme is use but not set as white 
listed schema 

What I mean is that, if no _preference_ would be set in _config.xml_ but a 
custom scheme would be used (my case) then the variable _allowSchemes_ won't be 
_null_ but an _empty string_

 

In InAppBrowser.java

 
{code:java}
else if (!url.startsWith("http:") && !url.startsWith("https:") && 
url.matches("^[a-z]*://.*?$")) {
if (allowedSchemes == null) {
String allowed = preferences.getString("AllowedSchemes", "");
allowedSchemes = allowed.split(",");
}
if (allowedSchemes != null) { // <--- If  preference AllowedSchemes is 
not specified, variable allowedSchemes gonna be empty ("") not null
   for (String scheme : allowedSchemes) { 
   if (url.startsWith(scheme)) { 
  if (url.startsWith(scheme)) { // <-- which leads to the 
problem "urlidontwanttowhilelist://".startsWith("") == true{code}
  

I would like to improve this check for example like following

 
{code:java}
if (url.startsWith(scheme) && !"".equals(scheme)) {

{code}
 

 Thx in advance for the improvement

 


> Inappbrowser allowedSchemes doesn't check empty string
> --
>
> Key: CB-14048
> URL: https://issues.apache.org/jira/browse/CB-14048
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: cordova-plugin-inappbrowser
>Reporter: Reed Richards
>Priority: Minor
>
> The new AllowSchemes introduced with inappbrowser@3.0.0 doesn't check if  
> _AllowSchemes_ contains  empty string after having being loaded, respectively 
> only if _null_, which could lead to error in case a custom scheme is use but 
> not set as white listed schema 
> What I mean is that, if no _preference_ would be set in _config.xml_ but a 
> custom scheme would be used (my case) then the variable _allowSchemes_ won't 
> be _null_ but will contains an _empty string_
>  
> In InAppBrowser.java
>  
> {code:java}
> else if (!url.startsWith("http:") && !url.startsWith("https:") && 
> url.matches("^[a-z]*://.*?$")) {
> if (allowedSchemes == null) {
> String allowed = preferences.getString("AllowedSchemes", "");
> allowedSchemes = allowed.split(",");
> }
> if (allowedSchemes != null) { // <--- If  preference AllowedSchemes 
> is not specified, variable allowedSchemes not gonna be null but an array 
> containing an empty string
>for (String scheme : allowedSchemes) { 
>if (url.startsWith(scheme)) { 
>   if (url.startsWith(scheme)) { // <-- which leads to the 
> problem "urlidontwanttowhilelist://".startsWith("") == true{code}
>   
> I would like to improve this check for example like following
>  
> {code:java}
> if (url.startsWith(scheme) && !"".equals(scheme)) {
> {code}
>  
>  Thx in advance for the improvement
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Updated] (CB-14048) Inappbrowser allowedSchemes doesn't check empty string

2018-04-22 Thread Reed Richards (JIRA)

 [ 
https://issues.apache.org/jira/browse/CB-14048?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Reed Richards updated CB-14048:
---
Description: 
The new AllowSchemes introduced with inappbrowser@3.0.0 doesn't check if  
_AllowSchemes_ is empty after having being loaded, respectively only if _null_, 
which could lead to error in case a custom scheme is use but not set as white 
listed schema 

What I mean is that, if no _preference_ would be set in _config.xml_ but a 
custom scheme would be used (my case) then the variable _allowSchemes_ won't be 
_null_ but an _empty string_

 

In InAppBrowser.java

 
{code:java}
else if (!url.startsWith("http:") && !url.startsWith("https:") && 
url.matches("^[a-z]*://.*?$")) {
if (allowedSchemes == null) {
String allowed = preferences.getString("AllowedSchemes", "");
allowedSchemes = allowed.split(",");
}
if (allowedSchemes != null) { // <--- If  preference AllowedSchemes is 
not specified, variable allowedSchemes gonna be empty ("") not null
   for (String scheme : allowedSchemes) { 
   if (url.startsWith(scheme)) { 
  if (url.startsWith(scheme)) { // <-- which leads to the 
problem "urlidontwanttowhilelist://".startsWith("") == true{code}
  

I would like to improve this check for example like following

 
{code:java}
if (url.startsWith(scheme) && !"".equals(scheme)) {

{code}
 

 Thx in advance for the improvement

 

  was:
The new AllowSchemes introduced with inappbrowser@3.0.0 doesn't check if  
_AllowSchemes_ is empty after having being loaded, respectively only if _null_, 
which could lead to error in case a custom scheme is use but not set as white 
listed schema 

What I mean is that, if no _preference_ would be set in _config.xml_ but a 
custom scheme would be used (my case) then the variable _allowSchemes_ won't be 
_null_ but an _empty string_

 

In InAppBrowser.java

 
{code:java}
else if (!url.startsWith("http:") && !url.startsWith("https:") && 
url.matches("^[a-z]*://.*?$")) {
if (allowedSchemes == null) {
String allowed = preferences.getString("AllowedSchemes", "");
allowedSchemes = allowed.split(",");
}
if (allowedSchemes != null) { // <--- If  preference AllowedSchemes is 
not specified, variable allowedSchemes gonna be empty ("") not null
   for (String scheme : allowedSchemes) { 
   if (url.startsWith(scheme)) { // <-- which leads to the problem 
"urlidontwanttowhilelist://".startsWith("") == true{code}
  

I would like to improve this check for example like following

 
{code:java}
if (allowedSchemes != null && !"".equals(allowedSchemes)) {

{code}
 

 Thx in advance for the improvement

 


> Inappbrowser allowedSchemes doesn't check empty string
> --
>
> Key: CB-14048
> URL: https://issues.apache.org/jira/browse/CB-14048
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: cordova-plugin-inappbrowser
>Reporter: Reed Richards
>Priority: Minor
>
> The new AllowSchemes introduced with inappbrowser@3.0.0 doesn't check if  
> _AllowSchemes_ is empty after having being loaded, respectively only if 
> _null_, which could lead to error in case a custom scheme is use but not set 
> as white listed schema 
> What I mean is that, if no _preference_ would be set in _config.xml_ but a 
> custom scheme would be used (my case) then the variable _allowSchemes_ won't 
> be _null_ but an _empty string_
>  
> In InAppBrowser.java
>  
> {code:java}
> else if (!url.startsWith("http:") && !url.startsWith("https:") && 
> url.matches("^[a-z]*://.*?$")) {
> if (allowedSchemes == null) {
> String allowed = preferences.getString("AllowedSchemes", "");
> allowedSchemes = allowed.split(",");
> }
> if (allowedSchemes != null) { // <--- If  preference AllowedSchemes 
> is not specified, variable allowedSchemes gonna be empty ("") not null
>for (String scheme : allowedSchemes) { 
>if (url.startsWith(scheme)) { 
>   if (url.startsWith(scheme)) { // <-- which leads to the 
> problem "urlidontwanttowhilelist://".startsWith("") == true{code}
>   
> I would like to improve this check for example like following
>  
> {code:java}
> if (url.startsWith(scheme) && !"".equals(scheme)) {
> {code}
>  
>  Thx in advance for the improvement
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Updated] (CB-14048) Inappbrowser allowedSchemes doesn't check empty string

2018-04-22 Thread Reed Richards (JIRA)

 [ 
https://issues.apache.org/jira/browse/CB-14048?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Reed Richards updated CB-14048:
---
Priority: Minor  (was: Major)

> Inappbrowser allowedSchemes doesn't check empty string
> --
>
> Key: CB-14048
> URL: https://issues.apache.org/jira/browse/CB-14048
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: cordova-plugin-inappbrowser
>Reporter: Reed Richards
>Priority: Minor
>
> The new AllowSchemes introduced with inappbrowser@3.0.0 doesn't check if  
> _AllowSchemes_ is empty after having being loaded, respectively only if 
> _null_, which could lead to error in case a custom scheme is use but not set 
> as white listed schema 
> What I mean is that, if no _preference_ would be set in _config.xml_ but a 
> custom scheme would be used (my case) then the variable _allowSchemes_ won't 
> be _null_ but an _empty string_
>  
> In InAppBrowser.java
>  
> {code:java}
> else if (!url.startsWith("http:") && !url.startsWith("https:") && 
> url.matches("^[a-z]*://.*?$")) {
> if (allowedSchemes == null) {
> String allowed = preferences.getString("AllowedSchemes", "");
> allowedSchemes = allowed.split(",");
> }
> if (allowedSchemes != null) { // <--- If  preference AllowedSchemes 
> is not specified, variable allowedSchemes gonna be empty ("") not null
>for (String scheme : allowedSchemes) { 
>if (url.startsWith(scheme)) { // <-- which leads to the 
> problem "urlidontwanttowhilelist://".startsWith("") == true{code}
>   
> I would like to improve this check for example like following
>  
> {code:java}
> if (allowedSchemes != null && !"".equals(allowedSchemes)) {
> {code}
>  
>  Thx in advance for the improvement
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Commented] (CB-14047) Enhancement: Replacing Repeated String literals with final variables

2018-04-22 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-14047?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16447319#comment-16447319
 ] 

ASF GitHub Bot commented on CB-14047:
-

macdonst commented on issue #319: CB-14047: (android) CameraLauncher: Replacing 
Repeated String literals with final variables
URL: 
https://github.com/apache/cordova-plugin-camera/pull/319#issuecomment-383402464
 
 
   Thanks @hazems 


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Enhancement: Replacing Repeated String literals with final variables
> 
>
> Key: CB-14047
> URL: https://issues.apache.org/jira/browse/CB-14047
> Project: Apache Cordova
>  Issue Type: Improvement
>  Components: cordova-plugin-camera
>Affects Versions: cordova-android-7.0.0
>Reporter: Hazem Saleh
>Priority: Minor
>
> Replacing Repeated String literals with final variables.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Commented] (CB-14047) Enhancement: Replacing Repeated String literals with final variables

2018-04-22 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-14047?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16447317#comment-16447317
 ] 

ASF GitHub Bot commented on CB-14047:
-

macdonst closed pull request #319: CB-14047: (android) CameraLauncher: 
Replacing Repeated String literals with final variables
URL: https://github.com/apache/cordova-plugin-camera/pull/319
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/src/android/CameraLauncher.java b/src/android/CameraLauncher.java
index fbe8470e..03210828 100644
--- a/src/android/CameraLauncher.java
+++ b/src/android/CameraLauncher.java
@@ -87,6 +87,10 @@ Licensed to the Apache Software Foundation (ASF) under one
 
 private static final int JPEG = 0;  // Take a picture of 
type JPEG
 private static final int PNG = 1;   // Take a picture of 
type PNG
+private static final String JPEG_EXTENSION = ".jpg";
+private static final String PNG_EXTENSION = ".png";
+private static final String PNG_MIME_TYPE = "image/png";
+private static final String JPEG_MIME_TYPE = "image/jpeg";
 private static final String GET_PICTURE = "Get Picture";
 private static final String GET_VIDEO = "Get Video";
 private static final String GET_All = "Get All";
@@ -100,6 +104,8 @@ Licensed to the Apache Software Foundation (ASF) under one
 //Where did this come from?
 private static final int CROP_CAMERA = 100;
 
+private static final String TIME_FORMAT = "MMdd_HHmmss";
+
 private int mQuality;   // Compression quality hint 
(0-100: 0=low quality & high compression, 100=compress of max quality)
 private int targetWidth;// desired width of the image
 private int targetHeight;   // desired height of the image
@@ -341,9 +347,9 @@ private File createCaptureFile(int encodingType, String 
fileName) {
 }
 
 if (encodingType == JPEG) {
-fileName = fileName + ".jpg";
+fileName = fileName + JPEG_EXTENSION;
 } else if (encodingType == PNG) {
-fileName = fileName + ".png";
+fileName = fileName + PNG_EXTENSION;
 } else {
 throw new IllegalArgumentException("Invalid Encoding Type: " + 
encodingType);
 }
@@ -599,8 +605,8 @@ else if (destType == FILE_URI || destType == NATIVE_URI) {
 }
 
 private String getPicturesPath() {
-String timeStamp = new SimpleDateFormat("MMdd_HHmmss").format(new 
Date());
-String imageFileName = "IMG_" + timeStamp + (this.encodingType == JPEG 
? ".jpg" : ".png");
+String timeStamp = new SimpleDateFormat(TIME_FORMAT).format(new 
Date());
+String imageFileName = "IMG_" + timeStamp + (this.encodingType == JPEG 
? JPEG_EXTENSION : PNG_EXTENSION);
 File storageDir = Environment.getExternalStoragePublicDirectory(
 Environment.DIRECTORY_PICTURES);
 storageDir.mkdirs();
@@ -621,8 +627,8 @@ private void refreshGallery(Uri contentUri) {
  * @return String String value of mime type or empty string if mime type 
is not supported
  */
 private String getMimetypeForFormat(int outputFormat) {
-if (outputFormat == PNG) return "image/png";
-if (outputFormat == JPEG) return "image/jpeg";
+if (outputFormat == PNG) return PNG_MIME_TYPE;
+if (outputFormat == JPEG) return JPEG_MIME_TYPE;
 return "";
 }
 
@@ -636,7 +642,7 @@ private String outputModifiedBitmap(Bitmap bitmap, Uri uri) 
throws IOException {
 realPath.substring(realPath.lastIndexOf('/') + 1) :
 "modified." + (this.encodingType == JPEG ? "jpg" : "png");
 
-String timeStamp = new SimpleDateFormat("MMdd_HHmmss").format(new 
Date());
+String timeStamp = new SimpleDateFormat(TIME_FORMAT).format(new 
Date());
 //String fileName = "IMG_" + timeStamp + (this.encodingType == JPEG ? 
".jpg" : ".png");
 String modifiedPath = getTempDirectoryPath() + "/" + fileName;
 
@@ -704,7 +710,7 @@ private void processResultFromGallery(int destType, Intent 
intent) {
 this.callbackContext.success(uriString);
 } else {
 // If we don't have a valid image so quit.
-if (!("image/jpeg".equalsIgnoreCase(mimeType) || 
"image/png".equalsIgnoreCase(mimeType))) {
+if (!(JPEG_MIME_TYPE.equalsIgnoreCase(mimeType) || 
PNG_MIME_TYPE.equalsIgnoreCase(mimeType))) {
 LOG.d(LOG_TAG, "I either have a null image path or 
bitmap");
 this.failPicture("Unable to retrieve path to picture!");
 return;
@@ -912,7 +918,7 @@ private 

[jira] [Commented] (CB-14047) Enhancement: Replacing Repeated String literals with final variables

2018-04-22 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-14047?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16447318#comment-16447318
 ] 

ASF subversion and git services commented on CB-14047:
--

Commit 5ec121bf981374973833061ab466ce41573ab6e7 in cordova-plugin-camera's 
branch refs/heads/master from [~hazems]
[ https://gitbox.apache.org/repos/asf?p=cordova-plugin-camera.git;h=5ec121b ]

CB-14047: (android) CameraLauncher: Replacing Repeated String literals with 
final variables (#319)



> Enhancement: Replacing Repeated String literals with final variables
> 
>
> Key: CB-14047
> URL: https://issues.apache.org/jira/browse/CB-14047
> Project: Apache Cordova
>  Issue Type: Improvement
>  Components: cordova-plugin-camera
>Affects Versions: cordova-android-7.0.0
>Reporter: Hazem Saleh
>Priority: Minor
>
> Replacing Repeated String literals with final variables.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Updated] (CB-14048) Inappbrowser allowedSchemes doesn't check empty string

2018-04-22 Thread Reed Richards (JIRA)

 [ 
https://issues.apache.org/jira/browse/CB-14048?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Reed Richards updated CB-14048:
---
Description: 
The new AllowSchemes introduced with inappbrowser@3.0.0 doesn't check if  
_AllowSchemes_ is empty after having being loaded, respectively only if _null_, 
which could lead to error in case a custom scheme is use but not set as white 
listed schema 

What I mean is that, if no _preference_ would be set in _config.xml_ but a 
custom scheme would be used (my case) then the variable _allowSchemes_ won't be 
_null_ but an _empty string_

 

In InAppBrowser.java

 
{code:java}
else if (!url.startsWith("http:") && !url.startsWith("https:") && 
url.matches("^[a-z]*://.*?$")) {
if (allowedSchemes == null) {
String allowed = preferences.getString("AllowedSchemes", "");
allowedSchemes = allowed.split(",");
}
if (allowedSchemes != null) { // <--- If  preference AllowedSchemes is 
not specified, variable allowedSchemes gonna be empty ("") not null
   for (String scheme : allowedSchemes) { 
   if (url.startsWith(scheme)) { // <-- which leads to the problem 
"urlidontwanttowhilelist://".startsWith("") == true{code}
  

I would like to improve this check for example like following

 
{code:java}
if (allowedSchemes != null && !"".equals(allowedSchemes)) {

{code}
 

 Thx in advance for the improvement

 

  was:
The new AllowSchemes introduced with inappbrowser@3.0.0 doesn't check if  
_AllowSchemes_ is empty after having being loaded, respectively only if _null_, 
which could lead to error in case a custom scheme is use but not set as white 
listed schema 

What I mean is that, if no _preference_ would be set in _config.xml_ but a 
custom scheme would be used (my case) then the variable _allowSchemes_ won't be 
_null_ but an _empty string_

 

In InAppBrowser.java

 
{code:java}
else if (!url.startsWith("http:") && !url.startsWith("https:") && 
url.matches("^[a-z]*://.*?$")) {
if (allowedSchemes == null) {
String allowed = preferences.getString("AllowedSchemes", "");
allowedSchemes = allowed.split(",");
}
if (allowedSchemes != null) { // <--- If  preference AllowedSchemes is 
not specified, variable allowedSchemes gonna be empty ("") not null {code}
 

 

I would like to improve this check for example like following

 
{code:java}
if (allowedSchemes != null && !"".equals(allowedSchemes)) {

{code}
 

 Thx in advance for the improvement

 


> Inappbrowser allowedSchemes doesn't check empty string
> --
>
> Key: CB-14048
> URL: https://issues.apache.org/jira/browse/CB-14048
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: cordova-plugin-inappbrowser
>Reporter: Reed Richards
>Priority: Major
>
> The new AllowSchemes introduced with inappbrowser@3.0.0 doesn't check if  
> _AllowSchemes_ is empty after having being loaded, respectively only if 
> _null_, which could lead to error in case a custom scheme is use but not set 
> as white listed schema 
> What I mean is that, if no _preference_ would be set in _config.xml_ but a 
> custom scheme would be used (my case) then the variable _allowSchemes_ won't 
> be _null_ but an _empty string_
>  
> In InAppBrowser.java
>  
> {code:java}
> else if (!url.startsWith("http:") && !url.startsWith("https:") && 
> url.matches("^[a-z]*://.*?$")) {
> if (allowedSchemes == null) {
> String allowed = preferences.getString("AllowedSchemes", "");
> allowedSchemes = allowed.split(",");
> }
> if (allowedSchemes != null) { // <--- If  preference AllowedSchemes 
> is not specified, variable allowedSchemes gonna be empty ("") not null
>for (String scheme : allowedSchemes) { 
>if (url.startsWith(scheme)) { // <-- which leads to the 
> problem "urlidontwanttowhilelist://".startsWith("") == true{code}
>   
> I would like to improve this check for example like following
>  
> {code:java}
> if (allowedSchemes != null && !"".equals(allowedSchemes)) {
> {code}
>  
>  Thx in advance for the improvement
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Updated] (CB-14048) Inappbrowser allowedSchemes doesn't check empty string

2018-04-22 Thread Reed Richards (JIRA)

 [ 
https://issues.apache.org/jira/browse/CB-14048?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Reed Richards updated CB-14048:
---
Description: 
The new AllowSchemes introduced with inappbrowser@3.0.0 doesn't check if  
_AllowSchemes_ is empty after having being loaded, respectively only if _null_, 
which could lead to error in case a custom scheme is use but not set as white 
listed schema 

What I mean is that, if no _preference_ would be set in _config.xml_ but a 
custom scheme would be used (my case) then the variable _allowSchemes_ won't be 
_null_ but an _empty string_

 

In InAppBrowser.java

 
{code:java}
else if (!url.startsWith("http:") && !url.startsWith("https:") && 
url.matches("^[a-z]*://.*?$")) {
if (allowedSchemes == null) {
String allowed = preferences.getString("AllowedSchemes", "");
allowedSchemes = allowed.split(",");
}
if (allowedSchemes != null) { // <--- If  preference AllowedSchemes is 
not specified, variable allowedSchemes gonna be empty ("") not null {code}
 

 

I would like to improve this check for example like following

 
{code:java}
if (allowedSchemes != null && !"".equals(allowedSchemes)) {

{code}
 

 Thx in advance for the improvement

 

  was:
The new AllowSchemes introduced with inappbrowser@3.0.0 doesn't check if  
_AllowSchemes_ is empty after having being loaded, respectively only if _null_, 
which could lead to error in case a custom scheme is use but not set as white 
listed schema 

What I mean is that, if no _preference_ would be set in _config.xml_ but a 
custom scheme would be used (my case) then the variable _allowSchemes_ won't be 
_null_ but an _empty string_

 

In InAppBrowser.java

 
{code:java}
else if (!url.startsWith("http:") && !url.startsWith("https:") && 
url.matches("^[a-z]*://.*?$")) {
if (allowedSchemes == null) {
String allowed = preferences.getString("AllowedSchemes", "");
allowedSchemes = allowed.split(",");
}
if (allowedSchemes != null) { // <--- If  AllowedSchemes is not 
specified, allowedSchemes gonna be empty ("") not null {code}
 

 

I would like to improve this check for example like following

 
{code:java}
if (allowedSchemes != null && !"".equals(allowedSchemes)) {

{code}
 

 Thx in advance for the improvement

 


> Inappbrowser allowedSchemes doesn't check empty string
> --
>
> Key: CB-14048
> URL: https://issues.apache.org/jira/browse/CB-14048
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: cordova-plugin-inappbrowser
>Reporter: Reed Richards
>Priority: Major
>
> The new AllowSchemes introduced with inappbrowser@3.0.0 doesn't check if  
> _AllowSchemes_ is empty after having being loaded, respectively only if 
> _null_, which could lead to error in case a custom scheme is use but not set 
> as white listed schema 
> What I mean is that, if no _preference_ would be set in _config.xml_ but a 
> custom scheme would be used (my case) then the variable _allowSchemes_ won't 
> be _null_ but an _empty string_
>  
> In InAppBrowser.java
>  
> {code:java}
> else if (!url.startsWith("http:") && !url.startsWith("https:") && 
> url.matches("^[a-z]*://.*?$")) {
> if (allowedSchemes == null) {
> String allowed = preferences.getString("AllowedSchemes", "");
> allowedSchemes = allowed.split(",");
> }
> if (allowedSchemes != null) { // <--- If  preference AllowedSchemes 
> is not specified, variable allowedSchemes gonna be empty ("") not null {code}
>  
>  
> I would like to improve this check for example like following
>  
> {code:java}
> if (allowedSchemes != null && !"".equals(allowedSchemes)) {
> {code}
>  
>  Thx in advance for the improvement
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Updated] (CB-14048) Inappbrowser allowedSchemes doesn't check empty string

2018-04-22 Thread Reed Richards (JIRA)

 [ 
https://issues.apache.org/jira/browse/CB-14048?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Reed Richards updated CB-14048:
---
Description: 
The new AllowSchemes introduced with inappbrowser@3.0.0 doesn't check if  
_AllowSchemes_ is empty after having being loaded, respectively only if _null_, 
which could lead to error in case a custom scheme is use but not set as white 
listed schema 

What I mean is that, if no _preference_ would be set in _config.xml_ but a 
custom scheme would be used (my case) then the variable _allowSchemes_ won't be 
_null_ but an _empty string_

 

In InAppBrowser.java

 
{code:java}
else if (!url.startsWith("http:") && !url.startsWith("https:") && 
url.matches("^[a-z]*://.*?$")) {
if (allowedSchemes == null) {
String allowed = preferences.getString("AllowedSchemes", "");
allowedSchemes = allowed.split(",");
}
if (allowedSchemes != null) { // <--- If  AllowedSchemes is not 
specified, allowedSchemes gonna be empty ("") not null {code}
 

 

I would like to improve this check for example like following

 
{code:java}
if (allowedSchemes != null && !"".equals(allowedSchemes)) {

{code}
 

 Thx in advance for the improvement

 

  was:
The new AllowSchemes introduced with inappbrowser@3.0.0 doesn't check if  
AllowSchemes is empty after having being loaded, respectively only if null, 
which could lead to error in case a custom scheme is use but not set as white 
listed schema (which is my case)

 

What I mean is that, if no preference would be set in config.xml but a custom 
scheme would be used (my case) then the variable allowSchemes won't be null but 
an empty string

 

In InAppBrowser.java

    else if (!url.startsWith("http:") && !url.startsWith("https:") && 
url.matches("^[a-z]*://.*?$")) {
    if (allowedSchemes == null) {
        String allowed = preferences.getString("AllowedSchemes", "");
        allowedSchemes = allowed.split(",");
    }
   if (allowedSchemes != null) { // <--- If  AllowedSchemes is not 
specified,  allowedSchemes gonna be empty "" not null

 

I would like to improve this check for example like following

 

    if (allowedSchemes != null && !"".equals(allowedSchemes)) {

 

 

 


> Inappbrowser allowedSchemes doesn't check empty string
> --
>
> Key: CB-14048
> URL: https://issues.apache.org/jira/browse/CB-14048
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: cordova-plugin-inappbrowser
>Reporter: Reed Richards
>Priority: Major
>
> The new AllowSchemes introduced with inappbrowser@3.0.0 doesn't check if  
> _AllowSchemes_ is empty after having being loaded, respectively only if 
> _null_, which could lead to error in case a custom scheme is use but not set 
> as white listed schema 
> What I mean is that, if no _preference_ would be set in _config.xml_ but a 
> custom scheme would be used (my case) then the variable _allowSchemes_ won't 
> be _null_ but an _empty string_
>  
> In InAppBrowser.java
>  
> {code:java}
> else if (!url.startsWith("http:") && !url.startsWith("https:") && 
> url.matches("^[a-z]*://.*?$")) {
> if (allowedSchemes == null) {
> String allowed = preferences.getString("AllowedSchemes", "");
> allowedSchemes = allowed.split(",");
> }
> if (allowedSchemes != null) { // <--- If  AllowedSchemes is not 
> specified, allowedSchemes gonna be empty ("") not null {code}
>  
>  
> I would like to improve this check for example like following
>  
> {code:java}
> if (allowedSchemes != null && !"".equals(allowedSchemes)) {
> {code}
>  
>  Thx in advance for the improvement
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Created] (CB-14048) Inappbrowser allowedSchemes doesn't check empty string

2018-04-22 Thread Reed Richards (JIRA)
Reed Richards created CB-14048:
--

 Summary: Inappbrowser allowedSchemes doesn't check empty string
 Key: CB-14048
 URL: https://issues.apache.org/jira/browse/CB-14048
 Project: Apache Cordova
  Issue Type: Bug
  Components: cordova-plugin-inappbrowser
Reporter: Reed Richards


The new AllowSchemes introduced with inappbrowser@3.0.0 doesn't check if  
AllowSchemes is empty after having being loaded, respectively only if null, 
which could lead to error in case a custom scheme is use but not set as white 
listed schema (which is my case)

 

What I mean is that, if no preference would be set in config.xml but a custom 
scheme would be used (my case) then the variable allowSchemes won't be null but 
an empty string

 

In InAppBrowser.java

    else if (!url.startsWith("http:") && !url.startsWith("https:") && 
url.matches("^[a-z]*://.*?$")) {
    if (allowedSchemes == null) {
        String allowed = preferences.getString("AllowedSchemes", "");
        allowedSchemes = allowed.split(",");
    }
   if (allowedSchemes != null) { // <--- If  AllowedSchemes is not 
specified,  allowedSchemes gonna be empty "" not null

 

I would like to improve this check for example like following

 

    if (allowedSchemes != null && !"".equals(allowedSchemes)) {

 

 

 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Commented] (CB-12941) Update typings to latest DefinitelyTyped revision

2018-04-22 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-12941?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16447289#comment-16447289
 ] 

ASF GitHub Bot commented on CB-12941:
-

timbru31 commented on issue #223: CB-12941: update typings
URL: 
https://github.com/apache/cordova-plugin-inappbrowser/pull/223#issuecomment-383396719
 
 
   I've had to re-open this PR as #267, since I've had deleted the fork in the 
meantime.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Update typings to latest DefinitelyTyped revision
> -
>
> Key: CB-12941
> URL: https://issues.apache.org/jira/browse/CB-12941
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: cordova-plugin-inappbrowser
>Reporter: Tim Brust
>Priority: Major
>  Labels: inappbrowser, plugins, typescript, typings
>
> Update the typings in the cordova-plugin-inappbrowser to match the current 
> revision published via DefinitelyTyped.
> This fixes e.g. this issue: https://stackoverflow.com/q/42095516/1902598
> DefinitelyTyped PR: 
> https://github.com/DefinitelyTyped/DefinitelyTyped/pull/17192



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Commented] (CB-12941) Update typings to latest DefinitelyTyped revision

2018-04-22 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-12941?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16447288#comment-16447288
 ] 

ASF GitHub Bot commented on CB-12941:
-

timbru31 opened a new pull request #267: CB-12941: update typings
URL: https://github.com/apache/cordova-plugin-inappbrowser/pull/267
 
 
   ### Platforms affected
   n/a - development via TypeScript
   
   ### What does this PR do?
   Updates the typings to match the latest published version on 
DefinitelyTyped.  
   See https://github.com/DefinitelyTyped/DefinitelyTyped/pull/17192 and 
https://stackoverflow.com/q/42095516/1902598
   
   ### What testing has been done on this change?
   Project compiles again ;)
   
   ### Checklist
   - [x] [Reported an issue](http://cordova.apache.org/contribute/issues.html) 
in the JIRA database
   - [x] Commit message follows the format: "CB-3232: (android) Fix bug with 
resolving file paths", where CB- is the JIRA ID & "android" is the platform 
affected.
   - n/a: Added automated test coverage as appropriate for this change.
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Update typings to latest DefinitelyTyped revision
> -
>
> Key: CB-12941
> URL: https://issues.apache.org/jira/browse/CB-12941
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: cordova-plugin-inappbrowser
>Reporter: Tim Brust
>Priority: Major
>  Labels: inappbrowser, plugins, typescript, typings
>
> Update the typings in the cordova-plugin-inappbrowser to match the current 
> revision published via DefinitelyTyped.
> This fixes e.g. this issue: https://stackoverflow.com/q/42095516/1902598
> DefinitelyTyped PR: 
> https://github.com/DefinitelyTyped/DefinitelyTyped/pull/17192



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Commented] (CB-12941) Update typings to latest DefinitelyTyped revision

2018-04-22 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-12941?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16447290#comment-16447290
 ] 

ASF GitHub Bot commented on CB-12941:
-

timbru31 closed pull request #223: CB-12941: update typings
URL: https://github.com/apache/cordova-plugin-inappbrowser/pull/223
 
 
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Update typings to latest DefinitelyTyped revision
> -
>
> Key: CB-12941
> URL: https://issues.apache.org/jira/browse/CB-12941
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: cordova-plugin-inappbrowser
>Reporter: Tim Brust
>Priority: Major
>  Labels: inappbrowser, plugins, typescript, typings
>
> Update the typings in the cordova-plugin-inappbrowser to match the current 
> revision published via DefinitelyTyped.
> This fixes e.g. this issue: https://stackoverflow.com/q/42095516/1902598
> DefinitelyTyped PR: 
> https://github.com/DefinitelyTyped/DefinitelyTyped/pull/17192



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Commented] (CB-12941) Update typings to latest DefinitelyTyped revision

2018-04-22 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-12941?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16447259#comment-16447259
 ] 

ASF GitHub Bot commented on CB-12941:
-

timbru31 commented on issue #223: CB-12941: update typings
URL: 
https://github.com/apache/cordova-plugin-inappbrowser/pull/223#issuecomment-383388326
 
 
   @nicolashenry Sure! Will do it in the next days :)


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Update typings to latest DefinitelyTyped revision
> -
>
> Key: CB-12941
> URL: https://issues.apache.org/jira/browse/CB-12941
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: cordova-plugin-inappbrowser
>Reporter: Tim Brust
>Priority: Major
>  Labels: inappbrowser, plugins, typescript, typings
>
> Update the typings in the cordova-plugin-inappbrowser to match the current 
> revision published via DefinitelyTyped.
> This fixes e.g. this issue: https://stackoverflow.com/q/42095516/1902598
> DefinitelyTyped PR: 
> https://github.com/DefinitelyTyped/DefinitelyTyped/pull/17192



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org