Problem Sharing Encrypted Level Files on Android in Construct 3

Not favoritedFavorited Favorited 0 favourites
  • 4 posts
From the Asset Store
Convert multiple Excel files into JSON files and import them into construct3.
  • Hi everyone, I need your help to solve a problem I’m facing. I’m developing my game with a level editor, and I encrypt the level files so that players can share them locally.

    Here’s what I do:

    I save all the level data in a dictionary.

    Then I set the buffer:

    BinaryData: Set buffer to text UTF-8 Dictionary.AsJSON

    Then I encrypt it:

    Encryption: Encrypt BinaryData using AES-GCM algorithm, password "" (100,000 iterations, tag "en")

    Then I use this action to download:

    Browser: Invoke download of string BinaryData.GetBase64 with MIME type ".bin" and filename LevelName & ".bin"

    So far, everything works fine: the final file is encrypted and exported, and I can decrypt it normally when opening it in the game.

    However, on the Android version, it’s not working. I’m trying to share the final file using:

    + AJAX: On completed "saved"

    -> Share: Add file LevelName & ".bin" type ".bin" from BinaryData

    -> Share: Share text "Save" & LevelName (title "", URL "")

    But this is saving other types of characters inside the file, which I cannot read when importing it back into the project.

    Could someone help me with this, please?

    This is my game file when encrypted it is saved on PC

    and this is the file when I export it from the game on Android.. which is formatting to another type and then I can't load it into the game again

    If I download the dictionary json file without encryption using share, it saves normally but remains unprotected, I would like to save the encrypted file on Android without this problem. I tried all the modules, application/json, application/octet-stream, application/zip and nothing, it seems that the error is in the part that adds bynare when sharing, sorry I'm gentle in this data area so I would really like your help

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Wow, personal life, no one can help me, is it some mistake on my part that's so silly?

  • On PC you are downloading the data in Base64 format, which is basically text.

    On Android you are sharing a binary file - i.e. not text. You need to convert the data to Base64 before sharing.

    You can try this:

    -> BinaryData: Set buffer to UTF-8 text Self.GetBase64
    -> Share: Add file Levelname&".txt" type "text/plain" from BinaryData
    
  • Wow, personal life, no one can help me, is it some mistake on my part that's so silly?

    Wow, my friend, you helped me so much! I’m super happy. God bless you for your precious time. If I could, I would give you 5 stars—you’re amazing!

Jump to:
Active Users
There are 0 visitors browsing this topic (0 users and 0 guests)