lingeringwillx / How-to-Dumbify-Your-Android-Smartphone

Guide for dumbifying Android
2 stars 0 forks source link

Easier solutions #4

Open eridorFR opened 2 months ago

eridorFR commented 2 months ago

Hi!

I tried to do something similar with LineageOS (20) on my phone but with an easier execution, here are my tweaks :

1.Remove unwanted apps

Instead of removing the APK files (ie. Jelly) with ADB like you do, I just uninstall unwanted packages with the android package manager :

# adb root
# pm uninstall -k --user 0 org.lineageos.jelly
# pm uninstall -k --user 0 org.fdroid.fdroid

If needed later, these commands can be reverted with :

# cmd package install-existing org.lineageos.jelly
# cmd package install-existing org.fdroid.fdroid

Pros :

Cons :

2. Block multiple users and guest mode

The upper pm uninstall commands only affect the current user and a nasty you can get rid of them with the guest mod or with a new user account. So you have to block them also. You can do this by specifying "fw.show_multiuserui=0" and "fw.max_users=1" in the build.prop located in the /system/ folder on your phone. But an OTA will overwrite this file and remove your tweak. The solution is in a local.prop file stored in the /data/ partition of your Android :

On your PC :

After reboot users management will be hidden in Settings. You won't be able to access to guest mode or create another account.

3. Prevent sideloading

As yous say, you can still install an app with its APK file (sideloading), BUT, there is a way to configure the package manager to prevent that :

# adb root
# adb shell pm disable com.android.packageinstaller/.PackageInstallerActivity

Now, any APK you try to open with file manager will end in an error message. The nice part is that stores like Fdroid or Aurora Store and also app with built-in update mechanism (ie. Signal APK from official site) are still be able to proceed updates.

To revert it :

# adb root
# adb shell pm enable com.android.packageinstaller/.PackageInstallerActivity

Pros of points 2. & 3. :

Cons :

That's how I dumb-iphy my Android. I hope it can be useful !

skbnoqtrjf commented 1 month ago

Great! Thanks for your ideas. But I followed the author's methods because even if I did a factory reset or switched to another user/guest user, these unwanted apps couldn't come back because they had already been removed permanently. For your method 3, I tried removing the package: com.android.packageinstaller, but the system couldn't reboot and hanging at LineageOS logo, I think it related to app's permissions. I have a question with the method 3, if I disabled com.android.packageinstaller/.PackageInstallerActivity, is it possible to still install APK files via ADB commands?

skbnoqtrjf commented 1 month ago

I have a question with the method 3, if I disabled com.android.packageinstaller/.PackageInstallerActivity, is it possible to still install APK files via ADB commands?

I already confirmed by myself, still can install via ADB commands. I think I can prevent that by removing this package: /system/priv-app/Shell/Shell.apk=com.android.shell, but it's quite dangerous because I can't install any app anymore, my phone will become dumbphone actually, the only way is reinstalling OS.

skbnoqtrjf commented 1 month ago

Method 3: how can I keep this disabling effective even after doing a factory reset? when I did a factory reset, it's reverted.

eridorFR commented 1 month ago

I tried removing the package: com.android.packageinstaller, but the system couldn't reboot and hanging at LineageOS logo, I think it related to app's permissions.

Yes, com.android.packageinstaller is needed to boot, I learned it after I bricked my system once…

Method 3: how can I keep this disabling effective even after doing a factory reset? when I did a factory reset, it's reverted.

Yes, a factory reset wipes everything including those changes.

I understand what you try to do (an overly dumb phone :), I would say that it needs a more radical solution instead doing post-install tweaks. Maybe you should try to build from the source and remove unwanted apps before building your own image ? Your modifications would still be there even after factory reset. There is an official page for my device (https://wiki.lineageos.org/devices/FP3/build/variant1/) maybe there is one for your device. You can also try to get in touch with the LOS maintainers of your device. Or try the Dev IRC might be useful : https://web.libera.chat/gamja/?channel=#lineageos-dev It's an interesting and challenging project but my knowledges are too limited to help you.

For my personnal use, ADB commands are enough as I don't keep ADB installed on my PC and use a charge-only USB cable. Blocking guest is not an issue because a smartphone is not a thing you really share. I still have system updates monthly and Signal auto-updates. For me it's a balanced solution between dumbphone-isation, privacy and security.

skbnoqtrjf commented 1 month ago

use a charge-only USB cable

@eridorFR oh, this is a great idea. Anyway, I don't use any computer generally. Thanks for your advice! But I am not a coder and don't know coding... So, it's really difficult for me to build a ROM from source codes.

skbnoqtrjf commented 1 month ago

Method 3: how can I keep this disabling effective even after doing a factory reset? when I did a factory reset, it's reverted.

I have a solution for this issue, I try disabling (or can rm -f) com.android.documentsui (meaning the File Manager app) and then I can't install any APK file on my phone alone, lol. But I need to find a suitable document viewer app that doesn't rely on the built-in File Manager app, otherwise, I can't view document and PDF files. But normally, I only need to read PDF files on my phone, for office documents, I read them on my company laptop.

p/s: I just found this app: https://www.apkmirror.com/apk/pspdfkit-gmbh/pdf-viewer/pdf-viewer-2024-4-release/. It's a good app to read PDF files.