Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add support "MIUI BACKUP" magic header #57

Open
hexiaoyuan opened this issue Aug 14, 2017 · 1 comment
Open

add support "MIUI BACKUP" magic header #57

hexiaoyuan opened this issue Aug 14, 2017 · 1 comment

Comments

@hexiaoyuan
Copy link

hexiaoyuan commented Aug 14, 2017

To support MIUI BACKUP magic header simple,
I do my patch like below,

--- a/src/org/nick/abe/AndroidBackup.java
+++ b/src/org/nick/abe/AndroidBackup.java
@@ -63,6 +63,25 @@ public class AndroidBackup {
             if (DEBUG) {
                 System.err.println("Magic: " + magic);
             }
+
+            if (magic.equals("MIUI BACKUP")) {
+                System.err.println("-- 1: " + magic);
+                String line2 = readHeaderLine(rawInStream);
+                System.err.println("-- 2: " + line2);
+                String line3 = readHeaderLine(rawInStream);
+                System.err.println("-- 3: " + new String(line3.getBytes("iso8859-1"), "UTF-8"));
+                String line4 = readHeaderLine(rawInStream);
+                System.err.println("-- 4: " + line4);
+                String line5 = readHeaderLine(rawInStream);
+                System.err.println("-- 5: " + line5);
+
+                magic = readHeaderLine(rawInStream);
+            }
+            if (!magic.equals("ANDROID BACKUP")) {
+                System.err.println("Invlaid Magic: " + magic);
+                throw new IllegalArgumentException("Invalid Magic " + magic);
+            }
+
             String versionStr = readHeaderLine(rawInStream); // 2
             if (DEBUG) {
                 System.err.println("Version: " + versionStr);

wish you enjoy it.

@pmsmall
Copy link

pmsmall commented Aug 2, 2018

@hexiaoyuan How to pack the files? How to make a “MIUI backup” file header?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants