Uninstall Android Plugin from device

M
MrMDM
boartlongyearmdm

Hello. Does anyone know of a way to uninstall an agent plugin from a currently enrolled Android 10 device without re-enrolling all devices? When I enrolled a bunch of Kyocera_DuraForcePro2 devices. The device they picked up

Kyocera_KC-S302_sotienterprisemdm_1.20.0.102.apk

When it needed to grab:

Kyocera_DuraForcePro2_sotienterprisefullmdm_1.19.2.118.apk

I have figured out how removed the plugins from the server. Now I need to uninstall the plugin from the device and for an upgrade using the profile on the server. I was also looking for a way to do this by scripting but I'm not sure if that's possible.

2 years ago
Android Scripting
ANSWERS
RS
Rafael Schäfer
2 years ago

Do it like for any other app.

So, if you know the bundleId (can be found in the applications tab) and then run the legacy script

uninstall bundleID

M
MrMDM
2 years ago

Thanks for this. I was able to uninstall the agent. Although when I try to upgrade the device to the new agent it won't allow me to. I tried pushing the agent as a package and I receieve the following error

2023-02-02 00:12:30.131|RxCachedThreadScheduler-5|D|DO|[DefaultCatalogProcessor.installApplication:1] installing enterprise APK /data/user/0/net.soti.mobicontrol.androidwork/app_tmp/MobiControl+Enterprise+Service.apk ...|
2023-02-02 00:12:30.137|RxCachedThreadScheduler-5|E|DO|[AndroidPackageManagerHelper.isPackageFileAvailable:2] Failed reading package '/data/user/0/net.soti.mobicontrol.androidwork/app_tmp/MobiControl+Enterprise+Service.apk' from disk|
2023-02-02 00:12:30.138|RxCachedThreadScheduler-4|D|DO|[net.soti.mobicontrol.i4.b.c:1] new permission RWXU_RWXG_RXO|
2023-02-02 00:12:30.138|RxCachedThreadScheduler-5|D|DO|[DefaultCatalogProcessor.installApplication:6] installApplication|
2023-02-02 00:12:30.140|RxCachedThreadScheduler-4|D|DO|[net.soti.mobicontrol.i4.b.e:3] chmod 775 /data/user/0/net.soti.mobicontrol.androidwork/app_tmp/MobiControl+Enterprise+Service.apk|
2023-02-02 00:12:30.141|RxCachedThreadScheduler-4|D|DO|[net.soti.mobicontrol.i4.b.c:1] new permission RWXU_RXG_XO|
2023-02-02 00:12:30.142|RxCachedThreadScheduler-5|E|DO|[AndroidPackageManagerHelper.isPackageFileAvailable:2] Failed reading package '/data/user/0/net.soti.mobicontrol.androidwork/app_tmp/MobiControl+Enterprise+Service.apk' from disk|
2023-02-02 00:12:30.142|RxCachedThreadScheduler-4|D|DO|[net.soti.mobicontrol.i4.b.e:3] chmod 751 /data/user/0/net.soti.mobicontrol.androidwork/app_tmp|
2023-02-02 00:12:30.142|RxCachedThreadScheduler-5|I|DO|[BaseApplicationInstallationManager.installApplicationAsync:1] Async application installation start|
2023-02-02 00:12:30.143|RxCachedThreadScheduler-4|D|DO|[net.soti.mobicontrol.i4.b.c:1] new permission RWXU_RXG_XO|
2023-02-02 00:12:30.143|RxCachedThreadScheduler-4|D|DO|[net.soti.mobicontrol.i4.b.e:3] chmod 751 /data/user/0/net.soti.mobicontrol.androidwork|
2023-02-02 00:12:30.144|RxCachedThreadScheduler-5|E|DO|[AndroidPackageManagerHelper.isPackageFileAvailable:2] Failed reading package '/data/user/0/net.soti.mobicontrol.androidwork/app_tmp/MobiControl+Enterprise+Service.apk' from disk|
2023-02-02 00:12:30.145|RxCachedThreadScheduler-4|D|DO|[net.soti.mobicontrol.i4.b.c:1] new permission RWU_RWG_RWO|
2023-02-02 00:12:30.147|RxCachedThreadScheduler-4|D|DO|[net.soti.mobicontrol.i4.b.e:3] chmod 666 /data/user/0/net.soti.mobicontrol.androidwork/app_tmp/MobiControl+Enterprise+Service.apk|
2023-02-02 00:12:30.154|RxCachedThreadScheduler-5|D|DO|[SynchronousApplicationInstallationListener.isPackageInstalled:1] Waiting for installation response with 15 minutes timeout|
2023-02-02 00:12:30.155|full-core-executor|D|DO|[AfwInstallationSession.doCommit:2] /data/user/0/net.soti.mobicontrol.androidwork/app_tmp/MobiControl+Enterprise+Service.apk|
2023-02-02 00:12:30.156|full-core-executor|E|DO|[AndroidPackageManagerHelper.isPackageFileAvailable:2] Failed reading package '/data/user/0/net.soti.mobicontrol.androidwork/app_tmp/MobiControl+Enterprise+Service.apk' from disk|
2023-02-02 00:12:30.166|main|D|DO|[AppCatalogContentFragment.notifyIfDownloadOrInstallationFailed:1] progress DOWNLOADING|
2023-02-02 00:12:30.209|main|D|DO|[AppCatalogContentFragment.notifyIfDownloadOrInstallationFailed:1] progress DOWNLOADING|
2023-02-02 00:12:30.218|Install-Handling-Thread|D|DO|[AfwDefaultApplicationInstallationManager$InstallationSessionCallback.onCreated:1] Installation session id: 150602850|
2023-02-02 00:12:30.240|Install-Handling-Thread|D|DO|[AfwDefaultApplicationInstallationManager$InstallationSessionCallback.onActiveChanged:1] Installation session id:150602850, progress : isInstallSuccessful: true|
2023-02-02 00:12:30.242|full-core-executor|E|DO|[AfwInstallationSession.doCommit:11] Failed to install [/data/user/0/net.soti.mobicontrol.androidwork/app_tmp/MobiControl+Enterprise+Service.apk]|java.io.IOException: Failed write to outstream
    at net.soti.mobicontrol.appcontrol.AfwInstallationSession.writeSession(SourceFile:8)
    at net.soti.mobicontrol.appcontrol.AfwInstallationSession.doCommit(SourceFile:8)
    at net.soti.mobicontrol.appcontrol.AfwInstallationSession.lambda$commit$0(SourceFile:1)
    at net.soti.mobicontrol.appcontrol.AfwInstallationSession.a(Unknown Source:0)
    at net.soti.mobicontrol.appcontrol.b.run(Unknown Source:2)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:462)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
    at java.lang.Thread.run(Thread.java:919)
