A method for determining the validity of a code of an application (App), said method being implemented within an electronic device comprising a non-secure processor, a secure processor, a non-secure memory and a secure memory, said method being characterized in that it comprises at least one iteration of the following steps: - a step of loading said application into said non-secure memory, issuing a current application code; and - upon detection, by the secure processor, of a request for implementing, by the non-secure processor, an optimization process of said current application code: ∘ a step of generating, by said secure processor, an interruption of said optimization process; ∘ a step of determining, by said secure processor, a fingerprint of said current application code, issuing a current fingerprint (Emp_C) associated with said application; ∘ a step of obtaining, by said secure processor, within said secure memory, a reference fingerprint (Emp_Rf) associated with said application; ∘ a step of comparing, by said secure processor, of the current fingerprint (Emp_C) with the reference fingerprint (Emp_Rf); and ∘ when said current fingerprint (Emp_C) is identical to said reference fingerprint (Emp _Rf), a validation step, by said secure processor, of said current application code, comprising: ▪ a step of issuing an authorization to resume execution of said optimization process of the current application code of said application, said execution issuing an optimized application code; ▪ a step of determining a fingerprint of said optimized application code, issuing a post-optimization fingerprint (Emp_PO) associated with said application; ▪ a step of recording said post-optimization fingerprint (Emp_PO) in said secure memory, as a new reference fingerprint associated with said application. - a step of loading said application into said non-secure memory, issuing a current application code; and - upon detection, by the secure processor, of a request for implementing, by the non-secure processor, an optimization process of said current application code: ∘ a step of generating, by said secure processor, an interruption of said optimization process; ∘ a step of determining, by said secure processor, a fingerprint of said current application code, issuing a current fingerprint (Emp_C) associated with said application; ∘ a step of obtaining, by said secure processor, within said secure memory, a reference fingerprint (Emp_Rf) associated with said application; ∘ a step of comparing, by said secure processor, of the current fingerprint (Emp_C) with the reference fingerprint (Emp_Rf); and ∘ when said current fingerprint (Emp_C) is identical to said reference fingerprint (Emp _Rf), a validation step, by said secure processor, of said current application code, comprising: ▪ a step of issuing an authorization to resume execution of said optimization process of the current application code of said application, said execution issuing an optimized application code; ▪ a step of determining a fingerprint of said optimized application code, issuing a post-optimization fingerprint (Emp_PO) associated with said application; ▪ a step of recording said post-optimization fingerprint (Emp_PO) in said secure memory, as a new reference fingerprint associated with said application. ∘ a step of generating, by said secure processor, an interruption of said optimization process; ∘ a step of determining, by said secure processor, a fingerprint of said current application code, issuing a current fingerprint (Emp_C) associated with said application; ∘ a step of obtaining, by said secure processor, within said secure memory, a reference fingerprint (Emp_Rf) associated with said application; ∘ a step of comparing, by said secure processor, of the current fingerprint (Emp_C) with the reference fingerprint (Emp_Rf); and ∘ when said current fingerprint (Emp_C) is identical to said reference fingerprint (Emp _Rf), a validation step, by said secure processor, of said current application code, comprising: ▪ a step of issuing an authorization to resume execution of said optimization process of the current application code of said application, said execution issuing an optimized application code; ▪ a step of determining a fingerprint of said optimized application code, issuing a post-optimization fingerprint (Emp_PO) associated with said application; ▪ a step of recording said post-optimization fingerprint (Emp_PO) in said secure memory, as a new reference fingerprint associated with said application. ▪ a step of issuing an authorization to resume execution of said optimization process of the current application code of said application, said execution issuing an optimized application code; ▪ a step of determining a fingerprint of said optimized application code, issuing a post-optimization fingerprint (Emp_PO) associated with said application; ▪ a step of recording said post-optimization fingerprint (Emp_PO) in said secure memory, as a new reference fingerprint associated with said application.