• Qt 为Android app添加系统签名


    Qt 为Android app添加系统签名

    flyfish

    一 环境

    lsb_release -a
    
    • 1
    No LSB modules are available.
    Distributor ID:	Ubuntu
    Description:	Ubuntu 23.04
    Release:	23.04
    Codename:	lunar
    
    • 1
    • 2
    • 3
    • 4
    • 5

    Qt Creator 10.0.2
    构建套件 Qt 6.5.1 Clang arm64-v8a

    二 运行Qt

    如果没有Qt图标
    在终端运行或者右键单击该文件 -> 作为程序执行

    在这里插入图片描述

    三 添加权限

    新增AndroidManifest.xml
    项目 -> 构建 -> 创建模板
    在这里插入图片描述

    概要是界面显示
    XML源是xml脚本显示
    在这里插入图片描述

    
    <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="org.qtproject.example" android:installLocation="auto" android:versionCode="-- %%INSERT_VERSION_CODE%% --" android:versionName="-- %%INSERT_VERSION_NAME%% --">
        
        
        <supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:smallScreens="true"/>
        <application android:name="org.qtproject.qt.android.bindings.QtApplication" android:hardwareAccelerated="true" android:label="-- %%INSERT_APP_NAME%% --" android:requestLegacyExternalStorage="true" android:allowNativeHeapPointerTagging="false" android:allowBackup="true" android:fullBackupOnly="false">
            <activity android:name="org.qtproject.qt.android.bindings.QtActivity" android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|layoutDirection|locale|fontScale|keyboard|keyboardHidden|navigation|mcc|mnc|density" android:label="-- %%INSERT_APP_NAME%% --" android:launchMode="singleTop" android:screenOrientation="unspecified" android:exported="true">
                <intent-filter>
                    <action android:name="android.intent.action.MAIN"/>
                    <category android:name="android.intent.category.LAUNCHER"/>
                intent-filter>
                <meta-data android:name="android.app.lib_name" android:value="-- %%INSERT_APP_LIB_NAME%% --"/>
                <meta-data android:name="android.app.arguments" android:value="-- %%INSERT_APP_ARGUMENTS%% --"/>
                <meta-data android:name="android.app.extract_android_style" android:value="minimal"/>
            activity>
        application>
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
    manifest>
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18

    系统权限
    android:versionName="-- %%INSERT_VERSION_NAME%% --" 后面加入一行

    android:sharedUserId="android.uid.system"
    
    • 1

    <manifest xmlns:android="http://schemas.android.com/apk/res/android" 
    package="org.qtproject.example" 
    android:installLocation="auto" 
    android:versionCode="-- %%INSERT_VERSION_CODE%% --" 
    android:versionName="-- %%INSERT_VERSION_NAME%% --"
    android:sharedUserId="android.uid.system">
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6

    四 添加签名

    项目 -> 构建 -> 应用签名
    在这里插入图片描述
    输入密码完成

  • 相关阅读:
    Mysql性能优化
    【SpringBoot】一文了解SpringBoot热部署
    攻破《数组与指针》相关笔试题(二)
    有趣简单的M2处理器性能实验:Swift与C代码执行速度的比较
    窗口管理工具 Mosaic mac中文版功能特点
    phalcon 访问IndexController 中只能访问indexAction方法,访问不了testAction等其它问题的解决办法
    okcc呼叫中心所选的客户服务代表应该具备什么条件?
    五、Jvm调优
    多线程之任务调度线程池
    C++中OpenCV、Armadillo矩阵数据格式的转换方式
  • 原文地址:https://blog.csdn.net/flyfish1986/article/details/133858866