Caused by: java.io.FileNotFoundException: /data/user/0/net.soti.mobicontrol.androidwork/app_tmp/MobiControl+Enterprise+Service.apk: open failed: ENOENT (No such file or directory)
    at libcore.io.IoBridge.open(IoBridge.java:496)
    at java.io.FileInputStream.<init>(FileInputStream.java:159)
    at java.io.FileInputStream.<init>(FileInputStream.java:115)
    at net.soti.mobicontrol.appcontrol.AfwInstallationSession.writeSession(SourceFile:1)
    ... 9 more
Caused by: android.system.ErrnoException: open failed: ENOENT (No such file or directory)
    at libcore.io.Linux.open(Native Method)
    at libcore.io.ForwardingOs.open(ForwardingOs.java:167)
    at libcore.io.BlockGuardOs.open(BlockGuardOs.java:252)
    at libcore.io.ForwardingOs.open(ForwardingOs.java:167)
    at android.app.ActivityThread$AndroidOs.open(ActivityThread.java:7430)
    at libcore.io.IoBridge.open(IoBridge.java:482)
    ... 12 more
M
MrMDM
2 years ago

I am also constantly getting these errors on the device and I can't figure out where they are coming from.

2023-02-02 00:12:30.002|RxCachedThreadScheduler-7|I|DO|[DelegatingTrustChecker.checkServerTrusted:5] Certificate is not trusted by provided keystore|java.security.cert.CertificateException: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.
    at com.android.org.conscrypt.TrustManagerImpl.checkTrustedRecursive(TrustManagerImpl.java:658)
    at com.android.org.conscrypt.TrustManagerImpl.checkTrustedRecursive(TrustManagerImpl.java:617)
    at com.android.org.conscrypt.TrustManagerImpl.checkTrusted(TrustManagerImpl.java:507)
    at com.android.org.conscrypt.TrustManagerImpl.checkServerTrusted(TrustManagerImpl.java:335)
    at android.security.net.config.NetworkSecurityTrustManager.checkServerTrusted(NetworkSecurityTrustManager.java:113)
    at android.security.net.config.NetworkSecurityTrustManager.checkServerTrusted(NetworkSecurityTrustManager.java:87)
    at android.security.net.config.RootTrustManager.checkServerTrusted(RootTrustManager.java:117)
    at net.soti.ssl.DelegatingTrustChecker.checkServerTrusted(SourceFile:3)
    at net.soti.ssl.DelegatingX509TrustManager.isChainTrusted(SourceFile:1)
    at net.soti.ssl.DelegatingX509TrustManager.checkServerTrusted(SourceFile:2)
    at com.android.org.conscrypt.Platform.checkServerTrusted(Platform.java:228)
    at com.android.org.conscrypt.ConscryptFileDescriptorSocket.verifyCertificateChain(ConscryptFileDescriptorSocket.java:407)
    at com.android.org.conscrypt.NativeCrypto.SSL_do_handshake(Native Method)
    at com.android.org.conscrypt.NativeSsl.doHandshake(NativeSsl.java:387)
    at com.android.org.conscrypt.ConscryptFileDescriptorSocket.startHandshake(ConscryptFileDescriptorSocket.java:226)
    at com.android.okhttp.internal.io.RealConnection.connectTls(RealConnection.java:196)
    at com.android.okhttp.internal.io.RealConnection.connectSocket(RealConnection.java:153)
    at com.android.okhttp.internal.io.RealConnection.connect(RealConnection.java:116)
    at com.android.okhttp.internal.http.StreamAllocation.findConnection(StreamAllocation.java:186)
    at com.android.okhttp.internal.http.StreamAllocation.findHealthyConnection(StreamAllocation.java:128)
    at com.android.okhttp.internal.http.StreamAllocation.newStream(StreamAllocation.java:97)
    at com.android.okhttp.internal.http.HttpEngine.connect(HttpEngine.java:289)
    at com.android.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:232)
    at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:465)
    at com.android.okhttp.internal.huc.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:131)
    at com.android.okhttp.internal.huc.DelegatingHttpsURLConnection.connect(DelegatingHttpsURLConnection.java:90)
    at com.android.okhttp.internal.huc.HttpsURLConnectionImpl.connect(HttpsURLConnectionImpl.java:30)
    at net.soti.mobicontrol.q7.c.q(SourceFile:1)
    at net.soti.mobicontrol.q7.c.n(SourceFile:2)
    at net.soti.mobicontrol.q7.a.d(SourceFile:4)
    at net.soti.mobicontrol.ui.appcatalog.DefaultCatalogProcessor.lambda$startNewDownload$8(SourceFile:1)
    at net.soti.mobicontrol.ui.appcatalog.DefaultCatalogProcessor.j(Unknown Source:0)
    at net.soti.mobicontrol.ui.appcatalog.z0.run(Unknown Source:6)
    at f.a.f0.e.a.f.w(SourceFile:3)
    at f.a.b.a(SourceFile:4)
    at f.a.f0.e.a.n$a.run(SourceFile:1)
    at f.a.v$a.run(SourceFile:2)
    at f.a.f0.g.m.run(SourceFile:2)
    at f.a.f0.g.m.call(SourceFile:1)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
    at java.lang.Thread.run(Thread.java:919)
