How does MATLAB app designer call external. m functions after packaging into exe?

9 Ansichten (letzte 30 Tage)
How does MATLAB app designer call external. m functions after packaging into exe? Please note that this external function is not packaged into EXE. Who can help me! I have tried commands such as' addpath ',' filread ',' eval ', but after testing, none of them worked.
  3 Kommentare
shen hedong
shen hedong am 31 Dez. 2024
Thank you very much, your minify function is really amazing! Thank you for your contribution!

Melden Sie sich an, um zu kommentieren.

Antworten (2)

Manikanta Aditya
Manikanta Aditya am 30 Dez. 2024
Bearbeitet: Manikanta Aditya am 30 Dez. 2024
When you package a MATLAB App Designer app into an executable (EXE), calling external .m functions that are not included in the EXE can be tricky.
Here are some steps and considerations to help you achieve this:
  1. Include External Functions in the Package: Ideally, you should include all necessary .m files in the packaging process. This ensures that all dependencies are available when the EXE runs.
Refer to the following MATLAB Answers posts to know more about the query:
I hope this helps you.
  3 Kommentare
Manikanta Aditya
Manikanta Aditya am 30 Dez. 2024
To strongly encrypt your .m files and protect your MATLAB code from being cracked, while you mentioned that pcode can be cracked, it is still a useful first step. pcode obfuscates your code, making it harder to read and modify.
  • Use the MATLAB Compiler to compile your .m files into standalone executables or shared libraries. This approach converts your MATLAB code into a binary format, which is much harder to reverse-engineer compared to pcode.
  • In addition to pcode, you can manually obfuscate your code by renaming variables and functions to non-descriptive names, removing comments, and using complex logic structures. This makes it more difficult for someone to understand and reverse-engineer your code.

Melden Sie sich an, um zu kommentieren.


Walter Roberson
Walter Roberson am 30 Dez. 2024
Bearbeitet: Walter Roberson am 30 Dez. 2024

When you package into exe then external .m that are not packaged as part of the exe, cause an error when they are called.

Only .m and .mlx and .p and .mdl and .slx (and possibly a few others) that are packaged with the exe can be called. It is impossible for external .m not bundled with the exe to be called. All .m must have been pre-parsed and encoded into ctf format to be callable.

The purpose of compiling into exe is to create a limited-functionality executable. If it were possible to run external .m that were not compiled into the bundle then unlimited functionality could be built. Imagine an executable that simply called an external .m and returned, then the user could supply arbitrary code in the .m and thus evade the need for a matlab license to execute arbitrary code. Therefore it will never be possible to execute external .m that are not bundled into the exe

  1 Kommentar
shen hedong
shen hedong am 30 Dez. 2024
Thank you very much for your answer. Actually, I can currently solve this problem by packaging it in app format instead of exe format. In order to protect my code, I encrypted the app format code using the pcode command. However, there are many ways to crack p files on the internet now, so do you have a way to strongly encrypt. m files? I don't want my code to be cracked by others.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Develop Apps Using App Designer finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by