Renaming the Package Name inside an APK

前端 未结 4 2188
星月不相逢
星月不相逢 2021-01-31 06:50

I have created an AIR app that is currently on the market. To update the app, obviously I must keep the same package name. My first version\'s were packaged usi

4条回答
  •  天命终不由人
    2021-01-31 07:22

    There is a simple environment variable you can set to disable the air. prefix easily. The following code exists in the Adobe AIR packager:

    String optOut = System.getenv("AIR_NOANDROIDFLAIR");
    if ((optOut == null) || (optOut.indexOf("true") == -1)) {
      packageName = "air." + packageName;
    }
    

    So, simply set the AIR_NOANDROIDFLAIR environment variable to true, repackage your application, and it won't have the air. prefix. Google how to set environment variables in windows or mac for your particular OS version.

    For example, I use the command-line compiler on Mac/Linux, so I run:

    > export AIR_NOANDROIDFLAIR=true
    > java -jar $AIR_HOME/lib/adt.jar -package -target apk-captive-runtime -storetype pkcs12 -keystore cert.p12 -storepass *** Main.apk Main-app.xml Main.swf
    

    Warning: I don't know what implications this has. Per someone's note above, this may only be a good idea with captive runtime (but that's the default going forward from AIR 3.8).

    Update: Renaun Erickson said it shouldn't cause problems.

    Cross-posted here (slightly different question, same answer).

提交回复
热议问题