[XDA Assist] Lutarisco:
Thaanks i solved it!!

Oh, simply thank you! Thanks to you I solved it! I owe you my phone's warranty!! (now voided, but whatever!)

[((Solution: DELETE THAT FILE `/data/system/device_policies.xml` through any recovery that lets you delete such file))]

You know something? I looked there before, but after your post I decided to go further (on my own!) into that forums, did some research about some things... and decided to flash a recovery. And I researched that it wouldn't do anything to the partitions I didn't want to lose, because the recovery has its own partition. Well, looking into the Grand Neo forum, I chose the TWRP recovery over the CWM one, because the latter was way older. And as I don't have Win, I used Heimdall with my Pi (Raspbian), but when I started I had some problems with the connection to the device. I discovered that the problem that I had with this version of the Heimdall package (1.4.0) had been already solved with the commit #329 on GitHub, so I tried compiling from source, and it successfully worked.

Then, I got amazed because, on recovery, I could get root access to every file, and also the device was detected over ADB as "recovery", and could do everything. Gladfully, I copied every file in the internal storage and the external SD Card to my Mac, then formatted the SD, then made backups of the Data and System partitions. Later, I discovered the difference between the Data, System, Internal Storage, Micro SD Card, Cache, Dalvik Cache, and Recovery partitions.

So if anyone out there wants a bit of info (at least about my phone), the System partition works like the Mac's System folder, containing things that almost never get modified by the end user, unless you flash some image to that partition (a custom or stock ROM, ideally), or delete accidentally causing broken things. The Data partition is mounted in /data, and contains (almost) everything that gets modified over the time. It also contains mount points for the Internal Storage, at /data/media/0 (there are several mount points for this over all the drive, and it's quite confusing), and I don't know exactly, but I think for Dalvik Cache and the Cache. The Micro SD Card partition is almost independent from everything else, but it also has several mount points along the Internal Storage one. the Cache is, well... the cache, and is mounted at /cache. The recovery partition is what I touched, and I think it explains itself a lot if you've used a Mac (pressing command+R at startup). The Dalvik Cache is quite interesting. I think it's mounted at /data/dalvik-cache, but I'm not sure. Well, it apparently has "optimized" versions of your apks stored in /data/app.

When I thought that wiping the Dalvik Cache would solve something, I discovered that the phone almost booted properly, but came back to the boot loop after the process of "optimizing" all of my 157 apps, with the difference that the device got recognized this time (only when booting after wiping the Dalvik!) by the ADB as a "device". Well played, at least. I went back to TWRP and made a backup of the Data, so now I can come back to that error whenever I want.

As I could get back in time, I decided to look for that little thing that was preventing my phone from booting. First, I dumped over 15 MB of logs, by ADB, the Recovery and the Shell. Now I can see that everything relates to some "policies" (more on that later). Then, I wiped the /data partition, as I had a backup. And I saw the phone booting to that "Welcome to your new Android!" thing. Thanks, the problem wasn't on the system! It was the Data! And, to confirm myself, I went to the settings, and activated that Google Device Administrator Thing again. Boom! Bootloop. It got wiped again by me, just to go there and do some "testing". I was going to see exactly what changed with that option, so went to that menu, and just before "pressing the button" (!), I went to recovery, and got every regular folder and regular file (because any symlink and stuff just made the copy fail) copied from /data to my computer. Then, I booted the phone, changed the setting, powered it off, and copied the /data again. In bash I made a `diff -r`, and also listed (from the original /data that I wanted to recover) every file there (this time of any kind) and on my computer sorted them all by date, to see the last files touched. Well, the diff resulted on various things, like a new line on the file /data/data/com.android.settings/shared_prefs/com.android.settings_preferences.xml:

<boolean name="pref_device_provision" value="true" />

It wasn't so important, as I deleted it and rebooted and nope, the bootloop continued. Backup restored again.

Then, something more interesting on the file /data/data/com.google.android.gsf/shared_prefs/update.xml: some name "provisioned" changed its value from zero to a UNIX timestamp in milliseconds. I didn't do anything on that because it wasn't so important, a timestamp. There was a ton of files with such timestamps, and also some new files from certain background apps, and the diff also showed up several xml files differing because the sorting. Dismissed all that and kept looking, and...

THERE IT WAS:

Only in /Users/Benja/Desktop/pos/data/system: device_policies.xml

(for the record: there was a "pre" and a "pos" folder, one for each /data)

I HATE IT. Out of rage, I looked at the file:

<?xml version='1.0' encoding='utf-8' standalone='yes' ?>
<policies>
<admin name="com.google.android.gms/com.google.android.gms.mdm.receivers.MdmDeviceAdminReceiver">
<policies flags="28" />
<allow-storage-card value="true" />
<simplepassword-enabled value="true" />
<allow-wifi value="true" />
<allow-text-messaging value="true" />
<allow-popimap-email value="true" />
<allow-browser value="true" />
<allow-internet-sharing value="true" />
<allow-bluetooth-mode value="2" />
<allow-Desktop-Sync value="true" />
<allow-IrDA value="true" />
<require-StorageCard-Encryption value="false" />
<allow-list-thirdparty value="" />
<block-list-InRom value="" />
<allow-unsignedapp value="true" />
<allow-unsignedinstallationpkg value="true" />
</admin>
</policies>

THAT FILE WAS CAUSING ALL OF THIS. There was also a backup of that file, that had nothing else than the xml header and an empty `<policies />`. But well, that file appeared also in the list of the most recently touched files (it took a while to do that list, because I couldn't figure out a better way than listing /data recursively and with full dates with the `-re` options (looked up for those at the help there, because the options were different and `find` didn't have printf) and parsing it with awk (stackoverflow #1767384), then on my Mac did the rest of the date parsing and sorting with date and cut and date again).

I DELETED THAT FILE `/data/system/device_policies.xml` (and obviously made a backup, even though I'll never want to bootloop it again, lol). Then rebooted and... finally I was able to see again my Little Prince lock background: Il tomba doucement comme tombe un arbre.

Now I'm restoring the files that I got from the Internal and External Storages. Then everything will continue as usual. Thank you so much for referring me to that forum again.

Also, after all of this, I googled the file and magically found this russian website (to prevent spamming, I cannot post a href): http://juick.com/PoZitron/2801749

That site (through the Google Translator (irony)) had just the info that I'd want to have read before (in russian, lol).

Well, as the site points, всегда делайте бэкапы!

Thanks again, and good luck to everyone else with problems out there.