Tag Archives: export

Removing Android Bloatware and backing up Stock apps

Quite a lot of new Android devices come with lots of bloatware that is preinstalled on the phone/tablet. For some apps it’s possible to deactivate these apps in the built in app management. However, most apps are installed as system apps and do not provide the possibility to be uninstalled.

Thankfully there is a possibility to also remove these apps via ADB.

Before removing any app it’s advised to first create a backup of all the installed APKs in case you remove any app that might be needed and therefore cause errors.

adb shell pm list packages > installed_packages.txt

foreach($line in ( Get-Content .\installed_packages.txt) )
{
    $app=$line.Split(":")[1]
    $app_path=$(adb shell pm path $app).Split(":")[1]
    Write-Host -ForegroundColor Yellow "$app : $app_path"
    adb pull $app_path ".\backup\$app.apk"
}

The above script will create a backup of all APKs currently installed on the device (including the ones which have been installed by the user).
To successfully run the script, adb needs to be in the path and initially pairing between the PC and the Android device must be established.

Removing the bloatware:

adb shell pm uninstall--user 0 <packagename>

#e.g. for AR-emoti-apks provided by samsung
adb shell pm uninstall --user 0 com.samsung.android.aremoji

Lists of mappings between the readalbe name (like in the Android apps management) and the package name (for Samsung devices) can be found on https://docs.samsungknox.com (e.g. https://docs.samsungknox.com/CCMode/T878U_Q.pdf)

VM stuck in invalid state after export

After trying to export a VM and cancelling the export it could happen that the VM is nolonger responsive (no start, unregister, delete, … possible)

The hostd.log (in the /var/log directory on the ESXi) will show an error similar to:

2021-09-07T10:55:19.583Z error hostd[2099544] [Originator@6876 sub=Vmsvc.vm:/vmfs/volumes/XXXXXXXX-05c01598-574e-88d7f6d5ef52/myvm/myvm.vmx opID=esxui-6c72-aafe user=root] Invalid transition requested (VM_STATE_EXPORTING -> VM_STATE_DELETING): Invalid state
2021-09-07T10:55:19.583Z warning hostd[2099544] [Originator@6876 sub=Vmsvc.vm:/vmfs/volumes/XXXXXXXX-05c01598-574e-88d7f6d5ef52/myvm/myvm.vmx opID=esxui-6c72-aafe user=root] Method fault exception during VM destroy: Fault cause: vim.fault.InvalidPowerState

It seems the VM is somehow stuck in the Exporting-state and therefore no other operation is possible on the VM .

As a workaround log in to the ESXi Host and restart the Management Agents (https://kb.vmware.com/s/article/1003490)

Zabbix 1.8 to 2.2 Upgrade

Lately I was asked to help to upgrade Zabbix from 1.8 to 2.2 in a project. It wasn’t a problem to upgrade the templates – that was easily done with a xml-export/import but the hosts where kind of a challenge because the exported xml-files for the hosts itself pretty differs between 1.8 and 2.2.

Because i already had the PhpZabbixApi (https://github.com/confirm/PhpZabbixApi/blob/master/README.md) installed on the tared system i decided to write a little script which pareses the 1.8-host export and creates the hosts in 2.2. The script inc. the lib is attached at the end of the post.

I tested the script with Zabbix 1.8.6->2.2.10 and everything worked fine. Currently the script is capable of creating the hosts (with Zabbix-agent & SNMP-interface), creating the host groups and adding the hosts to the correct host group and also linking the correct templates to the host. However, the templates need to be already available on the target system to be linked correctly.

After extracting the script on the target Zabbix server the xml-import from the old system needs to be uploaded into the same directory as the script (scp) and the login data for Zabbix need to be adapted in the script. Afterwards the import can be started from a bash via:

[pastacode lang=”bash” manual=”” message=”” highlight=”” provider=”manual”/]

Zabbix1.8_2.2_upgrade