xiaomi.eu backup function broken


sempron

Members
Feb 26, 2019
9
13
Hi, this is my first post here.

Since that issue has been on my mind for a long time, I decided to post about it now.


How does it come that the Xiaomi backup functions are broken in xiaomi.eu roms - just like they are broken in global roms? This makes me wonder if xiaomi.eu is really based upon China roms and not actually on global roms, but I do not want to start that discussion here...

But whatever, here are my observations:

- The local backup function in xiaomi phones (such as my Redmi Note 4 snapdragon) is broken when using a xiaomi.eu rom or a global rom. This means that only a fraction of all the apps gets backed up.
When launching the local backup, there is already a message: "Backups may not work." And additionally: "some apps may not be able to be backed up" - and after finishing the backups, some apps are marked by a red cross and a message: "backup not supported".

- Using the MI PC Suite (also called: Mi Phone Assistant), in its version 3.0 beta (the version that IN FACT works and connects to the PC!), the same problem occurs:
The same apps (as with the local backup) are NOT being backed up, they result in 0 bytes files!

I am aware of the fact that Android developers can disallow backups in their Manifests. But on the other hand, third party backup programs such as Titanium Backup are able to also back up those missing apps.

And another important remark:
All these problems are absent in the China roms (and roms really based on China roms, such as miroom; miuipro, the latter at least in older versions). Local backups and MI PC Suite backups work perfectly in both China stable AND China developer roms - but NOT so in global roms and xiaomi.eu roms.

So if xiaomi.eu is based on China roms, why do these backups fail, just like in global roms, why don't they save ALL apps just like the China roms?

It is really frustrating to see that half of all the apps (or even more, sometimes) are NOT being backed up when using the local backup & restore or the MI PC Suite.

What I really like about the MI PC Suite is the fact that I do not need to sacrifice space on my smartphone, but can directly store the backups on my PC (not possible with Titanium Backup).

I wonder why this nice function is broken in xiaomi.eu roms. Why not use the same functionality as in the China roms?

Perhaps, some users here know how to create a hack and extract that function from the China roms and use it in the xiaomi.eu roms? What settings and/or what apps are responsible for the working or failing of the backups? Any ideas?

Thanks for listening.
 
How does it come that the Xiaomi backup functions are broken in xiaomi.eu roms - just like they are broken in global roms? This makes me wonder if xiaomi.eu is really based upon China roms and not actually on global roms, but I do not want to start that discussion here...
So, instead of filing a bug report about the backup issue, you give us some garbage conspiracy about us lying to all of you about using China ROMs as base for our ROMs?
"How does it come?" is your question? Do you know the technical differences between a China ROM and a Global ROM? No? Then please, take your opinions elsewhere. We don't need to explain ourselves to you. The backup isn't "broken", it's restricted for apps that don't define android:allowBackup="true" in their manifest. This Google-defined behavior is overridden on China ROMs, but since we make our ROMs identify as if they were just normal Global ROMs, the same Google-defined restriction was activated, unintentionally.
If you have just filed a bug report, you could have saved yourself the embarrassment.

As for the backup issue, it has been fixed for next releases.

yILHliK.png
 
Instead of explaining why the backups do not work like in the China roms, you insult me? How mature and how very impressive!

I just asked a question, and the fact that backups work in the China roms (and other China based roms such as miroom) raises the question about any reason how it comes that it does NOT work in xiaomi.eu. That's all.

The way you just responded does nothing to discard my suspicion - au contraire.


So let's hope, in future versions, this backup function will truly be the same as in the China roms.

In the end, I don't care one bit what your roms are based upon, what counts is how well they work. That makes me decide whether I will keep them or switch to something different.


I know about the Android directive allowBackup=false, no worries.
The question is why you did not override this just like in the China roms - third party backup programs don't care either, for instance Titanium Backup. RevolutionOS did not care, though unfortunately, they switched over to the global base, and boom, same broken backup function there, too!

And yes: This means, the xiaomi.eu backup function is broken! No doubt about it.
Why adopt a dubious Android directive if it means that backups do no longer work without third party products!?


If you see a conspiracy here, you are under a delusion.

I would have expected a relaxed answer, instead you start to insult people and give a trash explanation :-(


/edit

Let's not start a war about your rom base.

The question is: Why do you make your roms identify as normal global roms? Is there any advantage?
 
Last edited:
  • Like
Reactions: Huaywrise
Instead of explaining why the backups do not work like in the China roms, you insult me? How mature and how very impressive!

I just asked a question, and the fact that backups work in the China roms (and other China based roms such as miroom) raises the question about any reason how it comes that it does NOT work in xiaomi.eu. That's all.

The way you just responded does nothing to discard my suspicion - au contraire.


So let's hope, in future versions, this backup function will truly be the same as in the China roms.

In the end, I don't care one bit what your roms are based upon, what counts is how well they work. That makes me decide whether I will keep them or switch to something different.


I know about the Android directive allowBackup=false, no worries.
The question is why you did not override this just like in the China roms - third party backup programs don't care either, for instance Titanium Backup. RevolutionOS did not care, though unfortunately, they switched over to the global base, and boom, same broken backup function there, too!

And yes: This means, the xiaomi.eu backup function is broken! No doubt about it.
Why adopt a dubious Android directive if it means that backups do no longer work without third party products!?


If you see a conspiracy here, you are under a delusion.

I would have expected a relaxed answer, instead you start to insult people and give a bullshit explanation :-(
You brought a conspiracy theory to the table, based on absolutely no clue how MIUI works - you should have seen the harsh response coming before bringing up that pointless speculation. I used to answer calmly in the past, but when you read this nonsense again and again, the banhammer kicks in. And now you play the "How mature" card to further insult my intelligence, and keep comparing us to other ROMs as we even care about that. This is not a competition.
Titanium Backup doesn't even use the native backup system. It uses root. How can you even bring this into the comparison?
Even the base has nothing to do with this. We have certain ROMs that are based on Global ROM (POCO F1 and Redmi Note 6 Pro), and that fix I made also applies to these ROMs. This is a restriction activated by a simple identifier in build.prop. Different ROMs have different methods of overcoming this, but this is the first time I hear of this issue (never used local backup).
 
  • Like
Reactions: ingbrzy
Let's not talk about who insulted whose intelligence. I could say the same.

But I am here for solutions.

So if it is a simple edit of build.prop, would you be so kind as to be more explicit. Maybe, I just make a change there, and I will be satisfied with your xiaomi.eu roms?

I am convinced, many people do not know anything about the usefulness of the xiaomi backups (especially Mi PC Suite), so they will never notice that something is lacking or flawed. I repeat myself, I find it very convenient to be able to directly store backups to my PC (the 3.0 beta version works very well and is fast).


One remaining point, though:

You said, this was the first time you heard about this issue, whilst a few minutes ago, you wrote that this will be fixed in future versions. So xiaomi.eu has been aware of this problem?

Anyway, if it is just a build.prop entry, I could easily fix it for myself - problem solved.
 
Let's not talk about who insulted whose intelligence. I could say the same.

But I am here for solutions.

So if it is a simple edit of build.prop, would you be so kind as to be more explicit. Maybe, I just make a change there, and I will be satisfied with your xiaomi.eu roms?

I am convinced, many people do not know anything about the usefulness of the xiaomi backups (especially Mi PC Suite), so they will never notice that something is lacking or flawed. I repeat myself, I find it very convenient to be able to directly store backups to my PC (the 3.0 beta version works very well and is fast).
I'm glad that you find it useful, but the "That makes me decide whether I will keep them or switch to something different." almost sounds as if you're the one doing us a favor. Like, seriously, if another ROM suits your needs better - you could have just used that ROM. We work for free, but then we constantly get that "you owe us" attitude.
Being more explicit with the details will do you no good. You won't even be able to boot if you tried to change the Global ROM identifier to China ROM. Are there any benefits to identifying as a Global ROM? Sure, like disabling most of China ROM's tracking and analytics.
 
  • Like
Reactions: cobben and ingbrzy
Hi again, that you owe me something, no, this is not my attitude. I am fully aware that you owe me nothing and that it does not matter to you what rom I use.

I know that there are lots of people (everywhere, in forums, in telegram channels etc.) who just demand things and get angry when there wishes are not fulfilled, even though they don't have to pay anything.

I am not one of these people. But I am curious and always trying to get answers and solutions.

That's why I wondered why xiaomi.eu sacrificed (even if unknowingly) the otherwise well working backup functions in order to comply to Google restrictions.

I'd still be interested in the changes needed to make backups work. So if I risk breaking my system, this is no big deal - I have all kinds of backups nevertheless (Titanium Backup, Migrate, TWRP/Nandroid - and incomplete (see the issues mentioned) local MI backups and Mi PC Suite backups).

I guess, changing build.prop and substituting backup.apk will not be enough...
 
Hi again, that you owe me something, no, this is not my attitude. I am fully aware that you owe me nothing and that it does not matter to you what rom I use.

I know that there are lots of people (everywhere, in forums, in telegram channels etc.) who just demand things and get angry when there wishes are not fulfilled, even though they don't have to pay anything.

I am not one of these people. But I am curious and always trying to get answers and solutions.

That's why I wondered why xiaomi.eu sacrificed (even if unknowingly) the otherwise well working backup functions in order to comply to Google restrictions.

I'd still be interested in the changes needed to make backups work. So if I risk breaking my system, this is no big deal - I have all kinds of backups nevertheless (Titanium Backup, Migrate, TWRP/Nandroid - and incomplete (see the issues mentioned) local MI backups and Mi PC Suite backups).

I guess, changing build.prop and substituting backup.apk will not be enough...
The only way to unlock it is by decompiling services.jar, changing a single line, then recompiling, then flashing to your ROM with proper permissions.
Or you can just wait for the next public release.
 
I think, your answer was quite helpful.


Is it in BackupManagerServiceInjector.smali?

Should it be changed here:

.method static isForceAllowBackup(Landroid/content/pm/PackageInfo;I)Z
.registers 3

sget-boolean v0, Lmiui/os/Build;->IS_INTERNATIONAL_BUILD:Z

if-eqz v0, :cond_a



Thanks for your time.
Waiting for the next release is, of course, an option, too.
 
I think, your answer was quite helpful.


Is it in BackupManagerServiceInjector.smali?

Should it be changed here:

.method static isForceAllowBackup(Landroid/content/pm/PackageInfo;I)Z
.registers 3

sget-boolean v0, Lmiui/os/Build;->IS_INTERNATIONAL_BUILD:Z

if-eqz v0, :cond_a



Thanks for your time.
Waiting for the next release is, of course, an option, too.
That's right,
sget-boolean v0, Lmiui/os/Build;->IS_INTERNATIONAL_BUILD:Z
Needs to be replaced with
const/4 v0, 0x0
The "backup may not work" warning can be ignored.
 
  • Like
Reactions: sempron
Oh, fine! So I was on the right track.

So these changes will already be in the next version, in 9.2.28?


Now for something completely off topic, I know...
But may I ask you a final question, because I suppose, you are knowledgeable and can answer this question (I have been searching endlessly, but could not get any conclusive results):

What is the reason I have to format my internal storage each and every time I switch from an oreo or pie rom to a nougat rom (such as the original global beta or your xiaomi.eu rom or the china developer etc. etc.)?
At first, I was confused by that "encryption unsuccessful" error message and "reset phone" messages and all that. I wrongly attributed the issue to MIUI, but then I found out that the real reason is not switching from a NON-MIUI rom to MIUI, but it is switching from oreo or pie to nougat.

I can try out all kinds of oreo and pie roms and hop around between them, and I do NOT need to format the internal storage (I delete/rename the Android folder and some others in order to keep things clean, yet I do not need to format the entire internal SD). But as soon as I go back to a nougat rom, I am forced to format the internal SD ( I have backups, but it is still very annoying).

Has there been a change in the ext4 file system and/or in some system settings (or whatever else) that urges me and everybody else to format the internal storage? There seems to be an important cut between nougat and oreo and no such break between oreo and pie.

Sorry for the off topic in this thread - if you'd still like to reply, that would be great. :)

Thanks.
 
Oh, fine! So I was on the right track.

So these changes will already be in the next version, in 9.2.28?


Now for something completely off topic, I know...
But may I ask you a final question, because I suppose, you are knowledgeable and can answer this question (I have been searching endlessly, but could not get any conclusive results):

What is the reason I have to format my internal storage each and every time I switch from an oreo or pie rom to a nougat rom (such as the original global beta or your xiaomi.eu rom or the china developer etc. etc.)?
At first, I was confused by that "encryption unsuccessful" error message and "reset phone" messages and all that. I wrongly attributed the issue to MIUI, but then I found out that the real reason is not switching from a NON-MIUI rom to MIUI, but it is switching from oreo or pie to nougat.

I can try out all kinds of oreo and pie roms and hop around between them, and I do NOT need to format the internal storage (I delete/rename the Android folder and some others in order to keep things clean, yet I do not need to format the entire internal SD). But as soon as I go back to a nougat rom, I am forced to format the internal SD ( I have backups, but it is still very annoying).

Has there been a change in the ext4 file system and/or in some system settings (or whatever else) that urges me and everybody else to format the internal storage? There seems to be an important cut between nougat and oreo and no such break between oreo and pie.

Sorry for the off topic in this thread - if you'd still like to reply, that would be great. :)

Thanks.
I've no idea, @ingbrzy is the one handling the kernel stuff.

And yes, 9.2.28 has the fix included, along with other fixes listed here: https://xiaomi.eu/community/threads/weekly-confirmed-issues-faq.46800/
 
Well, now that 9.2.28 is out, I was ready to check out the backup function. Unfortunately, however, my device (mido) is EOL at xiaomi.eu. :-(
So I cannot test if local and MI PC Suite backups work now (by "work" I mean "producing complete backups", as I explained in this thread).

Therefore, I downloaded two Nougat roms (for Redmi Note 5A, "ugg") - just for the purpose of comparing the two versions.
I found out that there are differences (as described before) in services.jar (resp. classes.dex).

Now my question is:
Is the above mentioned change (sget-boolean v0, Lmiui/os/Build;->IS_INTERNATIONAL_BUILD:Z ........) the only essential difference that is needed to make backups fully work, or are there some other changes needed, in some other files etc.?

I noticed that there is no real change in build.prop (9.2.21 versus 9.2.28). So if that one line modification (see above) is all that is required to make backups work I could easily edit that in my latest mido version and see whether backups are getting complete now... But if there are more changes needed to make this functional, I'd say, this would not be worth all the efforts and I'd just refrain.


Thanks again.
 
Well, now that 9.2.28 is out, I was ready to check out the backup function. Unfortunately, however, my device (mido) is EOL at xiaomi.eu. :-(
So I cannot test if local and MI PC Suite backups work now (by "work" I mean "producing complete backups", as I explained in this thread).

Therefore, I downloaded two Nougat roms (for Redmi Note 5A, "ugg") - just for the purpose of comparing the two versions.
I found out that there are differences (as described before) in services.jar (resp. classes.dex).

Now my question is:
Is the above mentioned change (sget-boolean v0, Lmiui/os/Build;->IS_INTERNATIONAL_BUILD:Z ........) the only essential difference that is needed to make backups fully work, or are there some other changes needed, in some other files etc.?

I noticed that there is no real change in build.prop (9.2.21 versus 9.2.28). So if that one line modification (see above) is all that is required to make backups work I could easily edit that in my latest mido version and see whether backups are getting complete now... But if there are more changes needed to make this functional, I'd say, this would not be worth all the efforts and I'd just refrain.


Thanks again.
The IS_INTERNATIONAL_BUILD:Z part is the only necessary change. Nothing else is needed, not even in build.prop.
If you want to get rid of the "Backup may not work" warning then that's another change in Backup.apk.
 
  • Like
Reactions: sempron
Hi, thanks for coming back to this. Sounds good. I may try it out, once I'll be less tired. :)


/edit:

Well, I couldn't wait. ;-)

I downloaded and installed a ported rom based upon xiaomi.eu 9.2.28, suitable for mido. Yes, I know, this is no offical xiaomi.eu rom, but I checked by decompiling services.jar (resp. classes.dex) that the same changes regarding the backup function had been integrated. And yes, they are. That was the only thing interesting me when choosing the rom port.

All my tests with either backing up apps or restoring them (both local backup and Mi PC Suite) are positive! Excellent!

I wonder:
Is it just coincidence that xiaomi.eu fixed the backup function since 9.2.28 just at the time that I complained about it? Not that I would think, I am the reason for the fix, hehe. ;-)
 
Last edited: