Results 1 to 3 of 3

Thread: Current Kali NetHunter builds do not work on Nexus 9 Tablet

  1. #1
    Join Date
    2017-Apr
    Posts
    5

    Current Kali NetHunter builds do not work on Nexus 9 Tablet

    I have spent the past week wrestling with trying to get a vanilla installation of Kali NetHunter (NH) working on a rooted Nexus 9 tablet (LTE). I have gone through the process multiple times, returning to stock ROM - rooting - installing, with the exact same results each time. I have scoured these forums, more blog and problem posts than I can count, Android logs, and read the supporting NetHunter source code supporting log file entries. I could write a 20-page paper on everything tried and results which followed, but I'm distilling it all down to the key points in hopes of a forthcoming fixed NH build, as the results were consistent.

    Note: current versions / downloads for all components were used (stock ROM, Magisk, TWRP, and NH). There were no problems with the stock ROM, rooting (or un-rooting) or flashing process at all. All worked as advertised.

    - The problems were all with NH. The general problem is that after installation, the NH Terminal will not start -- it immediately crashes on launch. A number of details about this:

    At the end of flashing the NH zip, there is a message received:

    Kali NetHunter is now installed!
    Please update the NetHunter app via the NetHunter Store to work around an Android permission issue and run the NetHunter app to finish setting everything up!

    I did this consistently, there was no problem updating the NH app, but it made no difference to the results.

    - It did not matter whether NH Terminal was launched first, or the NH app was launched first, and attempted install of metapackages were attempted in Chroot Manager (chroot works fine): when NH Terminal was launched it crashed.
    - Never were permissions requested when NH Terminal was launched, nor were SuperUser rights ever granted.
    - The Android logs displayed using logcat showed the following error from NH Terminal launch:

    09-29 20:24:10.966 622 655 I ActivityManager: Start proc 21236:com.offsec.nhterm/u0a111 for activity com.offsec.nhterm/.ui.term.NeoTermActivity
    09-29 20:24:11.220 21236 21236 W System.err: java.lang.RuntimeException: Unable to create application com.offsec.nhterm.App: java.lang.NullPointerException: scriptDir.listFiles() must not be null
    09-29 20:24:11.222 21236 21236 W System.err: at com.offsec.nhterm.component.userscript.UserScriptC omponent.reloadScripts(comp.kt:40)
    09-29 20:24:11.222 21236 21236 W System.err: at com.offsec.nhterm.component.userscript.UserScriptC omponent.checkForFiles(comp.kt:36)
    09-29 20:24:11.222 21236 21236 W System.err: at com.offsec.nhterm.component.userscript.UserScriptC omponent.onServiceInit(comp.kt:18)
    09-29 20:24:11.222 21236 21236 W System.err: at com.offsec.nhterm.component.ComponentManager.regis terComponent(comp.kt:33)
    09-29 20:24:11.222 21236 21236 W System.err: at com.offsec.nhterm.component.NeoInitializer.initCom ponents(comp.kt:80)
    09-29 20:24:11.222 21236 21236 W System.err: at com.offsec.nhterm.component.NeoInitializer.init(co mp.kt:72)
    09-29 20:24:11.222 21236 21236 W System.err: at com.offsec.nhterm.App.onCreate(App.kt:26)
    09-29 20:24:11.243 622 1003 I ActivityManager: START u0 {flg=0x10000000 cmp=com.offsec.nhterm/.ui.other.CrashActivity (has extras)} from uid 10111 on display 0
    09-29 20:24:11.249 21236 21236 E AndroidRuntime: Process: com.offsec.nhterm, PID: 21236
    09-29 20:24:11.249 21236 21236 E AndroidRuntime: java.lang.RuntimeException: Unable to create application com.offsec.nhterm.App: java.lang.NullPointerException: scriptDir.listFiles() must not be null
    09-29 20:24:11.249 21236 21236 E AndroidRuntime: at com.offsec.nhterm.component.userscript.UserScriptC omponent.reloadScripts(comp.kt:40)
    09-29 20:24:11.249 21236 21236 E AndroidRuntime: at com.offsec.nhterm.component.userscript.UserScriptC omponent.checkForFiles(comp.kt:36)
    09-29 20:24:11.249 21236 21236 E AndroidRuntime: at com.offsec.nhterm.component.userscript.UserScriptC omponent.onServiceInit(comp.kt:18)
    09-29 20:24:11.249 21236 21236 E AndroidRuntime: at com.offsec.nhterm.component.ComponentManager.regis terComponent(comp.kt:33)
    09-29 20:24:11.249 21236 21236 E AndroidRuntime: at com.offsec.nhterm.component.NeoInitializer.initCom ponents(comp.kt:80)
    09-29 20:24:11.249 21236 21236 E AndroidRuntime: at com.offsec.nhterm.component.NeoInitializer.init(co mp.kt:72)
    09-29 20:24:11.249 21236 21236 E AndroidRuntime: at com.offsec.nhterm.App.onCreate(App.kt:26)
    09-29 20:24:11.747 622 668 W ActivityManager: Activity pause timeout for ActivityRecord{8f155ab u0 com.offsec.nhterm/.ui.term.NeoTermActivity t45}
    09-29 20:25:11.348 622 668 W ActivityManager: Activity pause timeout for ActivityRecord{5b8ca4c u0 com.offsec.nhterm/.ui.other.CrashActivity t45}
    09-29 20:25:20.887 622 668 W ActivityManager: Activity stop timeout for ActivityRecord{8f155ab u0 com.offsec.nhterm/.ui.term.NeoTermActivity t45}
    09-29 20:25:21.351 622 668 W ActivityManager: Activity stop timeout for ActivityRecord{5b8ca4c u0 com.offsec.nhterm/.ui.other.CrashActivity t45}
    09-29 20:29:11.356 622 1422 W ActivityManager: Force finishing activity com.offsec.nhterm/.ui.other.CrashActivity
    09-29 20:29:11.397 622 1422 W ActivityManager: Force finishing activity com.offsec.nhterm/.ui.term.NeoTermActivity
    09-29 20:29:11.409 622 1422 I ActivityManager: Killing 21236:com.offsec.nhterm/u0a111 (adj 0): crash

    - I read through the NH source code associated with this stack trace, and compared what it was looking for on the file system to what had been created on my filesystem on NH install, and it was clear that there were bugs in the source code, or the installation, or likely both. The resources it was looking for were not found, and that was causing the NullPointerException (perhaps some error checking or asserts would be a good idea here). I actually created some of the artifacts on the filesystem it was looking for to see what would happen if the NullPointerException didn't happen, and it lead to downstream NullPointerExceptions with additional resources not found (related to colors schemes, etc.). I imagine this was a domino effect of either a buggy installation or lack of permissions on launch. But regardless, it confirmed a source / resources problem related to either NH installation or brittle source code breaking on launch when unexpected default conditions were encountered.

    After exploring the source code, and seeing the reference to "NeoTerm" as a new feature of the most recent NH Terminal release notes, I started thinking of either bugs introduced in new code, or regressions, so I started experimenting with earlier versions of NH Terminal.

    Here's a summary of what I found -- the most recent version of NH Terminal which would launch at all without crashing was Version 2020.4 (two versions behind the current Version 2023.3). This version did prompt for permissions, and was granted SuperUser rights. It was more or less usable by itself (though several problems were encountered trying to update packages with apt). But in tandem with the current version of the NH app, while chroot worked fine, and the first screen with the System Information showed that NH Terminal was installed, any attempt to add metapackages failed, with a message to install an Android Terminal. Attempted configuration of a number of other features in the NH app also failed. In other words, the Version 2020.4 NH Terminal was incompatible with the current Version 2023.3 of the NH app.

    So I then downgraded the NH app, and discovered that the Version 2023.2 (added on 6/9/23, which is four versions behind the current release) seems to be the newest version of the NH app which will work (mostly, a few issues) with the NH Terminal 2020.4. I now have those installed, and have had some success upgrading packages and avoiding absolute show-stopping errors (installed apps seem to be granted SuperUser access as necessary, and they launch, though still have periodic crashes). To my knowledge, this is the newest combination of NH app and NH Terminal versions which results in a semi-usable NH on Nexus 9.

    I cannot upgrade any of the apps or NH, and I cannot use their current versions, which is undesirable. I'd like to get this fixed soon if possible. It might be related to my device make and model, but from reading source code I have a guess (and that's all it is) there might be some issues in play here that transfer to other devices.

    I'd be happy to test new builds if fixes to these issues are released. Also, if there's any work done on this or familiarity with the source code, I'd be very interested to know the details of the source of the problem.

    Thanks so much for your consideration.

    Axz
    Last edited by axzhandul; 2023-10-03 at 20:12.

  2. #2
    Join Date
    2021-May
    Location
    UK
    Posts
    772
    Don't use the NH terminal, it never worked for me either, but its only a terminal emulator, try Termux, that's the simple fix;
    https://www.xda-developers.com/termu...xda-spotlight/

  3. #3
    Join Date
    2017-Apr
    Posts
    5
    Hey Fred, thanks for the reply. I actually did try Termux, but the problem I ran into in that case is with the NH app. If you do not install the NH Terminal app, it will throw errors (for example, when trying to add or update packages) saying it cannot detect a terminal, and it will not detect Termux as the terminal. If you do install the NH Terminal app, the NH app attempts to launch it and crashes. If you know how to use Termux and get the NH to detect it and use it as the terminal in place of the NH Terminal app, I'd love to know how.

    Thx again for the response.

    Axz

Similar Threads

  1. Replies: 1
    Last Post: 2020-10-07, 08:55
  2. Trouble installing nethunter on nexus 9 tablet
    By almandin in forum Installing NetHunter
    Replies: 0
    Last Post: 2017-11-04, 18:28
  3. Replies: 0
    Last Post: 2016-06-01, 00:04
  4. Flashing new builds of nethunter?
    By C1M7 in forum Building NetHunter
    Replies: 6
    Last Post: 2015-01-24, 14:26

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •