Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No Zygisk / Modules icon grayed out on FireTV 2nd gen Cube (Amlogic S922x) #6042

Closed
finnzz opened this issue Jun 26, 2022 · 32 comments · Fixed by #6049
Closed

No Zygisk / Modules icon grayed out on FireTV 2nd gen Cube (Amlogic S922x) #6042

finnzz opened this issue Jun 26, 2022 · 32 comments · Fixed by #6049
Assignees
Labels
confirmed Issue confirmed to exist and the reason is known

Comments

@finnzz
Copy link

finnzz commented Jun 26, 2022

Device: FireTV 2nd gen Cube
Android version: Android 9 (FireOS 7)
Magisk version name: Canary 9183a0a
Magisk version code: (25101) (D)
Amlogic s922x SOC, slot-A only, SAR, no super partition device

I have tried a few canary builds after v24300, as well as v25000, v25100, and today's canary build. I have flashed the Magisk patched boot.img to the boot paritition in fastboot. Magisk superuser rights work properly, but I can't get Zygisk to work, and the modules icon remains grayed out. I've checked and unchecked Zygisk under settings a couple times.

I'm don't think it's related, but the Cube native boot.img does not have a ramdisk. However like some Xiaomi devices, the Cube does accept and use a ramdisk placed in the boot.img. After patching the boot.img with Magisk, ramdisk switched to a yes status.

Also a patch was added in 24.300+ to ignore illegal androidboot.slot_suffix=normal. I don't know if simply ignoring the suffix rather than classify the device as an '_a' device complicates anything?
#5806

I'm including my boot image, boot-up log, and magisk log.

@canyie
Copy link
Collaborator

canyie commented Jun 26, 2022

Can you capture a log via adb logcat at boot?

@finnzz
Copy link
Author

finnzz commented Jun 26, 2022

Can you capture a log via adb logcat at boot?

Sure, here you go

@canyie
Copy link
Collaborator

canyie commented Jun 26, 2022

Looks you started grabbing too late... You may need to set log buffer size to max in developer options, and connect your device to PC before it boots. Use adb wait-for-device logcat in that case.

@finnzz
Copy link
Author

finnzz commented Jun 26, 2022

Looks you started grabbing too late... You may need to set log buffer size to max in developer options, and connect your device to PC before it boots. Use adb wait-for-device logcat in that case.

I did use adb -d logcat. I just checked the original boot.img, and both don't connect over ADB until
--------- beginning of system

I don't know if there is another way to get earlier logs?

@canyie
Copy link
Collaborator

canyie commented Jun 26, 2022

and both don't connect over ADB until
--------- beginning of system

That's ok, just send the thing you've got

@finnzz
Copy link
Author

finnzz commented Jun 26, 2022

and both don't connect over ADB until
--------- beginning of system

That's ok, just send the thing you've got

Do you want me to redo the logcat from above?

Sure, here you go

This log starts at
--------- beginning of system
And continues for 40s

Looking at the uart output there is about 15sec of kernel loading before ADB connects. The USB needs to be configured before an ADB connection can be made.

[   15.471172@2] configfs-gadget gadget: high-speed config #1: b                
[   15.471364@2] android_work: sent uevent USB_STATE=CONFIGURED 

I may be wrong but it looks like logcat is logging in memory before I even make an ADB connection. And --------- beginning of system is the marker for the absolute beginning?

@canyie
Copy link
Collaborator

canyie commented Jun 27, 2022

Do you want me to redo the logcat from above?

Yes, please redo it

@finnzz
Copy link
Author

finnzz commented Jun 27, 2022

Do you want me to redo the logcat from above?

Yes, please redo it

Ok, here you go

EDIT: btw i did increase the logcat buffer just to make sure I wasn't missing anything
logcat -G 2M

but even then the log always starts with:

--------- beginning of system
12-31 19:00:21.199  2927  2927 I vold    : Vold 3.0 (the awakening) firing up
12-31 19:00:21.200  2927  2927 V vold    : Detected support for: ext4 ntfs vfat

@yujincheng08
Copy link
Collaborator

A Magisk module that can help you save the log
required Magisk 20.4+
The log is saved to /cache/bootlog by default
If /cache does not exist, save to /data/local/bootlog
If you don't want to kill the logcat process after boot completed, you can create a file named boot.lcs to /data/local/logcatcher/ .

