Android Question Android App Self-Destruct

mmieher

Active Member
Licensed User
Longtime User
Is there a way yet to uninstall App on all the unrooted devices out there? Foreground would be ideal.
https://www.b4x.com/android/forum/threads/install-uninstall-in-background-application.50567/#content

(very early draft)

What.png
 
Solution
1.
Manifest editor:
B4X:
AddPermission(android.permission.REQUEST_DELETE_PACKAGES)

2.
B4X:
Private Sub Button1_Click
    Dim in As Intent
    in.Initialize("android.intent.action.UNINSTALL_PACKAGE", "package:" & Application.PackageName)
    StartActivity(in)
End Sub

Erel

B4X founder
Staff member
Licensed User
Longtime User
1.
Manifest editor:
B4X:
AddPermission(android.permission.REQUEST_DELETE_PACKAGES)

2.
B4X:
Private Sub Button1_Click
    Dim in As Intent
    in.Initialize("android.intent.action.UNINSTALL_PACKAGE", "package:" & Application.PackageName)
    StartActivity(in)
End Sub
 
Upvote 0
Solution

mmieher

Active Member
Licensed User
Longtime User
1.
Manifest editor:
B4X:
AddPermission(android.permission.REQUEST_DELETE_PACKAGES)

2.
B4X:
Private Sub Button1_Click
    Dim in As Intent
    in.Initialize("android.intent.action.UNINSTALL_PACKAGE", "package:" & Application.PackageName)
    StartActivity(in)
End Sub
Of course it works. I am still on the fence about it asking for PERMISSION. Does App have to ask?

It was also educational for me, that in DEBUG, "uninstalling" just means I need to Clean before next run.
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Of course it works. I am still on the fence about it asking for PERMISSION.
as it is not a dangerous permission and you do not use runtimepermissions at all (not needed) it seems to be an Android permission-system.
It is the user (not the app) which have to decide to accept permission or not.
You can not overcome this i guess.
 
Upvote 0

mmieher

Active Member
Licensed User
Longtime User
as it is not a dangerous permission and you do not use runtimepermissions at all (not needed) it seems to be an Android permission-system.
It is the user (not the app) which have to decide to accept permission or not.
You can not overcome this i guess.
Accept the things you cannot change.
 
Upvote 0
Top