<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: FeniksD</title>
    <description>The latest articles on DEV Community by FeniksD (@feniksd).</description>
    <link>https://dev.to/feniksd</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4258831%2F9fa46424-6dbe-4db1-911e-7b5d51bf2fbc.png</url>
      <title>DEV Community: FeniksD</title>
      <link>https://dev.to/feniksd</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/feniksd"/>
    <language>en</language>
    <item>
      <title>I built a zero-dependency CLI to turn AOSP logcat, SELinux denials &amp; kernel panics into git patches</title>
      <dc:creator>FeniksD</dc:creator>
      <pubDate>Sun, 22 Nov 2026 13:48:59 +0000</pubDate>
      <link>https://dev.to/feniksd/i-built-a-zero-dependency-cli-to-turn-aosp-logcat-selinux-denials-kernel-panics-into-git-patches-2858</link>
      <guid>https://dev.to/feniksd/i-built-a-zero-dependency-cli-to-turn-aosp-logcat-selinux-denials-kernel-panics-into-git-patches-2858</guid>
      <description>&lt;p&gt;If you have ever done custom AOSP or Embedded Android bring-up on a MediaTek or Qualcomm device, you probably know this loop way too well:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Device bootloops or a HAL silently refuses to come up.&lt;/li&gt;
&lt;li&gt;You pull &lt;code&gt;adb logcat&lt;/code&gt;, &lt;code&gt;dmesg&lt;/code&gt;, and &lt;code&gt;/data/tombstones&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;You grep for &lt;code&gt;avc: denied&lt;/code&gt;, &lt;code&gt;hwservicemanager&lt;/code&gt;, &lt;code&gt;Direct firmware load&lt;/code&gt;, or &lt;code&gt;SIGSEGV&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;You run &lt;code&gt;audit2allow&lt;/code&gt;, realize half of its output will break AOSP CTS &lt;code&gt;neverallow&lt;/code&gt; rules, and rewrite the &lt;code&gt;.te&lt;/code&gt; macros by hand anyway.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;While working on an Android 17 / GKI 6.6 bring-up (&lt;code&gt;infinity-dash&lt;/code&gt; for a MediaTek Dimensity device), I got tired of repeating that manual triage loop on every build and packaged the tooling into a small open-source CLI: &lt;strong&gt;Acrionix&lt;/strong&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;GitHub:&lt;/strong&gt; &lt;a href="https://github.com/acrionix-labs/acrionix-cli" rel="noopener noreferrer"&gt;https://github.com/acrionix-labs/acrionix-cli&lt;/a&gt; (Apache-2.0)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;PyPI:&lt;/strong&gt; &lt;code&gt;pip install acrionix-cli&lt;/code&gt; (zero external dependencies, Python 3.10+)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Live web sandbox (no install needed):&lt;/strong&gt; &lt;a href="https://acrionix.cloud/#sandbox" rel="noopener noreferrer"&gt;https://acrionix.cloud/#sandbox&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Why not just &lt;code&gt;audit2allow&lt;/code&gt;?
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;audit2allow&lt;/code&gt; does exactly one thing: it turns every single &lt;code&gt;avc: denied&lt;/code&gt; line into a raw &lt;code&gt;allow&lt;/code&gt; statement. On a real Android 16/17 device in SELinux Enforcing mode, that causes two annoying problems:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;It does not collapse rules into idiomatic AOSP macros (&lt;code&gt;binder_call&lt;/code&gt;, &lt;code&gt;r_file_perms&lt;/code&gt;, &lt;code&gt;rw_file_perms&lt;/code&gt;, &lt;code&gt;r_dir_perms&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;It happily emits rules for things you should &lt;strong&gt;never&lt;/strong&gt; allow, like banking apps probing &lt;code&gt;selinuxfs&lt;/code&gt;, &lt;code&gt;proc_kallsyms&lt;/code&gt;, &lt;code&gt;proc_modules&lt;/code&gt;, or &lt;code&gt;proc_bootconfig&lt;/code&gt; for root detection. If you blindly merge those into your tree, CTS &lt;code&gt;neverallow&lt;/code&gt; checks will fail the build.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;When I tested &lt;code&gt;acrionix doctor --adb --root&lt;/code&gt; on my live Android 17 device today, it scanned 968 lines of live &lt;code&gt;logcat&lt;/code&gt;, &lt;code&gt;dmesg&lt;/code&gt;, &lt;code&gt;SYSTEM_LAST_KMSG&lt;/code&gt;, and the latest tombstone in &lt;strong&gt;387ms&lt;/strong&gt;, and automatically:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Caught 5 &lt;code&gt;untrusted_app_34&lt;/code&gt; anti-root probes (&lt;code&gt;proc_kallsyms&lt;/code&gt;, &lt;code&gt;proc_keys&lt;/code&gt;, &lt;code&gt;proc_modules&lt;/code&gt;, &lt;code&gt;proc_bootconfig&lt;/code&gt;, &lt;code&gt;selinuxfs&lt;/code&gt;), flagged them as CTS &lt;code&gt;neverallow&lt;/code&gt; warnings, and refused to emit unsafe &lt;code&gt;.te&lt;/code&gt; rules for them.&lt;/li&gt;
&lt;li&gt;Triaged a real vendor Bluetooth HAL crash (&lt;code&gt;SIGSEGV&lt;/code&gt; null pointer dereference in &lt;code&gt;/vendor/lib64/libbt-vendor.so (mtk_bt_op+580)&lt;/code&gt; inside &lt;code&gt;VendorInterface::Shutdown()&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;Caught a subtle DSU boot failure (&lt;code&gt;reboot: Restarting system with command 'opex_incremental_disable'&lt;/code&gt;) that was getting trapped by DSU's default &lt;code&gt;one_shot_boot=1&lt;/code&gt; flag.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Quick Example: From Raw Failure Log to &lt;code&gt;git apply --check&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;Install the CLI:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip install acrionix-cli
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Triage an offline log against your local device tree:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;acrionix triage ./boot_failure.log --tree ./device/oem/common --out fix.patch
git apply --check fix.patch
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or inspect a connected device over ADB:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;acrionix doctor --adb
&lt;span class="c"&gt;# With root access (also inspects dmesg, latest tombstone, and last_kmsg):&lt;/span&gt;
acrionix doctor --adb --root
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can also stream live &lt;code&gt;logcat&lt;/code&gt; while testing on a bench:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;acrionix watch --adb --tree ./device/oem/sm8650 --out-dir ./.acrionix
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  What &lt;code&gt;v0.5.0&lt;/code&gt; handles today
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;SELinux AVC synthesizer&lt;/strong&gt; - maps &lt;code&gt;avc: denied&lt;/code&gt; tuples into scoped AOSP macros and blocks common CTS &lt;code&gt;neverallow&lt;/code&gt; traps.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;VINTF / HAL mismatch resolver&lt;/strong&gt; - parses &lt;code&gt;hwservicemanager&lt;/code&gt; and &lt;code&gt;VintfObject&lt;/code&gt; errors and patches &lt;code&gt;manifest.xml&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Init + missing firmware correlation&lt;/strong&gt; - connects &lt;code&gt;init&lt;/code&gt; daemon exit codes to kernel &lt;code&gt;Direct firmware load ... failed with error -2&lt;/code&gt; and adds &lt;code&gt;PRODUCT_COPY_FILES&lt;/code&gt; entries in &lt;code&gt;device.mk&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Kernel oops / panic &amp;amp; native tombstone triage&lt;/strong&gt; - extracts faulting addresses, &lt;code&gt;Call trace:&lt;/code&gt; frames, and out-of-tree &lt;code&gt;/vendor_dlkm&lt;/code&gt; driver modules.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CI automation (&lt;code&gt;--open-pr&lt;/code&gt; and &lt;code&gt;--cloud&lt;/code&gt;)&lt;/strong&gt; - validates patches with &lt;code&gt;git apply --check&lt;/code&gt;, creates a fix branch, and opens a GitHub PR (or runs stateless analysis via &lt;code&gt;POST https://acrionix.cloud/api/triage&lt;/code&gt;).&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Try it or break it
&lt;/h2&gt;

&lt;p&gt;The codebase is tiny, pure Python stdlib, and Apache-2.0 licensed. If you work on AOSP, custom ROMs, automotive IVI, or Embedded Linux and have weird &lt;code&gt;logcat&lt;/code&gt; / &lt;code&gt;dmesg&lt;/code&gt; / kernel panic logs that break our parsers, open an issue at &lt;a href="https://github.com/acrionix-labs/acrionix-cli" rel="noopener noreferrer"&gt;https://github.com/acrionix-labs/acrionix-cli&lt;/a&gt; and I will add test coverage for them.&lt;/p&gt;

</description>
      <category>android</category>
      <category>linux</category>
      <category>opensource</category>
      <category>python</category>
    </item>
  </channel>
</rss>