When the system boot normally and /data/local/logcatcher/boot.lcs is not detected, the logs will be packaged and copied to the Download folder

Recent Updates:

  • Stop catching logs delayed until unlock the phone
  • Select log buffer as main,system,crash by Rikka
  • Fix version
  • Add "MODEL"
  • Automatic uninstallation of older versions
  • Improve unlock detection

Log Catcher-v22.5(27) (2).zip

@finnzz
Copy link
Author

finnzz commented Jun 27, 2022

A Magisk module that can help you save the log required Magisk 20.4+ The log is saved to /cache/bootlog by default If /cache does not exist, save to /data/local/bootlog If you don't want to kill the logcat process after boot completed, you can create a file named boot.lcs to /data/local/logcatcher/ .

Thank you, but I'm not sure how i would install a Magisk module to catch logs, because the issue I'm having is that Magisk zygisk and modules features are not working?

Also as I mentioned above, it appears that logging starts before I have even started logcat. I can wait until the OS has almost loaded, and logcat will provide me with any logs generated since system startup.

--------- beginning of system appears to be as early as logging is possible.

@yujincheng08
Copy link
Collaborator

If you dont want to follow the instruction from us, I would close this issue.

@yujincheng08 yujincheng08 closed this as not planned Won't fix, can't repro, duplicate, stale Jun 27, 2022
@finnzz
Copy link
Author

finnzz commented Jun 27, 2022

magisk

If you dont want to follow the instruction from us, I would close this issue.

I'm sorry, I'm really not trying to be difficult. I think there has been a miscommunication somewhere. I am genuinely asking how to install the logcatcher module? The magisk module icon is grayed on my device.

@yujincheng08
Copy link
Collaborator

magisk --install-module /path/to/zip

@finnzz
Copy link
Author

finnzz commented Jun 27, 2022

magisk --install-module /path/to/zip

Ok, I ran the module install

magisk --install-module Log.Catcher-v22.5.27.2.zip

No error, no confirmation of success either. I still do not have a /data/adb/modules folder. I even tried manually creating a modules folder and running the module install again, but the modules folder was still empty.

Just in case, I rebooted the device and checked /cache, but there is no /cache/bootlog, and no /data/local/bootlog

EDIT: sorry let me correct that, the magisk --install-module command returns error 127

I'm not sure if modules and applets are the same? magisk --list only returns su resetprop

@yujincheng08
Copy link
Collaborator

place the module zip in /data/local/tmp

@finnzz
Copy link
Author

finnzz commented Jun 27, 2022

place the module zip in /data/local/tmp

ok I ran

magisk --install-module /data/local/tmp/Log.Catcher.zip

but i'm still getting error 127. I checked whoami and I am root

EDIT

[    2.228570@4] magiskinit: Skip invalid androidboot.slot_suffix=[normal]
[    2.228718@4] magiskinit: open: /proc/bootconfig failed with 2: No such file or directory
[    2.229812@4] magiskinit: Device config:
[    2.230204@4] magiskinit: skip_initramfs=[1]
[    2.230734@4] magiskinit: force_normal_boot=[0]
[    2.231298@4] magiskinit: rootwait=[1]
[    2.231763@4] magiskinit: slot=[]
[    2.232175@4] magiskinit: dt_dir=[/proc/device-tree/firmware/android]
[    2.232994@4] magiskinit: fstab_suffix=[]
[    2.233484@4] magiskinit: hardware=[amlogic]
[    2.234007@4] magiskinit: hardware.platform=[]
[    2.234559@4] magiskinit: emulator=[0]
[    2.235025@4] magiskinit: LegacySARInit
[    2.235939@4] magiskinit: Mounting system_root
[    2.303615@4] magiskinit: Setup system: [system] (179, 10)
[    2.306789@4] EXT4-fs (mmcblk0p10): mounted filesystem without journal. Opts: (null)
[    2.307077@4] magiskinit: Switch root to /system_root
[    2.307999@4] magiskinit: Cleaning rootfs
[    2.309524@4] magiskinit: is_two_stage: [0]
[    2.309554@4] magiskinit: Setup Magisk tmp at /sbin
[    2.376317@4] magiskinit: Setup cache: [cache] (179, 12)
[    2.378205@2] EXT4-fs (mmcblk0p12): mounted filesystem with ordered data mode. Opts: (null)
[    2.380411@2] magiskinit: Inject magisk services: [G8LHu8eGsiNe] [XpKHaxERzr]
[    2.392032@2] magiskinit: Replace [d30138f2310a9fb9c54a3e0c21f58591] -> [WsssukEtaoCgkW]
[    2.406143@2] magiskinit: Hijack [/proc/device-tree/firmware/android/fstab/compatible]
[    2.406914@2] magiskinit: opendir: /sbin/.magisk/mirror/cache/magisk failed with 2: No such file or directory
[    2.407817@2] magiskinit: Mount [.magisk/rootdir/init.rc] -> [/init.rc]
[    2.444364@2] magiskinit: Unmount [/sbin/.magisk/mirror/system_root]
[    2.462097@4] magiskinit: Unmount [/sbin/.magisk/mirror/cache]
[    2.492371@2] magiskinit: Unmount [/dev]
[    2.503636@2] init: init first stage started!
[    2.503733@2] init: Using Android DT directory /proc/device-tree/firmware/android/
[    2.524358@4] magiskinit: Hijack [/sys/fs/selinux/load]
[    2.524419@4] magiskinit: Hijack [/sys/fs/selinux/enforce]

