2.50/2.51b1 Android apk, http no longer works

Found an issue in SpiderBasic ? Please report it here !
hoerbie
Posts: 100
Joined: Sun Mar 17, 2019 5:51 pm
Location: DE/BY/MUC

2.50/2.51b1 Android apk, http no longer works

Post by hoerbie »

Hi,
trying the new 2.50 Beta 2 on Windows, using JDK 11 from Microsoft or Amazon I can compile now, but the HTTPRequest no longer can load data using unsecured http:// but only with https://
I think I read somewhere about security improvements in Cordova, Java etc.?

With 2.50B2 my Android apps no longer can connect to my in PB written app server, so I hope this can be fixed asap, because now I can't test anything of the app with the new SB version....

Greets, hoerbie
Last edited by hoerbie on Thu Oct 12, 2023 6:23 pm, edited 3 times in total.
Fred
Site Admin
Posts: 1506
Joined: Mon Feb 24, 2014 10:51 am

Re: 2.50B2 Android apk, http no longer works

Post by Fred »

I will investigate this, thanks
hoerbie
Posts: 100
Joined: Sun Mar 17, 2019 5:51 pm
Location: DE/BY/MUC

Re: 2.50 Android apk, http no longer works

Post by hoerbie »

@Fred: Problem not solved in 2.50?
My app still can't communicate with my PB-server using http.
One other app using https to a normal Apache/PHP web server works.
hoerbie
Posts: 100
Joined: Sun Mar 17, 2019 5:51 pm
Location: DE/BY/MUC

Re: 2.50 Android apk, http no longer works

Post by hoerbie »

Hi Fred,

I researched and tried a lot, and maybe the problem is in a change in Cordova, old Cordova versions started SBs code like file:///android_asset/www/index.html, but since cordova-android v10.x.x the way was changed to a new WebViewAssetLoader, and it is started from https://localhost/...
In the browser there are security features, that no http request can be done, when the main request was done with https.

See https://cordova.apache.org/announcement ... 0.1.0.html and https://www.mathew-paul.nz/posts/cordov ... protocols/
Maybe it would help to add the following line to the config.xml

Code: Select all

<preference name="scheme" value="http" />
Until now I didn't had the time to try it myself with changes in the "keep temp dir", because I couldn't get the Cordova build running there from command prompt.

For the future it would be helpful, when the config.xml wasn't hardcoded in the sbcompiler.exe, but as normal file in the compile dir, so it would be changeable by the SB users.
Or maybe you can integrate a "wait" function in the compile dialog, that SB stops before the Cordova build, so that the SB user can change something in the temp dir, and then resume with the create app in SB?

By the way: the above could also be the problem of other bug report viewtopic.php?t=2418
Fred
Site Admin
Posts: 1506
Joined: Mon Feb 24, 2014 10:51 am

Re: 2.50 Android apk, http no longer works

Post by Fred »

Looks like a good find, i will implement it and let you know !
Fred
Site Admin
Posts: 1506
Joined: Mon Feb 24, 2014 10:51 am

Re: [Done] 2.50 Android apk, http no longer works

Post by Fred »

Fixed.
hoerbie
Posts: 100
Joined: Sun Mar 17, 2019 5:51 pm
Location: DE/BY/MUC

Re: 2.50 Android apk, http no longer works

Post by hoerbie »

Sorry Fred, http still doesn't work in my apps.

With 2.51 Beta 1 we are one step further, because now I see in my PB server an "OPTIONS /path/file..." connect from the app, but after this no real GET or POST comes through.
So the CORS preflight now comes through, but maybe the with SB 2.40 working answer of my server

Code: Select all

Access-Control-Allow-Origin: *
Access-Control-Allow-Credentials: true
Access-Control-Allow-Methods: *
Access-Control-Allow-Headers: *
isn't enough secure or specific.

I found some other things that maybe need a change in SB compile, but I will have to sort them out, and will post here after the weekend.
Fred
Site Admin
Posts: 1506
Joined: Mon Feb 24, 2014 10:51 am

Re: 2.50/2.51b1 Android apk, http no longer works

Post by Fred »

Ok, looking forward to it, it seemed to work here on my tests.
Post Reply