A large number of devices with communication and sensing capabilities are connected to the 5G network and facilitate distributed industrial Internet of Things (IIoT) applications. Those devices can update their program code by using software-defined technologies and upgrade functions without hardware replacement, thus, greatly facilitating the development of IIoT applications. Disseminating code safely to these devices is a pivotal issue. However, the existing methods rarely consider whether the code received by devices is integrated. Therefore, an unmanned aerial vehicle (UAV) assisted trustworthy code dissemination (UTCD) framework in 5G-enabled intelligent IIoT systems is proposed to select credible mobile vehicles (MVs) to disseminate code with opportunistic routing style. In the UTCD framework, a verifiable trust evaluation scheme is proposed to identify the trust of the MVs by sending the UAV to collect the code wait to be verified (CWV) directly from the selected devices (bedrock devices) as evidence. This scheme is a fundamental change from the previous passive, indirect and unverifiable trust evaluation schemes. In UTCD, a bedrock devices selection scheme is presented by selecting as few bedrock devices as possible to collect as much the CWV as possible with the minimum cost. After that, based on the CWV, which is collected from bedrock devices, a complete trust evaluation scheme is proposed to obtain the trust of MVs. Furthermore, a UAV trajectory optimization algorithm is proposed to obtain as much CWV as possible within the limited conditions of UAV. Finally, comprehensive experiments conduct on a real-life dataset demonstrate that the proposed scheme outperforms the existing schemes in terms of the efficiency and security of code dissemination.