is the missing magisk in cache a problem?
[ 2.406914@2] magiskinit: opendir: /sbin/.magisk/mirror/cache/magisk failed with 2: No such file or directory

@yujincheng08
Copy link
Collaborator

yujincheng08 commented Jun 27, 2022

Try the following in root shell:

OUTFD=1 ZIPFILE='/data/local/tmp/Log.Catcher.zip' ASH_STANDALONE=1 /sbin/.magisk/busybox/busybox sh -c '
. /data/adb/magisk/util_functions.sh
install_module
exit 0'

@finnzz
Copy link
Author

finnzz commented Jun 27, 2022

Try the following in root shell:

Ok, I got an error that busybox is missing

system/bin/sh: /sbin/.magisk/busybox/busybox: not found

This is what's in /sbin/.magisk/

raven:/sbin/.magisk # ls -l
total 4
d--------- 2 root root  60 2018-12-31 19:00 block
---------- 1 root root 126 2018-12-31 19:00 config
d--------- 4 root root 100 2018-12-31 19:00 mirror
drwxr-xr-x 2 root root   0 2018-12-31 19:00 pts
d--------- 2 root root 100 2018-12-31 19:00 selinux

@yujincheng08
Copy link
Collaborator

So the problem is that your installation missed busybox in magisk --path.

@finnzz
Copy link
Author

finnzz commented Jun 27, 2022

yea this is all that comes up:

1|raven:/sbin/.magisk # magisk --path                                                                                                        
/sbin

Is there anything I can do on my end to try to resolve this?

@canyie
Copy link
Collaborator

canyie commented Jun 27, 2022

ls -lZR /data/adb

@finnzz
Copy link
Author

finnzz commented Jun 27, 2022

ls -lZR /data/adb

raven:/ # ls -lZR /data/adb
/data/adb:
total 308
drwxr-xr-x 3 root    root          u:object_r:adb_data_file:s0   4096 2022-06-21 22:11 magisk
-rw------- 1 root    root          u:object_r:adb_data_file:s0  40960 2022-06-22 03:43 magisk.db
-rw-r--r-- 1 u0_a181 u0_a181_cache u:object_r:adb_data_file:s0 270080 2022-06-19 04:08 mmc

/data/adb/magisk:
total 2380
-rwxr-xr-x 1 root root u:object_r:adb_data_file:s0    3530 2022-06-21 22:11 addon.d.sh
-rwxr-xr-x 1 root root u:object_r:adb_data_file:s0    5954 2022-06-21 22:11 boot_patch.sh
-rwxr-xr-x 1 root root u:object_r:adb_data_file:s0 1461400 1979-11-30 00:00 busybox
drwxr-xr-x 2 root root u:object_r:adb_data_file:s0    4096 2022-06-21 22:11 chromeos
-rwxr-xr-x 1 root root u:object_r:adb_data_file:s0  148256 1979-11-30 00:00 magisk32
-rwxr-xr-x 1 root root u:object_r:adb_data_file:s0  316776 1979-11-30 00:00 magiskboot
-rwxr-xr-x 1 root root u:object_r:adb_data_file:s0  251412 1979-11-30 00:00 magiskinit
-rwxr-xr-x 1 root root u:object_r:adb_data_file:s0  205252 1979-11-30 00:00 magiskpolicy
-rwxr-xr-x 1 root root u:object_r:adb_data_file:s0   23892 2022-06-21 22:11 util_functions.sh

