Need help with enabling Diag port on Z3+ (E6553) with zROM v1.1 - Xperia Z4/Z3+ Q&A, Help & Troubleshooting

Hi all,
I have unlocked bootloader and flashed zROM v1.1 so I got root. I want to enable Diag port to connect phone to the QXDM. Here is what i know.
Most important files are /init.usbmode.sh and /init.usbmode.platform.sh:
/init.usbmode.sh:
-disables USB and writes VendorID
Code:
echo 0 > /sys/class/android_usb/android0/enable
echo ${VENDOR_ID} > /sys/class/android_usb/android0/idVendor
-it setups engineering port with /init.usbmode.platform.sh if "getprop perist.usb.eng" is set to 1
-writes PID and USB FUNCTION
Code:
echo ${PID} > /sys/class/android_usb/android0/idProduct
echo ${USB_FUNCTION} > /sys/class/android_usb/android0/functions
-enables USB
Code:
echo 1 > /sys/class/android_usb/android0/enable
/init.usbmode.platform.sh:
Code:
setup_engmode()
{
PID_PREFIX=0
SUPPORT_RMNET=1
case ${1} in
"mass_storage,adb") PID_PREFIX=6 ;;
"mtp,adb") PID_PREFIX=5 ;;
"rndis,adb")
PID_PREFIX=D
SUPPORT_RMNET=0
;;
*)
/system/bin/log -t ${TAG} -p i "No eng PID for: ${1}"
exit 1
;;
esac
PID=${PID_PREFIX}146
USB_FUNCTION=${1},serial,diag
echo diag > /sys/class/android_usb/android0/f_diag/clients
echo smd,tty > /sys/class/android_usb/android0/f_serial/transports
if [ ${SUPPORT_RMNET} -eq 1 ] ; then
USB_FUNCTION=${USB_FUNCTION},rmnet
echo qti,bam2bam_ipa > /sys/class/android_usb/android0/f_rmnet/transports
fi
echo "${PID} ${USB_FUNCTION}"
exit 0
}
set_rndis_qc()
{
(...)
}
case ${1} in
"eng_setup")
if [ $# -ne 2 ] ; then
exit 1
fi
setup_engmode ${2}
;;
"set_rndis_qc")
set_rndis_qc
exit 0
;;
esac
-returns PID and USB_FUNCTION to /init.usbmode.sh, By default phone has USB_FUNCTION set to "mtp,adb" so there should be PID=5146 and USB_FUNCTION=mtp,adb,serial,diag,rmnet
-echoes
Code:
echo diag > /sys/class/android_usb/android0/f_diag/clients
echo qti,bam2bam_ipa > /sys/class/android_usb/android0/f_rmnet/transports
The main issue is that "getprop perist.usb.eng" doesn't exist.
As you know this Android runs on SE Linux. In /property_contexts file we can find following lines:
Code:
#line 1 "vendor/semc/system/sepolicy/Bootstrap_Applications/1.0.0/usbeng/property_contexts"
persist.usb.eng u:object_r:usb_eng_prop:s0
sys.usb.diag_mode u:object_r:usb_diag_mode_prop:s0
persist.sys.usb.config u:object_r:usb_config_prop:s0
persist.service.adb.enable u:object_r:usb_adb_enable_prop:s0
Only "persist.sys.usb.config " is visible in getprop command. This custom ROM has script located in /system/su.d/permissive.sh which enables permissive mode on SE Linux:
Code:
#!/system/bin/sh
/system/bin/setenforce 0
So in theory restrictions to the file types and process domains should not operate. Correct me if I am wrong.
Also there is a file /system/bin/usbeng which should be stared as a service by /init.sony.usb.rc
Code:
#Start usbeng
service usbeng /system/bin/usbeng
user system
group system
class late_start
oneshot
But it can't be seen in services list or process list. Also "getprop init.svc.usbeng" says it is "stopped". We can find SE Linux properties of this file in /file_contexts:
Code:
#line 1 "vendor/semc/system/sepolicy/Bootstrap_Applications/1.0.0/usbeng/file_contexts"
/system/bin/usbeng u:object_r:usbeng_exec:s0
I have tried echoing mentioned lines with a script:
Code:
echo 0 > /sys/class/android_usb/android0/enable
echo diag > /sys/class/android_usb/android0/f_diag/clients
echo qti,bam2bam_ipa > /sys/class/android_usb/android0/f_rmnet/transports
echo 5146 > /sys/class/android_usb/android0/idProduct
echo mtp,adb,serial,diag,rmnet > /sys/class/android_usb/android0/functions
echo 1 > /sys/class/android_usb/android0/enable
But last line seems to fail and USB doesn't get enabled and reboot is needed.
Seems that SE Linux is one of main reasons that Diag port can't be enabled. In effect there is lack of "persist.usb.eng" "sys.usb.diag_mode" in "getprop" command and "usbeng" service. Here comes question to you guys. Do you have idea how to enable mentioned properties and service? I will very appreciate any help or information that will help me enabling Diag port.
Best regards,
Piotr

