Как оно работает: прога компилируется в native library, затем неведомыми тулзами это всё оборачивается в apk, где java-код сначала запускает либу самой Qt, а уже оттуда грузится моя либа, из которой вызывается main(), ну и поехали.
Защищаем только свою либу. Вне зависимости от ничего - хоть защищать сам main(), хоть какую-то левую функцию, хоть только строки без функций - результат один:
Code: Select all
I/QtCore (13597): Start
I/Qt (13597): qt started
E/audit ( 517): type=1400 audit(1768417515.034:19120): avc: denied { execmod } for pid=13597 comm="qtMainLoopThrea" path="/data/app/.../lib/arm64/libxxx_arm64-v8a.so" dev="sda31" ino=2359773 scontext=u:r:untrusted_app_29:s0:c173,c257,c512,c768 tcontext=u:object_r:apk_data_file:s0 tclass=file permissive=0 audit_filtered
E/libxxx_arm64-v8a.so(13597): Initialization error 1
I/Zygote ( 543): Process 13597 exited due to signal 9 (Killed)ИИ нам сообщает что
Что делать?The avc: denied { execmod } message indicates that the Android SELinux (Security-Enhanced Linux) policy is blocking a process associated with an untrusted app from executing code out of a memory region that has been modified (e.g., from a writable/executable memory mapping). This is a security feature designed to prevent the execution of arbitrary, potentially malicious, code on the device.