/data/adb/magisk/chromeos:
total 544
-rwxr-xr-x 1 root root u:object_r:adb_data_file:s0 548140 2022-06-21 22:11 futility
-rwxr-xr-x 1 root root u:object_r:adb_data_file:s0   1208 2022-06-21 22:11 kernel.keyblock
-rwxr-xr-x 1 root root u:object_r:adb_data_file:s0   1199 2022-06-21 22:11 kernel_data_key.vbprivk

@canyie
Copy link
Collaborator

canyie commented Jun 27, 2022

Try to run magisk --restorecon and reboot?

@finnzz
Copy link
Author

finnzz commented Jun 27, 2022

Try to run magisk --restorecon and reboot?

Ok, ran that command without any error and rebooted.

After reboot, modules is still grayed out. And busybox is still missing from the path

1|raven:/ # magisk --path                                                                                                                    
/sbin
raven:/sbin/.magisk # ls -l                                                                                                                  
total 4
d--------- 2 root root  60 2018-12-31 19:00 block
---------- 1 root root 126 2018-12-31 19:00 config
d--------- 4 root root 100 2018-12-31 19:00 mirror
drwxr-xr-x 2 root root   0 2018-12-31 19:00 pts
d--------- 2 root root 100 2018-12-31 19:00 selinux

@yujincheng08
Copy link
Collaborator

yujincheng08 commented Jun 27, 2022

try:

OUTFD=1 ZIPFILE='/data/local/tmp/Log.Catcher.zip' ASH_STANDALONE=1 /data/adb/magisk/busybox/busybox sh -c '
. /data/adb/magisk/util_functions.sh
install_module
exit 0'

@finnzz
Copy link
Author

finnzz commented Jun 27, 2022

try:

raven:/data/adb/magisk # OUTFD=1 ZIPFILE='/data/local/tmp/Log.Catcher.zip' ASH_STANDALONE=1 /data/adb/magisk/busybox sh -c '
> . /data/adb/magisk/util_functions.sh
> install_module
> exit 0'
- Current boot slot: normal
- Device is system-as-root
Archive:  /data/local/tmp/Log.Catcher.zip
  inflating: module.prop
*************
 Log Catcher 
 by Howard 
*************
*******************
 Powered by Magisk 
*******************
Archive:  /data/local/tmp/Log.Catcher.zip
  inflating: customize.sh
- Extracting module files
Archive:  /data/local/tmp/Log.Catcher.zip
  inflating: customize.sh
  inflating: module.prop
  inflating: post-fs-data.sh
  inflating: README.md
  inflating: service.sh
  inflating: util.sh
- Done

That installed, and then I rebooted the device. But I'm not seeing any log in /data/local/bootlog or /cache/bootlog. The icons module is still grayed out in magisk manager.

raven:/ # ls -lZR /data/adb
/data/adb:
total 316
drwxr-xr-x 3 root    root          u:object_r:magisk_file:s0     4096 2022-06-21 22:11 magisk
-rw------- 1 root    root          u:object_r:adb_data_file:s0  40960 2022-06-22 03:43 magisk.db
-rw-r--r-- 1 u0_a181 u0_a181_cache u:object_r:adb_data_file:s0 270080 2022-06-19 04:08 mmc
drwxrwxrwx 3 root    root          u:object_r:system_file:s0     4096 2022-06-21 22:16 modules
drwxrwxrwx 3 root    root          u:object_r:adb_data_file:s0   4096 2022-06-21 22:16 modules_update

/data/adb/magisk:
total 2380
-rwxr-xr-x 1 root root u:object_r:magisk_file:s0    3530 2022-06-21 22:11 addon.d.sh
-rwxr-xr-x 1 root root u:object_r:magisk_file:s0    5954 2022-06-21 22:11 boot_patch.sh
-rwxr-xr-x 1 root root u:object_r:magisk_file:s0 1461400 1979-11-30 00:00 busybox
drwxr-xr-x 2 root root u:object_r:magisk_file:s0    4096 2022-06-21 22:11 chromeos
-rwxr-xr-x 1 root root u:object_r:magisk_file:s0  148256 1979-11-30 00:00 magisk32
-rwxr-xr-x 1 root root u:object_r:magisk_file:s0  316776 1979-11-30 00:00 magiskboot
-rwxr-xr-x 1 root root u:object_r:magisk_file:s0  251412 1979-11-30 00:00 magiskinit
-rwxr-xr-x 1 root root u:object_r:magisk_file:s0  205252 1979-11-30 00:00 magiskpolicy
-rwxr-xr-x 1 root root u:object_r:magisk_file:s0   23892 2022-06-21 22:11 util_functions.sh

