Jump to content


  • Content Count

  • Joined

  • Last visited

Everything posted by ertank

  1. Hello, I have my HTTPS proxy for my HTTP REST server. Both running on my development computer. I setup HTTPS proxy following instructions here: https://twigstechtips.blogspot.com/2016/01/nginx-how-to-set-up-ssl-reverse-proxy.html These instructions makes you generate two certificate files. KEY and PEM files. I added that PEM file in my project resources as resource type RCDATA and used identifier "my_ca". I used below link to prepare my security config xml https://stackoverflow.com/questions/56301765/self-signed-certificate-in-android-application-of-rad Using "@raw/my_ca" as in that stackoverflow question is failing with below error (while packaging the app) when I try to debug run the app. network_security_config.xml:6: error: Error: No resource found that matches the given name (at 'src' with value '@raw/my_ca/') So, I prepared my XML file as following: <?xml version="1.0" encoding="utf-8"?> <network-security-config> <domain-config> <domain includeSubdomains="true">yourdomain.com</domain> <trust-anchors> <certificates src="my_ca"/> </trust-anchors> </domain-config> </network-security-config> When I try to access my REST server like I get following error Failed to parse XML configuration from network_security_config On the other hand, I can get results just fine using identical URL and Postman on Windows OS. I simply failed to figure how to add that self signed certificate in my app package and use it. Any help is appreciated. Thanks & Regards, Ertan
  2. ertank

    Deploying certificate with your Android app

    I did add private key certificate as a resource as I tried to explain in my initial post. I did deploy my security config "network_security_config.xml" under "res\xml" in project Deployment. Sorry, forgot to mention that in detail. BTW, I am not trying to deploy my app in Play Store. Just trying to deploy it with my self signed HTTPS certificate.
  3. ertank

    How to extend CE licence?

    I did not do that. This is what I suspect reading e-mails sent from Embarcadero.
  4. ertank

    How to extend CE licence?

    Assuming you are actually using CE version mainly. You are excited about new 10.4 features and wanted to see them at first hand. So, you installed it on your computer for trial. You uninstalled 10.4 from your computer before the end of trial period (or after, or keeping it without using). At that point, I suspect, Embarcadero puts you (your e-mail address and relevant account linked to your CE license) in "not eligible for CE anymore" list. Hence the e-mail messages received. I wonder if that theory is correct for people having problems updating their CE licenses.
  5. Hello, I am using Delphi 10.3.3 and trying to consume a SOAP web service method. Wsdl that I need to use is below: https://dev.gittigidiyor.com:8443/listingapi/ws/IndividualSaleService?wsdl Delphi 10.3.3 successfully imports that wsdl page. Imported unit generates an output XML for "getPagedSales" method as following (included only relevant parts of XML): <?xml version="1.0"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"> <SOAP-ENV:Body> <getPagedSales xmlns="http://sale.individual.ws.listingapi.gg.com"> When same wsdl is imported using SOAP-UI application, generated sample request output starting as following: <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sale="http://sale.individual.ws.listingapi.gg.com"> <soapenv:Header/> <soapenv:Body> <sale:getPagedSales> If you look closely and compare both, the SOAP-UI generated XML, envelope has "sale" in it as well as method name is put after "sale". My problem is that web service is not accepting Delphi request and returning an error as following: <env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'> <env:Header/> <env:Body> <env:Fault xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'> <faultcode>env:Client</faultcode> <faultstring>Endpoint {http://application.anonymous.ws.listingapi.gg.com}ApplicationServicePort does not contain operation meta data for: {http://sale.individual.ws.listingapi.gg.com}getPagedSales</faultstring> </env:Fault> </env:Body> </env:Envelope> My question is: Is it possible to modify wsdl imported unit in a way so that out of the box SOAP adds that "sale" in relevant places of requests not just for getPagedSale mothod, but for all sale service methods? I know it is possible to use THTTPRIO.OnBeforeExecute() and send identical XML to that of SOAP-UI generated (which web service will be accepting). However, I am just trying to avoid that if it is possible. Thanks & Regards, Ertan
  6. I hope @Ugochukwu Mmaduekwe can make some comments about PKCS7 padding here. I have all below repositories and do not have problem with compilation etc. HlpIhash is part of HashLib4Pascal https://github.com/Xor-el/CryptoLib4Pascal https://github.com/Xor-el/HashLib4Pascal https://github.com/Xor-el/SimpleBaseLib4Pascal
  7. Hello, First of all, I am not experienced about technical details of variable initialization and such. I am using Delphi 10.3.3 and targeting Win32 executable. I am running multiple threads in my application. One of the threads is making rest web service calls. Other does SOAP web service calls. Below unit is only used by rest web service thread and that thread only. Rest web service requires me to do logins for every 60 minutes. Problem appears at the second hour. Login requests sent as empty strings. I am sharing only relevant lines (timeout calculations, logging etc are not included below for simplicity): unit MyRestUnit; function Login(const AppKey, SecretKey: string): Boolean; implementation function Login(const AppKey, SecretKey: string): Boolean; var Request: string; Response: string; begin if AppKey.IsEmpty then Exit(False); if SecretKey.IsEmpty then Exit(False); Request := '{"appKey":"' + AppKey + '","secretKey":"' + SecretKey + '"}'; if uUtils.Http.PostIndy(URL, Request, Response) then // Rest of the function code is irrelevant end; Code is just as in above. Request is filled in and HTTP request is made. However, Request variable is filled in for the first time function is used. It is always becoming empty for the remaining calls. My log files says application is actually sending empty request bodies. Rest web service response error also confirms that. No garbage characters just empty. If I use debug run (F9) and check variable value at run time. It holds proper value for first call, second and following calls it is always empty. Same problem exists for Release build and Debug build. Only way I could make it always work is changing above code to something like below Request := EmptyStr; Request := '{"appKey":"' + AppKey + '","secretKey":"' + SecretKey + '"}'; I tried to use different local variable names (more than one) to rule out possible name collision and it still does not work for second calls to function, unless I first make it EmptyStr. It is also interesting that I do not get any compile time hint/warning like "value assigned is not used" or similar for my second example above. I have all hints and warnings turned on in my project. My internet searches did not result in something meaningful to me. My question is: Why first example does not work for the second and following calls? Asking in here because I could not find an explanation at all and I am really curious as to why. Moreover, that is the first time I am facing such a problem. Thanks & Regards, Ertan
  8. While trying to prepare minimal reproduction I realize that there is an "else" exists above some explanatory remark lines and my Request variable assignment comes next. Turned out my mistake of leaving an else that should have been deleted at the first place. if TokenExpireTime <> 0 then begin // some other stuff with begin..end blocks end else // problem source line // some remark // another remark // more remark Request := '{"appKey":"' + AppKey + '","secretKey":"' + SecretKey + '"}'; It turned out that Request is conditionally filled in if no line above. Sorry about all the fuss and thanks to all.
  9. I just installed and tried madExcept. It doesn't report any buffer overflow or underflow (tried both). Though, there are some leaks reported like Mutex Handle, TCriticalSection, TIdThreadSafe. First one is my code in DPR file, last two being in the initialization sections of relevant units. It was interesting to have leak report even FastMM4 is not reporting any. Unfortunately, I failed to find a corruption using madExcept. I think is is harder to identify than I think it is. Thanks.
  10. I do have FastMM4 full debug open and it does not report a leak. I do not know if it also reports for corruptions though. Are there any hints/suggestions to search for such corruptions?
  11. ertank

    AES Encryption - FMX

    Hello, There seems to be a lot of VCL based free solutions. I could not find one for FMX platform. I am looking for a free AES256-CBC FMX compatible solution that I can pass IV and Key values manually. I installed "LockBox VCL and FMX 2.3" from GetIt package manager. It seems to take string value as Key for TLbRijndael component and does everything internally. Any help is appreciated. Thanks & regards, Ertan
  12. You can use MARS with Community Edition. Some examples depend on some FireDAC units which belong to higher edition.
  13. Hello, I have orders and orderdetails tables. There is one method that should be returning several orders when used. I would like to return a json string to such requests as in following example { "orders":[ { "id":1234, "date":"2020-05-29", "details":[ { "item":"1", "amount":3 }, { "item":"5", "amount":2 }, { "item":"116", "amount":1.3 } ] } ] } I know that I can define method to return a TJsonObject and build json piece by piece in method code. However, I would like to avoid that, if possible. I wonder if there is/are some other ways of doing so in MARS. Thanks & regards, Ertan
  14. ertank

    MMX supports Delphi 10.4 Sydney

    It is released, yes. https://www.embarcadero.com/products/rad-studio/whats-new-in-10-4-sydney
  15. Actually, there is a new version released 5.0.1 which also fixes problem of opening tables with lowercase letters.
  16. Even it is not just for REST, you can write your own interface based methods and use mORMot as a REST server. Learning curve might be slower compared to some other options. However, it does run from Delphi 6 to Delphi 10.3.3 and has Linux support using Lazarus+FPC. There is no SOAP support as to my knowledge.
  17. If you have the option to choose REST only then you might really would like to consider MARS Curiosity. Edit: Just checked GitHub and it seems no packages exists for Delphi 2007.
  18. You did not run Delphi. You did not install any kind of plug-in or component. Only thing left is OS itself. Something must have been changed in your system that affects Delphi license. You can try to remember if you did some kind of "restore" or system change (computer name or alike) or hardware change during last week. You can also look for a "cleaning tool" or similar in the system and disable it for a while just for ruling out that possibility.
  19. Actually it is possible. License days start counting down from the day you activate it for the first time. Moreover, if you register and get a free license today it will have 366 days left.
  20. I am using Delphi 10.3.3 Community Edition right now. I did have license failure just once for a Community Edition. It was after I changed computer name of Windows. I do not remember having frequent IDE crashes at all.
  21. ertank

    Android 64bit and 32bit permissions

    Hello, I am using Delphi 10.3.3, targeting Android 64Bit and 32Bit. Attached is a test project I used. If that same project is compiled for Android 32Bit it gets two permission request as can be seen in below pictures However, if same code without changing anything is compiled for Android 64Bit it only asks for a single permission as can be seen in below picture Both bitness apk files are tested on same physical phone running Android 9. I have tried to change order of permissions in request to see if this is related with request order. I always get same above permission asked on 64bit version. Let me know if you think this is a bug in Delphi, please. Thanks & regards, Ertan Android64Bit_Permisions.7z
  22. ertank

    Android 64bit and 32bit permissions

    That's it. I should have spotted that. I guess I am still not used to different settings on 32Bit and 64Bit of same OS. Thanks.
  23. ertank

    Android 64bit and 32bit permissions

    Changed phone language to English for any possible future questions. Thanks.
  24. Hello, I am using Delphi 10.3.3, Indy (stock Indy version) I am trying to listen broadcast UDP messages on Android (exact version I am testing is 4.4.2, I need to support latest versions, too) connected to a local WiFi. Broadcast messages will be sent in same network. I have found this page https://stackoverflow.com/questions/19040674/delphi-xe5-tidudpserver-does-not-receive-anything-on-android and tried to do it as to my understanding. Project has CHANGE_WIFI_MULTICAST_STATE permission set. UDP server parameters are as following at design time and everything else is left as default: TIdUDPServer.Active = False TIdUDPServer.BroadcastEnable = True TIdUDPServer.DefaultPort = 8080 I have following code where timer is activated as last line in OnFormCreate() event and has 0.5 seconds delay: procedure TForm3.tmrCheckPhoneServiceTimer(Sender: TObject); var WifiManagerObj: JObject; begin // Run just once tmrCheckPhoneService.Enabled := False; // Get necessary OS settings to receive broadcast messages Log('Getting multicast lock...'); WifiManagerObj := TAndroidHelper.Context.getSystemService(TJContext.JavaClass.WIFI_SERVICE); FWifiManager := TJWifiManager.Wrap((WifiManagerObj as ILocalObject).GetObjectID); FMulticastLock := FWifiManager.createMulticastLock(StringToJString('LightFactory Remote')); FMulticastLock.setReferenceCounted(True); FMulticastLock.acquire(); // Try to open a port on Android by sending a broadcast message Log('Sending a broadcast message...'); IdUDPServer1.Broadcast('test', IdUDPServer1.DefaultPort); // Now we can start to listen Log('Activating UDP listener...'); IdUDPServer1.Active := True; if FPhoneDialerService = nil then begin TDialogService.ShowMessage('PhoneDialer service not supported'); Exit(); end; PermissionsService.RequestPermissions([FCallPhonePermission], MakePhoneCallPermissionRequestResult, DisplayRationale); end; I have following code in my OnDestroy() event: procedure TForm3.FormDestroy(Sender: TObject); begin // Stop listenning. IdUDPServer1.Active := False; // Release multicast lock FMulticastLock.release(); end; My broadcast listening code is as following: procedure TForm3.IdUDPServer1UDPRead(AThread: TIdUDPListenerThread; const AData: TIdBytes; ABinding: TIdSocketHandle); var Data: string; begin Data := TEncoding.Default.GetString(AData); TThread.Queue(nil, procedure begin Log('Incoming broadcast message from: ' + ABinding.PeerIP) end); if SameText(Data, 'mytriggerphrase') then begin TThread.Queue(nil, procedure begin TestConnection(ABinding.PeerIP) end); end; end; After I run the app, I have following in my log: 2020-01-14 00:59:33.697 Getting multicast lock... 2020-01-14 00:59:33.736 Sending a broadcast message... 2020-01-14 00:59:33.740 Activating UDP listener... 2020-01-14 00:59:33.804 Incoming broadcast message from: That IP number in above log belongs to Android device itself. I have following problems that I could not figure a solution: 1- I do not get any other broadcast message from my PC application which is sending one broadcast message each second. Is there anything I am doing wrong for that to happen? 2- I get segmentation fault (11) when closing my app. Detailed call stack and exact line is in attached picture. This happens each and every close. I did not understand why. Lastly, I am not sure if my code is doing it correct to keep multicast lock thru all run-time. I read a suggestion to release a multicast lock once finished with it in order to save battery life. So, I wonder if I can release multicast lock right after enabling my TIdUDPServer? Any help is appreciated. Thanks & regards, Ertan