solution?
did you find the solution, i need the same?

same here, i'm xperia z3 user

Related

Tweak init.d script prevents boot

Hello everyone!
I made this script for myself from stuff I found online. But when I put it into init.d the phone stops booting before the cyanogen logo comes up (on the second LG logo). I can't figure out why... However it works (the settings are applied) if I run it with adb once the phone is booted.
This is the script:
Code:
#!/system/bin/sh
echo "0,1,2,4,6,15" > /sys/module/lowmemorykiller/parameters/adj;
echo "1536,2048,4096,10240,12800,15360" > /sys/module/lowmemorykiller/parameters/minfree;
# vm management tweaks:
echo "4096" > /proc/sys/vm/min_free_kbytes;
echo "1" > /proc/sys/vm/oom_kill_allocating_task;
echo "0" > /proc/sys/vm/panic_on_oom;
echo "0" > /proc/sys/vm/laptop_mode;
echo "0" > /proc/sys/vm/swappiness;
echo "70" > /proc/sys/vm/vfs_cache_pressure;
echo "15" > /proc/sys/vm/dirty_ratio;
echo "3" > /proc/sys/vm/dirty_background_ratio;
# misc kernel tweaks:
echo "8" > /proc/sys/vm/page-cluster;
#echo "64000" > /proc/sys/kernel/msgmni;
#echo "64000" > /proc/sys/kernel/msgmax;
echo "10" > /proc/sys/fs/lease-break-time;
#echo "500,512000,64,2048" > /proc/sys/kernel/sem;
# CPU scheduler tweaks:
#echo "1000000" > /proc/sys/kernel/sched_latency_ns;
#echo "25000" > /proc/sys/kernel/sched_wakeup_granularity_ns;
#echo "100000" > /proc/sys/kernel/sched_min_granularity_ns;
echo "-1" > /proc/sys/kernel/sched_rt_runtime_us ;
echo "100000" > /proc/sys/kernel/sched_rt_period_us;
echo "95000" > /proc/sys/kernel/sched_rt_runtime_us;
# battery tweaks:
echo "3000" > /proc/sys/vm/dirty_expire_centisecs;
echo "500" > /proc/sys/vm/dirty_writeback_centisecs;
echo "500" > /proc/sys/vm/dirty_expire_centisecs;
echo "1000" > /proc/sys/vm/dirty_writeback_centisecs;
echo "0" > /proc/sys/vm/oom_kill_allocating_task;
tune2fs -o journal_data_writeback /dev/block/mmcblk0p1;
tune2fs -O ^has_journal /dev/block/mmcblk0p1;
tune2fs -o journal_data_writeback /dev/block/mmcblk0p2;
tune2fs -O ^has_journal /dev/block/mmcblk0p2;
tune2fs -f -o journal_data_writeback /dev/block/mmcblk0p8;
tune2fs -f -O ^has_journal /dev/block/mmcblk0p8;
mount -o remount,noatime,noauto_da_alloc,nodev,nodiratime,barrier=0,nobh /system;
mount -o remount,noatime,noauto_da_alloc,nosuid,nodev,nodiratime,barrier=0,nobh /data;
mount -o remount,noatime,noauto_da_alloc,nosuid,nodev,nodiratime,barrier=0,nobh /cache;
rm -f /data/system/userbehavior.db;
chmod 400 /data/system/usagestats/;
chmod 400 /data/system/appusagestats/;
rm -f /dev/log/main;
echo "2048" > /sys/devices/virtual/bdi/179:0/read_ahead_kb;
echo "2048" > /sys/devices/virtual/bdi/default/read_ahead_kb;
setprop net.dns1 8.8.8.8;
setprop net.dns2 8.8.4.4;
setprop windowsmgr.support_rotation_270 true;
setprop persist.service.pcsync.enable 0;
setprop persist.service.lgospd.enable 0;
setprop user.feature.flex true;
setprop user.feature.lgdrm false;
setprop user.feature.lgresource false;
setprop user.feature.lgpoweroff false;
setprop user.feature.ls_event false;
setprop user.feature.ls_normal false;
setprop user.feature.sui false;
setprop media.stagefright.enable-player false;
setprop media.stagefright.enable-meta true;
setprop media.stagefright.enable-scan true;
setprop media.stagefright.enable-http true;
echo "0" > /proc/sys/net/ipv4/tcp_timestamps;
echo "1" > /proc/sys/net/ipv4/tcp_tw_reuse;
echo "1" > /proc/sys/net/ipv4/tcp_sack;
echo "1" > /proc/sys/net/ipv4/tcp_tw_recycle;
echo "1" > /proc/sys/net/ipv4/tcp_window_scaling;
echo "5" > /proc/sys/net/ipv4/tcp_keepalive_probes;
echo "30" > /proc/sys/net/ipv4/tcp_keepalive_intvl;
echo "30" > /proc/sys/net/ipv4/tcp_fin_timeout;
echo "404480" > /proc/sys/net/core/wmem_max;
echo "404480" > /proc/sys/net/core/rmem_max;
echo "256960" > /proc/sys/net/core/rmem_default;
echo "256960" > /proc/sys/net/core/wmem_default;
echo "4096,16384,404480" > /proc/sys/net/ipv4/tcp_wmem;
echo "4096,87380,404480" > /proc/sys/net/ipv4/tcp_rmem;
MAX_PHONE()
{
pidphone=`pidof com.android.phone`;
if [ $pidphone ];
then
/system/xbin/echo "-17" > /proc/$pidphone/oom_adj;
renice -20 $pidphone;
exit;
else
MAX_PHONE;
fi;
}
MAX_ACORE()
{
pidacore=`pidof android.process.acore`;
if [ $pidacore ];
then
/system/xbin/echo "-17" > /proc/$pidacore/oom_adj;
renice -3 $pidacore;
exit;
else
MAX_ACORE;
fi;
}
MAX_MEDIA()
{
pidmedia=`pidof android.process.media`;
if [ $pidmedia ];
then
/system/xbin/echo "-17" > /proc/$pidmedia/oom_adj;
renice -20 $pidmedia;
exit;
else
MAX_MEDIA;
fi;
}
MAX_UI()
{
pidui=`pidof com.android.systemui`;
if [ $pidui ];
then
/system/xbin/echo "-17" > /proc/$pidui/oom_adj;
renice -20 $pidui;
exit;
else
MAX_UI;
fi;
}
Thanks!
user.feature.lgdrm=false disable DRM Service, so you can not use the default phone ringtones and notifications but if you are planning to use your custom files without DRM then there are no problems.
Regards.

samsung ultra power save mode

Can I use gasket to enable upsm at 5% ? I'm complete noob so will need talking through thanks
ROOT + shell
echo "0" > /sys/devices/virtual/mdnie/mdnie/accessibility
echo "1" > /sys/devices/virtual/mdnie/mdnie/accessibility
echo "2" > /sys/devices/virtual/mdnie/mdnie/accessibility
echo "3" > /sys/devices/virtual/mdnie/mdnie/accessibility
0 : Normal Screen
1 : Inverted Colors
2 : Ultra Power Save Mode
3 : Screen off but not locked and touchscreen is still working
Thanks for reply but that means nothing to me?
No one with a basic guide
Do you have ROOT?
If not, you can"t auto turn on UPSM.
Yes I have root
@bandit250
you are still interested?
Yes please
First, Make a test.
Task:
1. Run shell [mark ROOT]
Command:
echo "2" > /sys/devices/virtual/mdnie/mdnie/accessibility
Push play
upsm should turn on.
Hi I get this error
17.49.16/E Run Shell: ->
17.49.16/E Run Shell: ->
17.49.16/E Run Shell: ->
17.49.16/Shell runBackground echo "2" > /sys/devices/virtual/mdnie/mdnie/accessibility root: true timeout: -1
17.49.16/Shell start process-thread ID 4097
17.49.16/E add wait type Shell1 time 2147483647
17.49.16/E add wait type Shell1 done
17.49.16/E add wait task
17.49.16/E Error: 1

/system/su.d

Hello. I found same questions in other topics, but couldn't find answer.
I would like run script from /system/su.d folder:
Code:
#!/system/bin/sh
echo 0 > /sys/fs/selinux/enforce
or
Code:
#!/system/bin/sh
setenforce 0
and I even tried to run test script:
Code:
#!/system/bin/sh
touch /data/local/tmp/test.txt
echo "test" >> /data/local/tmp/test.txt
But no one of them works. I tried different names for files, gave different chmod (644,700,755). Nothing helps me to run script.
Mb somebody can give me advice what's problem can be?
Phone: Xperia Z3c, MM, systemless SuperSU
On other phone (Xperia M5) this all works fine.
I have a the same problem with a different file in /system/su.d,
Code:
#!/system/bin/sh
logfile0=/data/local/tmp/exfat_mount.log
#logfile=$logfile0
logfile=/dev/null
if [ -e $logfile0 ]; then
logfile=$logfile0
fi
echo '******' $(date) '******' >> $logfile
echo 'id: ' $(id) >> $logfile 2>&1
if [ x$SECONDARY_STORAGE == x ]; then
SECONDARY_STORAGE=/storage/sdcard1
fi
device=/dev/block/mmcblk1p1
echo "Starting for $device" >> $logfile
while read line; do
words=($line)
if [ ${words[0]} == $device ]; then
echo "Error: $device already mounted:" >> $logfile
echo "$line" >> $logfile
exit 1
fi
if [ ${words[1]} == $SECONDARY_STORAGE ]; then
echo "Error: SECONDARY_STORAGE already in use:" >> $logfile
echo "$line" >> $logfile
exit 1
fi
done < /proc/mounts
binpath=/system/xbin
probe=$binpath/probe
if [ ! -e $probe ]; then
echo "Error: $probe not found!" >> $logfile
exit 1
fi
FS=($($probe $device))
echo "$device file system:" ${FS[0]} >> $logfile
# ***** Setup tools for different file systems:
if [ ${FS[0]} == "exFAT" ]; then
echo "$device is exFAT" >> $logfile
mount=$binpath/mount.exfat
if [ -f $mount ]; then
links=( "mkfs.exfat" "fsck.exfat" "dumpexfat" "exfatfsck" "exfatlabel" "mkexfatfs" "mount.exfat-fuse" )
for l in "${links[@]}"
do
if [ ! -e $binpath/$l ]; then
mount -o remount,rw /
ln -s $mount $binpath/$l
echo "Created symlink $binpath/$l" >> $logfile
fi
done
fi
fsck=$binpath/exfatfsck
fsck_ops=
elif [ ${FS[0]} == "NTFS" ]; then
echo "$device is NTFS" >> $logfile
mount=$binpath/ntfs-3g
fsck=$binpath/ntfsfix
fsck_ops='-n'
else
echo "Error: $device is not supported!" >> $logfile
exit 1
fi
# ***** Check if we have required tools.
if [ ! -e $mount ]; then
echo "Error: $mount not found!" >> $logfile
exit 1
fi
if [ ! -e $fsck ]; then
echo "Error: $fsck not found!" >> $logfile
exit 1
fi
# ***** Mount for rw only if the file system is not damaged.
options_ro="ro,uid=1023,gid=1023,umask=0000"
options_rw="rw,uid=1023,gid=1023,umask=0000,noatime"
mnt_cmd="$mount -o $options_rw $device /mnt/media_rw/sdcard1"
$fsck $fsck_ops $device >> $logfile 2>&1
if [ $? != 0 ]; then
mnt_cmd="$mount -o $options_ro $device /mnt/media_rw/sdcard1"
fi
echo "$mnt_cmd" >> $logfile
if [ -e /sys/fs/selinux/enforce ]; then
if [ -e /system/xbin/supolicy ]; then
# ***** Set permissions for fuse. Instead, our mounts would be RO for others.
echo "Using supolicy to provide permissions to fuse." >> $logfile
/system/xbin/supolicy --live "allow sdcardd unlabeled dir { append create execute write relabelfrom link unlink ioctl getattr setattr read rename lock mounton quotaon swapon rmdir audit_access remove_name add_name reparent execmod search open }"
/system/xbin/supolicy --live "allow sdcardd unlabeled file { append create write relabelfrom link unlink ioctl getattr setattr read rename lock mounton quotaon swapon audit_access open }"
/system/xbin/supolicy --live "allow unlabeled unlabeled filesystem associate"
/system/xbin/supolicy --live "allow sdcardd unlabeled filesystem { getattr mount remount unmount }"
/system/xbin/supolicy --live "allow vold unlabeled filesystem { getattr mount remount unmount }"
/system/xbin/supolicy --live "allow init unlabeled filesystem { getattr mount remount unmount }"
else
# ***** Turn SELinux to Permissive. Instead, our mounts would be RO for others.
echo "Using setenforce 0 to provide permissions to fuse." >> $logfile
setenforce 0
fi
fi
# ***** Try to mount:
if [ 0 != 0 ]; then
$mount -o $options_rw $device $SECONDARY_STORAGE
echo "Mounted directly" >> $logfile
else
mount -o remount,rw /system
rm -f /system/bin/debuggerd.mine
echo '#!/system/bin/sh' > /system/bin/debuggerd.mine
echo "$mnt_cmd" >> /system/bin/debuggerd.mine
echo 'start fuse_sdcard1' >> /system/bin/debuggerd.mine
chmod 777 /system/bin/debuggerd.mine
stop debuggerd
mv /system/bin/debuggerd /system/bin/debuggerd.its
mv /system/bin/debuggerd.mine /system/bin/debuggerd
start debuggerd
sleep 2
stop debuggerd
mv /system/bin/debuggerd /system/bin/debuggerd.mine
mv /system/bin/debuggerd.its /system/bin/debuggerd
start debuggerd
mount -o remount,ro /system
vdc volume mount $SECONDARY_STORAGE
echo "Mounted via debuggerd" >> $logfile
fi
The file is called 00mountsd and is used to give access to exfat microsd on stock android 5.1 running on a Chuwi Hi10pro tablet with cherry trail z8350 cpu. I used this on a previous version of the tablet and it worked fine although that tablet came with RemixOS.
The file runs without errors when run manually and succeeds at it task
ls -lZ returns this -rwxr-xr-x root root u: object_r:system_file:s0 00mountsd
I'm running SuperSU Free v2.79 everything else works fine.
Any ideas?

Badly made antivirus script I created

Bash:
#This script is satire. This is, like, the worst antivirus ever.
tput setaf 2
echo "Welcome to Web Antivirus."
echo "Make sure you are running this from a live Linux image as the root user."
lsblk
echo "Select your Windows drive: "
read drive
mount $drive /mnt
cd /mnt/Windows/system32/etc
wget https://github.com/T145/black-mirror/releases/download/latest/black_domain.txt >> /dev/null
wget https://github.com/T145/black-mirror/releases/download/latest/black_ipv4.txt >> /dev/null
echo "Downloaded blacklists."
cp hosts.txt hosts.txt.bak
mawk '{print "0.0.0.0 " $0}' black_domain.txt >> hosts.txt
echo "Wrote domain blacklist."
mawk '{print "0.0.0.0 " $0}' black_ipv4.txt >> hosts.txt
echo "Wrote IPv4 blacklist"
rm -f black_domain.txt black_ipv4.txt
echo "Deleted temporary files."
cd /mnt
echo "@echo off" > clean.bat
echo "del %userprofile%\\Downloads\\*.exe" >> clean.bat
echo "Created cleaner script."
echo "Put this in Task Scheduler so it runs at regular intervals."
echo "Options:"
echo "Type \"restore\" to restore original /etc/hosts."
echo "Type \"exit\" to leave."
echo "Select an option: "
alias restore="rm -f hosts.txt && mv hosts.txt.bak hosts.txt"
read option
$option

How To Guide How to configure the WiFI in Android via script

In the current version of Android the WiFi configuration is stored in the file
/data/misc/apexdata/com.android.wifi/WifiConfigStore.xml
e.g.
Code:
ASUS_I006D:/ # ls -lZtr /data/misc/apexdata/com.android.wifi/WifiConfigStore.xml
-rw------- 1 system system u:object_r:apex_system_server_data_file:s0 4884 2023-01-29 08:55 /data/misc/apexdata/com.android.wifi/WifiConfigStore.xml
ASUS_I006D:/ #
The file is in plain ASCII xml format so it can be processed by any executable to change text files (editor, sed, etc).
But IMHO it's better to configure the WiFi manually via GUI and then use the file WifiConfigStore.xml with that configuration for configuring the WiFi via script. Therefor I use this code in the post install script to install and configure my phone (see How to install and configure the Android OS via Script):
Spoiler: script commands to enable and configure WiFi
Bash:
#
# sample post install script for the customizing of the phone
#
# This script will be copied to the phone and executed there
#
# The script is executed by the user shell; use "su - -c <command>" to execute commands as user root
#
echo ""
echo "*** Postinstall script is running ..."
echo ""
# ... other customizations ....
#
# create the WiFi config file
#
# -rw------- 1 system system u:object_r:apex_system_server_data_file:s0 4884 2023-01-29 08:55 /data/misc/apexdata/com.android.wifi/WifiConfigStore.xml
#
WIFI_CONFIG_FILE="/data/misc/apexdata/com.android.wifi/WifiConfigStore.xml"
WIFI_CONFIG_FILE_BACKUP="${WIFI_CONFIG_FILE}.$$.bkp"
NEW_WIFI_CONFIG_FILE="/sdcard/Download/WifiConfigStore.xml"
if [ -r "${WIFI_CONFIG_FILE}" ] ; then
echo "Creating a backup of the file \"${WIFI_CONFIG_FILE}\" in \"${WIFI_CONFIG_FILE_BACKUP}\" ...."
cp "${WIFI_CONFIG_FILE}" "${WIFI_CONFIG_FILE_BACKUP}"
fi
echo "Creating the file \"${NEW_WIFI_CONFIG_FILE}\" ..."
cat >"${NEW_WIFI_CONFIG_FILE}" <<-\EOT
*** add here the contents of the file /data/misc/apexdata/com.android.wifi/WifiConfigStore.xml from the phone after manually configuring the WLAN
EOT
if [ $? -eq 0 ] ; then
echo "Creating the file \"${WIFI_CONFIG_FILE}\" ..."
su - -c cp "${NEW_WIFI_CONFIG_FILE}" "${WIFI_CONFIG_FILE}" && \
su - -c chmod 600 "${WIFI_CONFIG_FILE}" && \
su - -c chown system:system "${WIFI_CONFIG_FILE}" && \
su - -c chcon -v "u:object_r:apex_system_server_data_file:s0" "${WIFI_CONFIG_FILE}"
if [ $? -ne 0 ] ; then
echo "Error creating the file \"${WIFI_CONFIG_FILE}\" "
fi
else
echo "Error creating the file \"${NEW_WIFI_CONFIG_FILE}\" "
fi
# enable WiFi
#
echo "Enabling WiFi ..."
svc wifi enable
# optional: Disable mobile data connections
#
echo "Disabling mobile data ..."
svc data disable
# Now reboot the phone to activate the new WiFi config ..
#
echo "Waiting 15 seconds now before rebooting - press CTRL-C to abort ...."
i=0
while [ $i -lt 15 ] ; do
(( i = i + 1 ))
printf "."
sleep 1
done
printf "\n"
echo "Now rebooting the phone ..."
reboot
#
Notes:
Be aware the the file /data/misc/apexdata/com.android.wifi/WifiConfigStore.xml contains the passwords for all configured WLANs in plain text.
There should be a command to force Android to reread the file WifIConfigStore.xml but I don't know that.
Android can be forced to re-read the file WifIConfigStore.xml by killing the process system_server, e.g:
Bash:
pkill system_server
But that is more or less a warm reboot and I do not know what other side effects that restart triggers
There is an app to configure WiFi via adb command
https://github.com/steinwurf/adb-join-wifi
Bash:
adb shell am start -n com.steinwurf.adbjoinwifi/.MainActivity -e ssid myssid -e password mywlan_password -e password_type WPA
The app works but unfortunately it does not support enabling the setting to use the device MAC instead of the random MAC so it's not usable in my environment.
Another app to configure WiFi via adb command is available here:
https://github.com/pr4bh4sh/adb-wifi-setting-manager
Unfortunately that app also does not support enabling choosing the MAC address for the connection.
There is also a script to convert an old Android wpa_supplicant.conf file to the newer (post-Oreo) WifiConfigStore.xml file (not tested):
https://github.com/mnalis/android-wifi-upgrade
It's also possible to use the command wpa_cli to configure WiFi but be aware the wpa_cli only works if selinux is (temporary) disabled, example:
Spoiler: wpa_cli example
Code:
ASUS_I006D:/ $ su -
ASUS_I006D:/ #
ASUS_I006D:/ # setenforce 0
ASUS_I006D:/ #
ASUS_I006D:/ #
ASUS_I006D:/ # wpa_cli
wpa_cli v2.10-devel-11
Copyright (c) 2004-2019, Jouni Malinen <[email protected]> and contributors
This software may be distributed under the terms of the BSD license.
See README for more details.
Using interface 'wlan0'
Interactive mode
<3>Control interface command 'BSS RANGE=ALL MASK=0x2'
<3>Control interface command 'LIST_CREDS'
<3>Control interface command 'LIST_NETWORKS'
<3>Control interface command 'STA-FIRST'
>
> list_networks
network id / ssid / bssid / flags
0 Zeilsheim any [CURRENT]
1 any [DISABLED]
<3>Control interface command 'LIST_NETWORKS'
>
> quit
ASUS_I006D:/ #
Note: Use help to get list of known commands
Test Environment
I tested the WiFi config via script described above in these Android distributions:
OmniROM 13 (Android 13)
OmniROM 12 (Android 12)
ASUS Android 12
ASUS Android 13
This method seems not to work in Android 11

Categories

Resources