/data/adb/magisk/chromeos:
total 544
-rwxr-xr-x 1 root root u:object_r:magisk_file:s0 548140 2022-06-21 22:11 futility
-rwxr-xr-x 1 root root u:object_r:magisk_file:s0   1208 2022-06-21 22:11 kernel.keyblock
-rwxr-xr-x 1 root root u:object_r:magisk_file:s0   1199 2022-06-21 22:11 kernel_data_key.vbprivk

/data/adb/modules:
total 4
drwxrwxrwx 2 root root u:object_r:system_file:s0 4096 2022-06-21 22:16 hwr_logcat

/data/adb/modules/hwr_logcat:
total 4
-rw-r--r-- 1 root root u:object_r:system_file:s0 151 2022-06-21 22:16 module.prop
-rw-r--r-- 1 root root u:object_r:system_file:s0   0 2022-06-21 22:16 update

/data/adb/modules_update:
total 4
drwxr-xr-x 2 root root u:object_r:system_file:s0 4096 2022-06-21 22:16 hwr_logcat

/data/adb/modules_update/hwr_logcat:
total 16
-rw-r--r-- 1 root root u:object_r:system_file:s0  151 2022-06-21 22:16 module.prop
-rw-r--r-- 1 root root u:object_r:system_file:s0 2040 2022-06-21 22:16 post-fs-data.sh
-rw-r--r-- 1 root root u:object_r:system_file:s0  963 2022-06-21 22:16 service.sh
-rw-r--r-- 1 root root u:object_r:system_file:s0  720 2022-06-21 22:16 util.sh

@canyie
Copy link
Collaborator

canyie commented Jun 27, 2022

Pull out /cache/magisk.log and /cache/magisk.log.bak?

@finnzz
Copy link
Author

finnzz commented Jun 27, 2022

Pull out /cache/magisk.log and /cache/magisk.log.bak?

magisk.log.zip

@yujincheng08 yujincheng08 reopened this Jun 28, 2022
@vvb2060
Copy link
Collaborator

vvb2060 commented Jun 28, 2022

https://android.googlesource.com/platform/system/libsysprop/+/refs/tags/android-12.0.0_r34/srcs/api/PlatformProperties-latest.txt#93

  prop {
    api_name: "state"
    type: Enum
    scope: Internal
    prop_name: "ro.crypto.state"
    enum_values: "encrypted|unencrypted|unsupported"
  }

auto crypto = getprop("ro.crypto.state");
if (!crypto.empty()) {
if (crypto == "unencrypted") {
// Unencrypted, we can directly access data
return true;
} else {
// Encrypted, check whether vold is started
return !getprop("init.svc.vold").empty();
}
}

@yujincheng08
Copy link
Collaborator

app-debug.zip
Try this ver

@vvb2060 vvb2060 added the confirmed Issue confirmed to exist and the reason is known label Jun 28, 2022
yujincheng08 added a commit to LSPosed/Metagisk that referenced this issue Jun 28, 2022
yujincheng08 added a commit to LSPosed/Metagisk that referenced this issue Jun 28, 2022
Fix topjohnwu#6042

Co-authored-by: vvb2060 <vvb2060@gmail.com>
@finnzz
Copy link
Author

finnzz commented Jun 28, 2022

Thank you @yujincheng08 @canyie @vvb2060 👍 👍 👍

Yes, this appears to have solved the issue. Zygisk is a 'yes' status, and modules are appearing. LogCatcher is generating log files in cache/bootlog, and Magisk's log indicates it's doing more now too.

magisk.log
modules
zygisk

@yujincheng08 yujincheng08 self-assigned this Jun 28, 2022
@MadTooth

This comment was marked as off-topic.

topjohnwu pushed a commit that referenced this issue Jul 1, 2022
Fix #6042

Co-authored-by: vvb2060 <vvb2060@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
confirmed Issue confirmed to exist and the reason is known
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants