[Q] Getting Exception while uninstalling app using ddmlib 23.1.3.jar - Android Q&A, Help & Troubleshooting

hii guys I am trying develop a java app that makes Android device into Kiosk i have started development using ddmlib23.1.3 jar i was able to succesfully uninstall the system apps using the sequence of adb commands (on a rooted device) now I am trying to uninstall user apps from the device where I am getting Exceptions
Trail 1:
device.executeShellCommand("pm uninstall "+apkName, receiver);//apkName contains package
I have kept Log for printing status i got following messages
Uninstalling : com.foxit.mobile.pdf.lite
..
Status :
..
Status :
..
Running Command : pm uninstall com.foxit.mobile.pdf.lite
..
Status : Failure
Trail 2:
i got status as Failure so i have included 'su' permission for command
device.executeShellCommand("su -c 'pm uninstall "+apkName+"'", receiver);
package Name : /data/app/com.foxit.mobile.pdf.lite-1.apk=com.foxit.mobile.pdf.lite
..
Uninstalling : com.foxit.mobile.pdf.lite
..
Status :
..
Status :
..
Running Command : su -c 'pm uninstall com.foxit.mobile.pdf.lite'
..
Status : Segmentation fault
Trail 3:
then i tried with the default method in the API
String status = device.uninstallPackage(apkName);
then i got following messages in log
..
package Name : /data/app/com.foxit.mobile.pdf.lite-1.apk=com.foxit.mobile.pdf.lite
..
Status : Unknown failure
..
please help me how to solve this problem
thanks in advance

Related

[Q][XU][JB] Unable to dev - Permission denied

