[Android General] Nodevski:
This is not meant to be a detailed tutorial, but rather an overview of the struggle I had to root and modify a Wiko Lenny 3 (with links for convenience), so others can benefit.

About a week ago I purchased a Wiko Lenny 3, a device with minimal RAM specs (1GB) for Marshmallow. This creates problems with app-notifications due to the Phone Assist (/system/vendor/operator/app/ApePhoneAssist) and Protected Apps (/system/app/CustomWhitelist) software that is pre-installed by Wiko to compensate for the low RAM.

First, I freshstarted the phone and put in the basic configuration. I immediately updated the system to OTA version V54.

Then I flashed TWRP 3.0.3-0 with SPFlashtool from this site:

http://www.needrom.com/download/recovery-twrp-wiko-lenny-3/ .

There is also TWRP 3.0.2 available but that DID NOT WORK on my phone:

http://drive.google.com/file/d/0B6isv8b6duCrbjdJbDVlRFpONlk/view

After that I rooted the thing via TWRP with SuperSU.zip, and installed Xposed via TWRP. I debloated the phone by removing most Google trash.

I use Syncthing to sync the contents of my external SD card to other devices. But Syncthing needs write permission on the SD card and Marshmallow mounts the SD card read only, and can only give write permission to the ./Android folder on the SD card. I fixed this with XInternalSD. The other option, Marshmallow SD Fix 2.0, DID NOT WORK.

http://xdaforums.com/xposed/modules/xposed-disablesignaturecheck-t2789267

http://xdaforums.com/xposed/modules/xposed-marshmallow-sd-fix-write-t3403263

So far, so good. However, after a while I noticed that FaceSlim (lightweight FB client) did not send push notifications. FaceSlim works perfectly on my old KitKat phone and also on a Lollipop tablet. So I checked running processes with OSMonitor and it turned out that FaceSlim was not being autostarted at boot. Some other services were not autostarted at boot as well:

AFWall+

Applock

DataStats

EZ Wifi Notification

FDroid

MaterialFBook

WiFi Automatic

Xprivacy

I have K-9 Mail installed as well but that app actually DID send notifications, for a while at least, later on it would not work anymore.

DataStats would not stay on screen if I forced closed it after starting it manually.

AFWall+ would only start if I added the widget on the home screen.

I tried every recommendation, like disabling doze mode for all apps and whitelisting the apps in Wiko's "Phone Assist" app, an overly aggressive resource manager that is shipped on Wiko phones, probably to make up for the low RAM. Nothing would autostart the apps.

So, I decided to flash the phone to its original state, using the official vanilla ROM from Wiko (V54), just to see if rooting screwed up the phone:

http://nl.wikomobile.com/maj.php?telephone=1246

After flashing the phone, I tried to get notifications from FaceSlim, but that still wouldn't work, so i guess the problem was not in my rooting the phone.

I also tried to flash TWRP again but this DID NOT WORK WITH THE DOWNLOADED ROM FROM WIKO (as opposed to the OTA update). TWRP got installed, but the phone would hang at startup at the Lenny logo, not booting to the UI.

Fortunately I had a TWRP backup of the old system and I flashed it, I could again boot into the UI now.

I found that other users experienced similar behaviour:

http://www.android-hilfe.de/thema/a...enachrichtigungen-funktionieren-nicht.781196/ (German)

http://android.stackexchange.com/qu...ground-sync-processes-wiko-lenny-3-what-to-do

As said earlier the Wiko has two pre-installed apps that manage autostart behaviour and power management.

1 - The "Phone Assist" software has a "Boot Optimize" screen. This feature does work for some apps, but not at boot level. When I deny autostart for AFwall+, it comes up after a reboot and is killed shortly thereafter. If I disable everything in Boot Optimize, the switch for Applock and Wetteronline returns to enabled after a reboot. Moreover, it cannot prevent Instagram from starting, one power hungry app.

2 - Phone Assist also has a "Power Management > Power saving" mode presumably to restrict network acces for apps in screen-off mode. This could be the same as the 3rd party Doze apps on Google Play that use a local VPN to restrict per-app network acces in standby mode. It is debatable if this saves much power, and there could be a security risk.

3 - Phone Assist also has in "Power Management > Advanced > Gear icon > Whitelist" (free translation, my language is Dutch) a screen to "whitelist background apps". If you whitelist an app here, it is simultaneously enabled in the previous menu ("Power Management > Power saving"), so I suspect this menu is redundant.

After playing around with the various settings in "Phone Assist", NOT A SINGLE APP WOULD START AT BOOT ANYMORE, even if I whitelisted all.

4 - The "Protected Apps" feature, found in the Android Settings, will allow you to whitelist apps for autostart. If you put this app in default mode, it will select some apps to start at boot by itself. If you whitelist apps, they indeed do start at boot. But "Protected Apps" has a limit of four apps that are allowed to autostart. This makes use of the phone for social networking/email very limited. Some Huawei phones have this feature too, and also with a limit of four apps. This is clearly an attempt to make up for the low RAM in this device, preventing users from running too many background apps. "Protected Apps" overrides all "Phone Assist > Boot Optimize" settings, making the latter effectively useless.

5 - On top of that there is the native Marshmallow Doze mode, which requires that you whitelist apps from Doze power management.

As you can see this is a complete mess. To enable/disable an app from autostart or power saving modes you have to visit two to five configuration screens. Tinno is the company that programmed this disaster (http://tinno.com/homepage?lang=en). Actually Wiko phones seem to be rebranded Tinno phones.

"Phone Assist" also has a junk cleaner (powered by Purify) that notified me once in a while asking me to delete SEVERAL GIGABYTES of junk. I had absolutely no desire to try that one ...

You can find so-called fixes on youtube for background apps that don't start, which involves installing QuickShortcutMaker, and enabling Low RAM via One Clean. That does not work on this phone.

There is a way to circumvent these autostart/powersave restrictions without removing the Wiko apps. With Link2SD or LuckyPatcher you can convert a user app to a system app. That way the app will start at boot and will send you notifications as well.

However, I wanted to get rid of this badly programmed mess altogether, and keep my apps running as user apps, so I have removed Phone Assist, its separate uninstaller, One Clean, and Protected Apps.

After deinstalling Phone Assist with SDmaid I manually removed "/system/vendor/operator/app/ApePhoneAssist" and "/data/dalvik-cache/arm/system@vendor@operator@app@@ApePhoneAssist@ApePhoneAssist.apk@classes.dex"

In /system/build.prop I edited the line "ro.tinno.whitelist.set=true" to "ro.tinno.whitelist.set=false". I don't know what that line does exactly, but it's just to be on the safe side. I think this setting is overwritten if you reinstall Phone Assist or Protected Apps.

I whitelisted some Social Media and Mail apps in Marshmallow native Doze mode.

After a few reboots some of my autostart apps started to reappear at boot, but not all. Only after I started the missing apps manually from the launcher they would appear after a reboot, and persist.

Later, I made a TWRP backup, and after that I wiped the cache and dalvik/art-cache with TWRP. Evertyhing went well.

Wiping the dalvik-cache can be a risky thing, it once left me with Android trying to optimize nine apps at every boot. I turned out that those were apps that I converted from user app to system app, and back. I removed those apps and reinstalled them and the optimization at boot went away.

So now every app starts at boot as it should, but it would be nice if this "Protected Apps" feature would not have a limit of four apps to boot, because then we would have a nice integrated boot manager. If anyone can find out if it is possible to modify this limit I would be much obliged ;)

EDIT: So, three years later and I still have this phone. I have recently installed update v59 and encountered the same problems. After deleting PhoneAssist and ProtectedApps only a few of my apps worked right, and that was only after multiple reboots. Other apps would still not show notifications. However after I edited /system/build.prop and changed this line to "ro.tinno.low_memory=false" all apps suddenly worked correctly. Maybe this would even work with PhoneAssist and ProtectedApps still installed, but I don't care to find out at this point.