Friday, February 14, 2020

How to remove bloatware from Oppo Reno Z

Its unbelievable how much bloatware apps are installed by defualt on Oppo phones. But there is a way to remove them using some simple command-line tools.

This article describes how to remove the bloatware installed by default on a new Oppo Reno Z using the adb tool.

Follow this guide to install ADB: 


To install ADB go here:


In Windows 10 using powershell, launch ADB as follows

cmd /c adb shell

 Most of the bloatware is installed under the package "com.coloros"

pm list packages | grep coloros

Here are the commands I used for removing the bloatware apps:

pm uninstall -k --user 0 com.coloros.gamespace
pm uninstall -k --user 0 com.coloros.weather.service
pm uninstall -k --user 0 com.coloros.weather2
pm uninstall -k --user 0 com.coloros.gallergy3d
pm uninstall -k --user 0 com.coloros.musiclink
pm uninstall -k --user 0 com.coloros.phonemanager
pm uninstall -k --user 0 com.coloros.calculator
pm uninstall -k --user 0 com.coloros.screenrecorder
pm uninstall -k --user 0 com.coloros.alarmclock
pm uninstall -k --user 0 com.coloros.compass2
pm uninstall -k --user 0 com.coloros.oppomultiapp
pm uninstall -k --user 0 com.coloros.soundrecorder
pm uninstall -k --user 0 com.coloros.oppopods
pm uninstall -k --user 0 com.coloros.onekeylockscreen
pm uninstall -k --user 0 com.coloros.video
pm uninstall -k --user 0 com.coloros.


That cleaned up quite a bit and removed icons from the screen.

Unfortunately, there were some apps I couldn't remove such as the Oppo Contacts, and Clone Phone.
I'd be interested to hear if anybody figured out how to remove them, or other bloatware found on their phone.

Restore uninstalled apps

The apps are not really deleted, they're just hidden. To view a list of all packages including the uninstalled apps use

pm list packages -u | grep coloros

To restore an app in adb shell

cmd package install-existing com.coloros.usbselection


Good luck


Thursday, September 12, 2019

Redis + Java + Redisson = Encoding issues

Using Reddison/Java to save to Redis, I noticed when using the redis-cli command-line client, that the saved records were encoded funny, as follows:


127.0.0.1:6379> hgetall SessionMap
 1) "\xfc(gB2muKkpNJVgDhiXQA5fGELNcFkFcBszLh5wqcXX"
 2) "\xfc\x0214"
 3) "\xfc(lh9wm3gpV767f6KrvZfVnHO5gKKUFMHfL1KJEsRC"
 4) "\xfc\x0214"

Following from their online documentation, in Java code, I had the following:

RMap map = redisson.getMap("SessionMap");
Turns out we need to specify the encoding of the string by using this bit of code instead:

RMap map = redisson.getMap("SessionMap", new StringCodec("UTF-8"));

Sunday, June 30, 2019

Docker Containers Missing!

For many months we've been trying to track down the cause for the sudden termination of our docker containers.

When running the "docker container ls" command, nothing is shown. It almost looks like they're missing.

  docker container ls  
 CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES  

However running the process command "docker ps -a" does indeed indicate that our containers were exited:

 [root@patient-archive-cpi centos]# docker ps -a  
 CONTAINER ID    IMAGE            COMMAND         CREATED       STATUS            PORTS        NAMES  
 4a9b66fdd624    aehrc/ontoserver:ctsa-5.2  "/run.sh run"      7 weeks ago     Exited (143) 2 days ago            ontoserver  
 9e8314f52de2    postgres          "docker-entrypoint.s…"  7 weeks ago     Exited (0) 2 days ago         5432/tcp      docker_db_1  


The command for viewing "dockers logs ", indicated that the container was being shutdown. But there were no errors or reason for the shutdown.


 2019-06-28 03:41:48.302Z INFO 1 --- [ Thread-4] s.b.w.s.c.AnnotationConfigServletWebServerApplicationContext : Closing org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@63d4e2ba: startup date [Fri May 10 04:11:42 GMT 2019]; root of context hierarchy  
 2019-06-28 03:41:48.313Z INFO 1 --- [ Thread-4] o.s.jmx.export.annotation.AnnotationMBeanExporter : Unregistering JMX-exposed beans on shutdown  
 2019-06-28 03:41:48.314Z INFO 1 --- [ Thread-4] o.s.jmx.export.annotation.AnnotationMBeanExporter : Unregistering JMX-exposed beans  
 2019-06-28 03:41:48.316Z INFO 1 --- [ Thread-4] o.s.scheduling.concurrent.ThreadPoolTaskExecutor : Shutting down ExecutorService 'batchRunner'  
 2019-06-28 03:41:48.319Z INFO 1 --- [ Thread-4] o.s.scheduling.concurrent.ThreadPoolTaskExecutor : Shutting down ExecutorService 'jobRunner'  
 2019-06-28 03:41:48.319Z INFO 1 --- [ Thread-4] o.s.scheduling.concurrent.ThreadPoolTaskExecutor : Shutting down ExecutorService 'auditReportJobRunner'  
 2019-06-28 03:41:48.329Z INFO 1 --- [ Thread-4] o.s.orm.jpa.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default'  
 2019-06-28 03:41:48.331Z INFO 1 --- [ Thread-4] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown initiated...  
 2019-06-28 03:41:48.343Z INFO 1 --- [ Thread-4] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown completed.  

Running the docker command for viewing events showed nothing of interest

 docker events --filter container=ontoserver --since '2019-06-27'  

After some digging around it turns out that there was an automated yum update to docker in the /var/log/yum.log

 Jun 28 03:41:44 Updated: docker-ce-cli.x86_64 1:18.09.7-3.el7  
 Jun 28 03:41:48 Updated: containerd.io.x86_64 1.2.6-3.3.el7  
 Jun 28 03:41:52 Updated: docker-ce.x86_64 3:18.09.7-3.el7  

Turns out in docker there's a feature for re-enabling the docker containers after a docker update called 'live-restore'
Added a file /etc/docker/daemon.json with the following contents
{
  "live-restore": true
}
Then restarted docker
systemctl reload docker

Friday, April 5, 2019

flutter "unable to start activity" "ensureInitializationComplete must be called after startInitialization"

Flutter app fails to launch with the following error:


 Caused by: java.lang.IllegalStateException: ensureInitializationComplete must be called after startInitialization  
     at io.flutter.view.FlutterMain.ensureInitializationComplete(FlutterMain.java:190)  
     at io.flutter.app.FlutterActivityDelegate.onCreate(FlutterActivityDelegate.java:156)  
     at io.flutter.app.FlutterActivity.onCreate(FlutterActivity.java:89)  
     at net.pawpalflutter.MainActivity.onCreate(MainActivity.java:10)  
     at android.app.Activity.performCreate(Activity.java:6672)  
     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1140)  
     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2612)  
     ... 9 more  


This error occurred when loading app from Android Studio to a mobile phone. It seems the transfer of the app may have been interrupted abruptly and didn't close properly, causing all subsequent transfers to fail.

The Solution

Power off and on the phone

Reference: https://github.com/flutter/flutter/issues/14513

Sunday, March 31, 2019

Intellij Dart Analysis Server Bad State: Too many elements

This error was also causing an issue "cannot find declaration to go to"
After doing a flutter upgrade, I had to do the following:

  1. Close IntelliJ
  2. delete the project's .idea folder and any *.iml files
  3. Reopen the project in intellij
If that doesn't work try File -> Invalidate caches / restart and repeat the steps above