Hello guys, I have a little problem with developing apps in my phone.
I installed Stock Android 4.1.2 v4 for my Xperia U ST25i ( http://forum.xda-developers.com/showthread.php?t=2284394 ) (I wanted to post this issue in this thread but i'm new here and I just can't... anyways, rules are rules), and i'm have some issues when I want test APK's in my phone via ADB or Eclipse-ADT.
When I click excecute ( or do adb install), the process will fail, showing me that:
Code:
[2013-07-23 16:40:48 - AWifiSignal] ------------------------------
[2013-07-23 16:40:48 - AWifiSignal] Android Launch!
[2013-07-23 16:40:48 - AWifiSignal] adb is running normally.
[2013-07-23 16:40:48 - AWifiSignal] Performing net.elsemieni.awifisignal.SplashActivity activity launch
[2013-07-23 16:40:48 - AWifiSignal] Automatic Target Mode: Unable to detect device compatibility. Please select a target device.
[2013-07-23 16:40:51 - AWifiSignal] WARNING: Unknown device API version!
[2013-07-23 16:40:51 - AWifiSignal] Uploading AWifiSignal.apk onto device 'YT9002B59S'
[2013-07-23 16:40:52 - AWifiSignal] Installing AWifiSignal.apk...
[2013-07-23 16:40:53 - AWifiSignal] Installation failed due to invalid APK file!
[2013-07-23 16:40:53 - AWifiSignal] Please check logcat output for more details.
[2013-07-23 16:40:53 - AWifiSignal] Launch canceled!
In simple words, doesn't install beacuse [INSTALL_FAILED_INVALID_APK] error code.
Of course, i have Debugging activated in my phone and install 3rd party applications.
By the way, Logcat gives me that
Code:
07-21 18:05:23.663: W/zipro(25492): Unable to open zip '/data/local/tmp/AWifiSignal.apk': Permission denied
07-21 18:05:23.673: W/PackageParser(25492): Unable to read AndroidManifest.xml of /data/local/tmp/AWifiSignal.apk
That's curious I can't write inside it. I searched the forums and I applied a workaroud solution (http://forum.xda-developers.com/showthread.php?p=40040546&postcount=4), to make a link from tmp to sdcard folder. It worked in this way, but ruined the phone sys after reboot ( crashes randomly, most critical app's frezzes, etc), so doesn't work.
I know that's a firmware bug, but... any ideas about this? There's another workaround to make tmp safely writable, or any way to change the folder who ADB uses to install apps remotely?
Thanks! :laugh:

[Q] Install and run apk.file

Is there any command on cmd.exe that would allow me to run apk.file after installing it .. like
adb install myapp.apk
This command will only install myapp onto the emulator and I have to manually run this application from the emulator (by performing single click on its icon).
What I want to do is use a command which not only installs the application but also run it or open it in the device after installation.
stiphen said:
Is there any command on cmd.exe that would allow me to run apk.file after installing it .. like
adb install myapp.apk
This command will only install myapp onto the emulator and I have to manually run this application from the emulator (by performing single click on its icon).
What I want to do is use a command which not only installs the application but also run it or open it in the device after installation.
Click to expand...
Click to collapse
http://delphi.org/2013/11/installing-and-running-android-apps-from-command-line/
I think that is what you are looking for
quentin330 said:
http://delphi.org/2013/11/installing-and-running-android-apps-from-command-line/
I think that is what you are looking for
Click to expand...
Click to collapse
after installing Myfile.apk
adb install Myfile.apk
and then try to run it in the device
adb shell am start -n com.other.Myfile.apk/.MainActivity
I get the error
Starting: Intent { cmp=com.other.Myfile.apk/ .MainActivity }
Error type 3
Error: Activity class {com.other.Myfile.apk/com.other.Myfile.apk.MainActivity} does not exist.
whereas Myfile.apk is installed
stiphen said:
after installing Myfile.apk
adb install Myfile.apk
and then try to run it in the device
adb shell am start -n com.other.Myfile.apk/.MainActivity
I get the error
Starting: Intent { cmp=com.other.Myfile.apk/ .MainActivity }
Error type 3
Error: Activity class {com.other.Myfile.apk/com.other.Myfile.apk.MainActivity} does not exist.
whereas Myfile.apk is installed
Click to expand...
Click to collapse
You have to remplace com.other by the name of the package and MainActivity by the name of the activity you want to open
quentin330 said:
You have to remplace com.other by the name of the package and MainActivity by the name of the activity you want to open
Click to expand...
Click to collapse
As in my first post .. I said I install apk file into my device by
adb install myfile.apk
OK it is installed into my device .. Now with command I want to open/run installed apk in my device .. I know i can normally run it by touching its icon .. but i want to do the same through the command ..
stiphen said:
As in my first post .. I said I install apk file into my device by
adb install myfile.apk
OK it is installed into my device .. Now with command I want to open/run installed apk in my device .. I know i can normally run it by touching its icon .. but i want to do the same through the command ..
Click to expand...
Click to collapse
That's what you can do with the commands but you have to know which activity to open and in which package it is
quentin330 said:
That's what you can do with the commands but you have to know which activity to open and in which package it is
Click to expand...
Click to collapse
as i am new .. i only know that i have installed an apk and is installed . now hoe come i know which package is this in and how can i run it

Get rid of MI Apps and other preinstalled apps

In the last MIUI update Xiaomi has disabled the option of disabling the notification for MI Apps which I don't want to use and don't want to see notifications from it. So, I searched the internet and found the trick.
Prerequisites:
1. PC with android SDK or Minimal ADB and Fastboot
Step 1 : Enable developer options on your phone
Step 2 : Enable USB debugging and USB debugging (Security settings) and connect it to your PC
Step 3 : Run Command Prompt as Administrator
Step 4 : Navigate to your ADB folder
Step 5 : Type
Code:
adb devices
Step 6 : then
Code:
adb shell
Step 7 : then
Code:
pm uninstall -k --user 0 com.xiaomi.mipicks
or any other package name you want to get rid of
Thats it. :good:
Enjoy
Dude, big thanks for this tutorial. It was pushing notifications 5 times a day.
I won't be updating this MIUI pos henceforth
Failure [Not installed for 0] error
After performing above steps to unistall Mi Apps ..I am getting error
failure [not installed for 0]
But I was able to uninstall Mi Browser and other google bloatwares.
Also tried disabling MIUI Optimization,
Suggest If there is a option.
I am having Redmi Note 4 with MIUI 9.5
EDIT :
I was entering wrong package name.Be carefull its com.xiaomi.mipicks....that 'a' sucks
Got rid of the error.
skysar said:
In the last MIUI update Xiaomi has disabled the option of disabling the notification for MI Apps which I don't want to use and don't want to see notifications from it. So, I searched the internet and found the trick.
Prerequisites:
1. PC with android SDK or Minimal ADB and Fastboot
Step 1 : Enable developer options on your phone
Step 2 : Enable USB debugging and USB debugging (Security settings) and connect it to your PC
Step 3 : Run Command Prompt as Administrator
Step 4 : Navigate to your ADB folder
Step 5 : Type
Code:
adb devices
Step 6 : then
Code:
adb shell
Step 7 : then
Code:
pm uninstall -k --user 0 com.xiaomi.mipicks
or any other package name you want to get rid of
Thats it. :good:
Enjoy
Click to expand...
Click to collapse
Call it a good disable because apps will be on phone. You can't get rid of them unless you root. Misleading headline.
Sag555 said:
After performing above steps to unistall Mi Apps ..I am getting error
failure [not installed for 0]
But I was able to uninstall Mi Browser and other google bloatwares.
Also tried disabling MIUI Optimization,
Suggest If there is a option.
I am having Redmi Note 4 with MIUI 9.5
EDIT :
I was entering wrong package name.Be carefull its com.xiaomi.mipicks....that 'a' sucks
Got rid of the error.
Click to expand...
Click to collapse
Thanks

Hisense U988 stuck at boot logo

Hi Greetings!
I would like to seek support from you all, as accidentally i had deleted my entire Hisense U988 mobile phone and now while turning onn it only show boot logo and if i am trying to flash stock rom it says no partition table found. Kindly help me sort out the issue or suggest me any custom rom or firmware or anything that i can try to start my phone.
-----------------------------------------------------------------
With GPT Tool in ADB Mode it says..
Checking ADB Device Connectioning Wait: Device Connected
Loading Information Please wait..........
Checking Root Wait : True
Manufacturer : error:closed
Model : error:closed
Version : error:closed
DisplayID : error:closed
BoardID : error:closed
CPU : error:closed
SN : error:closed
Incremental : error:closed
Hardware : error:closed
CodeBame : error:closed
Date : error:closed
Sdk : error:closed
User : error:closed
Type : error:closed
BuildID : error:closed
description : error:closed
Fingerprint : error:closed
----------—-———-------------——---------------------------
With GPT Tool in ADB Mode it says..
Checking Device Conecting.... Device Found
Reading Information from Connected Device
Model:U988
IMEI :
Build :
CID :
HBoot :
MID :
Security :
Region :
@KahlonEmpire
Try to re-flash phone's Stock ROM via ADB
Code:
adb devices
adb reboot sideload
adb sideload <FULL_PATH_TO_STOCK_ROM_ZIP_FILE_HERE>
adb reboot
Hisense U_988 stuck
Hi Greetings!
Really appreciate your quick response on the subject post, I tried to reflash the zip file as described by you through adb sideload but unfortunately this method even doesn't work.
An error is popping on the phone screen as written below.....
Finding update package.......
Opening update package....
Verifying update package...
E : footer is wrong
E : signature verification failed
Installation aborted
@KahlonEmpire
My guess is that ROM image used is not packaged for installation via ADB sideload: Never had such an issue.
@jwoegerbauer
Dear could you help me find out the accurate image file that i can install via ADB Sideload.
I would be really greatfull if you can share any link from where i can download the file. Please

[help] android 11 AOSP : install modified gboard.apk [apktool] [root]

hello, and thanks for helping me.
i have a redmi k20 pro with evolutionX on android 11, rooted with magisk 21.1
i modified the gboard.apk with apktool, recompiled sucessfully.
the problem is i can't manage to install, it, for multiple reasons :
(i added extractNativeLibs="true" to androidmanifest because without it apktool would compile, dunno if it could be problem)
first i tried to uninstall the origin gboard on my device (i got another keyboard installed don't worry)
so
Bash:
pm uninstall com.google.android.inputmethod.latin
Success
but then when i try to install adb install gboard.apk :
Code:
Performing Streamed Install
adb: failed to install gboard.apk: Failure [INSTALL_PARSE_FAILED_NO_CERTIFICATES: Failed collecting certificates for /data/app/vmdl430916923.tmp/base.apk: Failed to collect certificates from /data/app/vmdl430916923.tmp/base.apk: Attempt to get length of null array]
so the apk need to be signed even if i uninstalled the previous app ? i tried to disable signature verification with lucky patcher (see below) and smali pather (doesn't boot)
i tried to sign the apk, with those steps :
Code:
keytool -genkey -v -keystore debug.keystore -alias android -keyalg RSA -keysize 2048 -validity 20000
jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore debug.keystore gboard.apk android
zipalign -v 4 gboard.apk gboard-aligned.apk
but then installing with adb install gboard-aligned.apk give :
Code:
adb: failed to install gboard-aligned.apk: Failure [INSTALL_PARSE_FAILED_NO_CERTIFICATES: Scanning Failed.: No signature found in package of version 2 or newer for package com.google.android.inputmethod.latin]
with lucky patcher i could only select "disable signature verification in the package manager" and other 2 which are "signature verification : always true" and "disable apk signature verification" are not available to select. so with only "disable signature verification in the package manager" i could install my signerd gboard.apk, but when opening the app it instant crash with this log : https://del.dog/yrfafulyle.txt tldr : APK is signed by unrecognized certificates
so it doesn't work without disabling signature verification.
you can find the 2 apk (just recompiled and the one signed) here : https://github.com/mirsella/gboard-colemak-dhm/releases/tag/v1
tl:dr : could install my self signed gboard.apk only with lucky patcher disabling the signature verification (not entirely ?) but when launching the app it instant crash with this log https://del.dog/yrfafulyle.txt.
i just thought about it, maybe gboard as a built in signature verification ? it check itself and exit if the signature is wrong ?
thanks you a lot.

Categories

Resources