Uploaded image for project: 'Appcelerator CLI'
  1. Appcelerator CLI
  2. CLI-1255

Android: appc-security-jailbreak-detect and appc-sourcecode-encryption-policy property throw an error for the normal device.

    Details

    • Type: Story
    • Status: Resolved
    • Priority: None
    • Resolution: Invalid
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Environment:
    • Story Points:
      8
    • Sprint:
      2017 Sprint 17 Tooling

      Description

      description

      I would like to prevent jailbroken or rooted device to install our apps. According to the doc, we can set the jailbreak property to true, but the source code encryption need to be set to remote

      How would the source code encryption gets it keys then? How does it work?

      I had added the property as per the doc

      <property name="appc-sourcecode-encryption-policy" type="string">remote</property>
          <property name="appc-security-jailbreak-detect">true</property>
          <property name="appc-security-debugger-detect">true</property>
      

      But it throws an error to the normal device. But not sure with the rooted device, I don't have rooted Android device.

      Steps To Reproduce

      1. Create a new App
      2. Add that property to the tiapp.xml file
      3. Run it on the normal device

      error

      [ERROR] :  TiAssetHelper: Error while reading asset "Resources/app.js":
      [ERROR] :  TiAssetHelper: java.io.FileNotFoundException: Resources/app.js
      [ERROR] :  TiAssetHelper: 	at android.content.res.AssetManager.openAsset(Native Method)
      [ERROR] :  TiAssetHelper: 	at android.content.res.AssetManager.open(AssetManager.java:316)
      [ERROR] :  TiAssetHelper: 	at android.content.res.AssetManager.open(AssetManager.java:290)
      [ERROR] :  TiAssetHelper: 	at org.appcelerator.kroll.util.KrollAssetHelper.readAsset(KrollAssetHelper.java:62)
      [ERROR] :  TiAssetHelper: 	at org.appcelerator.titanium.TiLaunchActivity.loadActivityScript(TiLaunchActivity.java:128)
      [ERROR] :  TiAssetHelper: 	at org.appcelerator.titanium.TiLaunchActivity.windowCreated(TiLaunchActivity.java:183)
      [ERROR] :  TiAssetHelper: 	at org.appcelerator.titanium.TiRootActivity.windowCreated(TiRootActivity.java:172)
      [ERROR] :  TiAssetHelper: 	at org.appcelerator.titanium.TiBaseActivity.onCreate(TiBaseActivity.java:682)
      [ERROR] :  TiAssetHelper: 	at org.appcelerator.titanium.TiLaunchActivity.onCreate(TiLaunchActivity.java:169)
      [ERROR] :  TiAssetHelper: 	at org.appcelerator.titanium.TiRootActivity.onCreate(TiRootActivity.java:161)
      [ERROR] :  TiAssetHelper: 	at android.app.Activity.performCreate(Activity.java:5459)
      [ERROR] :  TiAssetHelper: 	at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1093)
      [ERROR] :  TiAssetHelper: 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2364)
      [ERROR] :  TiAssetHelper: 	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2458)
      [ERROR] :  TiAssetHelper: 	at android.app.ActivityThread.access$900(ActivityThread.java:172)
      [ERROR] :  TiAssetHelper: 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1305)
      [ERROR] :  TiAssetHelper: 	at android.os.Handler.dispatchMessage(Handler.java:102)
      [ERROR] :  TiAssetHelper: 	at android.os.Looper.loop(Looper.java:146)
      [ERROR] :  TiAssetHelper: 	at android.app.ActivityThread.main(ActivityThread.java:5598)
      [ERROR] :  TiAssetHelper: 	at java.lang.reflect.Method.invokeNative(Native Method)
      [ERROR] :  TiAssetHelper: 	at java.lang.reflect.Method.invoke(Method.java:515)
      [ERROR] :  TiAssetHelper: 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1283)
      [ERROR] :  TiAssetHelper: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1099)
      [ERROR] :  TiAssetHelper: 	at dalvik.system.NativeStart.main(Native Method)
      [ERROR] :  TiAssetHelper: Error while reading asset "Resources/app.js":
      [ERROR] :  TiAssetHelper: java.io.FileNotFoundException: Resources/app.js
      [ERROR] :  TiAssetHelper: 	at android.content.res.AssetManager.openAsset(Native Method)
      [ERROR] :  TiAssetHelper: 	at android.content.res.AssetManager.open(AssetManager.java:316)
      [ERROR] :  TiAssetHelper: 	at android.content.res.AssetManager.open(AssetManager.java:290)
      [ERROR] :  TiAssetHelper: 	at org.appcelerator.kroll.util.KrollAssetHelper.readAsset(KrollAssetHelper.java:62)
      [ERROR] :  TiAssetHelper: 	at org.appcelerator.kroll.runtime.v8.V8Runtime.nativeRunModule(Native Method)
      [ERROR] :  TiAssetHelper: 	at org.appcelerator.kroll.runtime.v8.V8Runtime.doRunModule(V8Runtime.java:196)
      [ERROR] :  TiAssetHelper: 	at org.appcelerator.kroll.KrollRuntime.handleMessage(KrollRuntime.java:321)
      [ERROR] :  TiAssetHelper: 	at android.os.Handler.dispatchMessage(Handler.java:98)
      [ERROR] :  TiAssetHelper: 	at android.os.Looper.loop(Looper.java:146)
      [ERROR] :  TiAssetHelper: 	at org.appcelerator.kroll.KrollRuntime$KrollRuntimeThread.run(KrollRuntime.java:118)
      [ERROR] :  File: fail readDirectory() errno=2
       
      
      

      Expected Behaviour

      1. Should show security alert at the jailbroken or rooted device
      2. Run normally at the normal device

      Thanks

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                morahman Motiur Rahman
              • Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Git Source Code