Jump to content

Dave Nottage

Members
  • Content Count

    1424
  • Joined

  • Last visited

  • Days Won

    32

Everything posted by Dave Nottage

  1. Dave Nottage

    Kastri cross-platform library

    Please refer to the updated readme: https://github.com/DelphiWorlds/Kastri/tree/master/Demos/Biometric#readme
  2. Dave Nottage

    Kastri cross-platform library

    You mean Delphi 11.1? Delphi 11.2 is yet to be released. I just checked on my Android 9 device - it appears there is an issue. I'll repost again after I've found a solution. Because it needs to be added to Android 32-bit only. It will apply to both.
  3. Dave Nottage

    Kastri cross-platform library

    There are no such instructions in the readme for that demo project. Doing so is what has caused your problem, as it has re-enabled the jars that need to be disabled. Please re-load the original version of the demo project (BiometricD11)
  4. Dave Nottage

    Execute external program/command and capture output

    I don't have any concrete examples as yet, however there is this: https://github.com/DelphiWorlds/Kastri/blob/master/Core/DW.RunProcess.Mac.pas
  5. Dave Nottage

    Android API31 Rad 11.1

    About 4 weeks ago I submitted an update to an app for review on Google Play Store and it took 4 days. After 2 days I queried the delay (which was unusual because the previous updates were available within hours) and they replied that such delays occur from time to time.
  6. Dave Nottage

    Android API31 Rad 11.1

    Exactly. There should be an option in the Version Info to override what the IDE defaults to (currently 30). I've now added this report to the Quality Portal: https://quality.embarcadero.com/browse/RSP-38976
  7. I'd like to be able to remove a dependency on OpenSSL, which is being used in this routine (original context here😞 class function TgoSSLHelper.Sign_RSASHA256(const AData: TBytes; const APrivateKey: TBytes; out ASignature: TBytes): Boolean; var BIOPrivateKey: PBIO; PrivateKey: PEVP_PKEY; Ctx: PEVP_MD_CTX; SHA256: PEVP_MD; Size: Cardinal; begin BIOPrivateKey := BIO_new_mem_buf(@APrivateKey[0], Length(APrivateKey)); PrivateKey := PEM_read_bio_PrivateKey(BIOPrivateKey, nil, nil, nil); Ctx := EVP_MD_CTX_create; try SHA256 := EVP_sha256; if (EVP_DigestSignInit(Ctx, nil, SHA256, nil, PrivateKey) > 0) and (EVP_DigestUpdate(Ctx, @AData[0], Length(AData)) > 0) and (EVP_DigestSignFinal(Ctx, nil, Size) > 0) then begin SetLength(ASignature, Size); Result := EVP_DigestSignFinal(Ctx, @ASignature[0], Size) > 0; end else Result := False; finally EVP_MD_CTX_destroy(Ctx); end; end; I'm a bit green when it comes to cryptography routines, so I'm not exactly sure what it is doing, and the OpenSSL docs are quite verbose, however my goal is to be able to use another library like LockBox, or DCPCrypt (if it can handle it) so as to remove the dependency on OpenSSL. Can someone help replicate it using LockBox3 or perhaps some other (non-commercial) library, or at least point to which classes should be used?
  8. Thanks, however I'm after something that is cross-platform.
  9. Dave Nottage

    Android API31 Rad 11.1

    The message would be that you need to target API level 31 or more. As pcplayer99 inferred, you will need to modify your AndroidManifest.template.xml, by replacing %targetSdkVersion% with the value: 31. You will also need to add an android:exported="true" attribute to the application node in the same file, so that it looks like this: <activity android:name="com.embarcadero.firemonkey.FMXNativeActivity" android:label="%activityLabel%" android:configChanges="orientation|keyboard|keyboardHidden|screenSize" android:exported="true" android:launchMode="singleTask"> If you changed your SDK settings in Delphi SDK Manager to use API level 31, you should change them back to API level 30 unless you want to be stuck with other problems in the manifest (when compiling the app)
  10. Dave Nottage

    Run a form on application exit??

    Use OnCloseQuery in the main form, and prevent the main form from closing unless the "exit" form has already been shown. If it hasn't been shown, show it πŸ™‚
  11. You cannot use FMX.xxx units in an Android service built with Delphi. See: https://quality.embarcadero.com/browse/RSP-17857
  12. Some devices have 64-bit CPUs, but have Android 32-bit running on them. Easiest way to find out if this is the case for you is to download an app like this. On the CPU page it reports whether the device is running in 32-bit mode.
  13. Fair enough - I'd first try 2 instances of Delphi as SwiftExpat has suggested (have you tried this?), otherwise if that's too problematic: the second instance running in a Virtual Machine.
  14. More to it than that: Updating the label (or anything UI related) needs to happen in the main thread - see Rollo62's answer
  15. Dave Nottage

    Multiplatform Hello World error [PAClient Error] Error: E7688

    Looks like you may be using a project created with an older version of Delphi. Please refer to: https://github.com/DelphiWorlds/HowTo/tree/main/Solutions/AndroidLibraries
  16. I'd expect that behaviour if CopyData was running in a separate thread. It would not normally be an issue, otherwise.
  17. I doubt it is possible with one instance of Delphi. Might be better to explain why you need it - there may be an alternative.
  18. Dave Nottage

    Keeping edit field in view when on-screen keyboard appears

    There's this (outdated) article. The demo has moved to here, and it sorely needs another revisit πŸ™‚
  19. Dave Nottage

    Gradle support for Android

    Your repo violates copyright, by including a near copy of System.Zip (apparently from an earlier version of Delphi)
  20. Dave Nottage

    Self-updating android app in Alexandria

    Is there any reason why you can't download to an app-specific folder? There are a number of changes in Android 11 that make it difficult to manage storage in shared folders: https://developer.android.com/about/versions/11/privacy/storage Which would explain why you are having issues. If you're logging from an app, the easiest way is to use Log.d from the FMX.Types unit. You can view the log messages using a logcat viewer - I have one called Device Lens. In Delphi, there's a permission in the Uses Permissions > Signature section of the Project Options called "Request install packages". Even with that checked, the OS might request approval from the user.
  21. Dave Nottage

    Self-updating android app in Alexandria

    This is a complete routine that should work: procedure OpenApplication(const AFileName: string); var LMimeType: JString; LIntent: JIntent; begin LMimeType := TJMimeTypeMap.JavaClass.getSingleton.getMimeTypeFromExtension(StringToJString('apk')); LIntent := TJIntent.JavaClass.init(TJIntent.JavaClass.ACTION_VIEW); LIntent.setDataAndType(JFileToJURI(TJFile.JavaClass.init(StringToJString(AFileName))), LMimeType); LIntent.setFlags(TJIntent.JavaClass.FLAG_GRANT_READ_URI_PERMISSION); TAndroidHelper.Activity.startActivityForResult(LIntent, 999); // 999 is just a random value - it won't matter what it is end; Note the extra line regarding FLAG_GRANT_READ_URI_PERMISSION.
  22. Dave Nottage

    Self-updating android app in Alexandria

    Sorry.. missed a step. Delete AndroidManifest.template.xml in the project folder. The IDE will recreate this. If you have made any customisations to it, you will need to ensure you reinstate those after it is recreated.
  23. Dave Nottage

    Self-updating android app in Alexandria

    This should be: Intent.setDataAndType(JFileToJURI(F)), StringToJString('application/vnd.android.package-archive')); JFileToJURI uses the FileProvider class to create the correct URI You won't need to do that if you check the Secure File Sharing option in the Entitlements List in the Project Options. This also creates and deploys the required xml file.
  24. Dave Nottage

    Components4developers???

    Their blog site appears to be still alive: https://components4developers.blog ..and Kim is still posting on Twitter (at least less than 2 weeks ago): https://twitter.com/comp4dev
  25. Dave Nottage

    Delphi 10.4.2 won't open a specific .PAS file

    How big is the file? It might have some odd characters in it that the IDE cannot handle? Or maybe some peculiar structure? For the characters problem: try loading it in Notepad, make a minor change, then save it, then load it in Delphi again.
Γ—