Caused by: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.
    ... 44 more
RS
Rafael Schäfer
2 years ago

You were able o uninstall the agent? 
This sounds not correct, i assume you mean the plugin, right?

And what do you try to upgrade?

M
MrMDM
2 years ago

Yeah, sorry. I uninstalled the Plugin.

This is the cmd I used.

uninstall net.soti.mobicontrol.enterprise.kyocera

M
MrMDM
2 years ago

There is nothing really special about the setup. I have a default MobiControl agent with the cert that was installed when we purchased the service from SOTI. I'm not syncing anything with AD. I'm only using SOTI Identity but I'm not requiring the device to use a user to log in.

I'm using android enterprise and deploying from a QR Code the sends the phone to a specific group. I'm not sure if this is a SOTI issue or if it's a device issue. It has been happening on all devices that I have pulled logs from.

RS
Rafael Schäfer
2 years ago

I still don't got your problem right now. You asked for a script to uninstall the current installed plugin on the device which i provided to you and you said it worked. But What do you mean with 

...Although when I try to upgrade the device to the new agent it won't allow me to. I tried pushing the agent as a package and I receieve the following error...

Do you still mean the plugin or the agent? If you want to install the plugin (assigned to your device model), you just need to select the device and use the macro "install plugin". Then it installs the relevant plugin if there's on on the server.

A
AMMOD@SOTI
2 years ago

Hi MrMDM,

Thanks for posting on SOTI Pulse, thanks Rafael for responding to the post.

Kindly let us know if the aforementioned issue persists or if you have any further inquiries.

Kind regards,

Technical Support | SOTI Inc. |1.905.624.9828 | support@soti.net | www.soti.net |