Skip to content

Exception in unpacking whatsapp.ab in Termux #3

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

Closed
YuvrajRaghuvanshiS opened this issue Jan 15, 2021 · 49 comments
Closed

Exception in unpacking whatsapp.ab in Termux #3

YuvrajRaghuvanshiS opened this issue Jan 15, 2021 · 49 comments
Labels
good first issue Good for newcomers

Comments

@YuvrajRaghuvanshiS
Copy link
Owner

java -jar abe.jar unpack whatsapp.ab whatsapp.tar <pass> on termux results in

Exception in thread "main" java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:58) Caused by: java.lang.RuntimeException: java.util.zip.ZipException: invalid block type at org.nick.abe.AndroidBackup.extractAsTar(AndroidBackup.java:516) at org.nick.abe.Main.main(Main.java:142) ... 5 more Caused by: java.util.zip.ZipException: invalid block type at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:164) at java.io.FilterInputStream.read(FilterInputStream.java:107) at org.nick.abe.AndroidBackup.extractAsTar(AndroidBackup.java:474) ... 6 more

@Blocked
Copy link

Blocked commented Feb 11, 2021

No need for Java. ab2tar by IzzySoft seems to work. Also install qpdf(which is available) for zlib-flate.

@YuvrajRaghuvanshiS
Copy link
Owner Author

ab2tar won't work with encrypted backups.

@Blocked
Copy link

Blocked commented Feb 11, 2021

Does the backup need to be encrypted? What if we just use a empty password?

@YuvrajRaghuvanshiS
Copy link
Owner Author

You could continue without providing password however on newer versions of android even if you don't provide password it'll be encrypted by default to prevent data theft.

@YuvrajRaghuvanshiS YuvrajRaghuvanshiS changed the title Exception in extracting whatsapp.ab Exception in unpacking whatsapp.ab Feb 19, 2021
@ghost
Copy link

ghost commented Feb 19, 2021

@YuvrajRaghuvanshiS maybe you want to reopen this?
I mean its not solved yet, but seems solvable.

@YuvrajRaghuvanshiS YuvrajRaghuvanshiS added the good first issue Good for newcomers label Feb 19, 2021
@ghost
Copy link

ghost commented Feb 19, 2021

Which one of these do you use?

image

@YuvrajRaghuvanshiS
Copy link
Owner Author

TBH IDK. But that is to build abe.jar right?

@ghost
Copy link

ghost commented Feb 19, 2021

i think so(?)

@ghost
Copy link

ghost commented Feb 19, 2021

Do I understand you code correctly if I say, you take the abe.jar and work with the commands that come along with it?

@YuvrajRaghuvanshiS
Copy link
Owner Author

you take the abe.jar and work with the commands that come along with it?

I don't follow.

@ghost
Copy link

ghost commented Feb 19, 2021

Nevermind, think I figured it out.
The sourceforge version is pretty old, and this dragomerlin guy converted Nikolay Elenkovs tool into a runnable jar file.
Luckily, he provided a readme in his bundle, which states the whole process and, the most important part, what IDE he used.
So, we can use this info to build our own version of Nikolay Elenkovs tool, but with the CURRENT version of the tool, which might fix our bugs.
Edit:
I'm going to ask @nelenkov if he can make an executable .jar of his most current version.

@ghost
Copy link

ghost commented Feb 20, 2021

Should maybe add to title that this concerns the Termux edition

@YuvrajRaghuvanshiS
Copy link
Owner Author

Alright.

@YuvrajRaghuvanshiS YuvrajRaghuvanshiS changed the title Exception in unpacking whatsapp.ab Exception in unpacking whatsapp.ab in Termux Feb 21, 2021
@ghost
Copy link

ghost commented Feb 23, 2021

https://github.com/nelenkov/android-backup-extractor/releases

@YuvrajRaghuvanshiS try replacing your current .jar with the new version from @nelenkov, maybe it solves the problem

@YuvrajRaghuvanshiS
Copy link
Owner Author

I'm afraid it does not solve the issue.

/sdcard/WA_Test $ java -jar abe.jar unpack nopass.ab nopass.tar
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.UnsupportedClassVersionError: org/nick/abe/Main has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
        at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:338)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
        at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:495)


/sdcard/WA_Test $ java -version
java version "1.8.0_152"
Java(TM) SE Runtime Environment (build 1.8.0_152-b16)
Java HotSpot(TM) 64-Bit Server VM (build 25.152-b16, mixed mode)

@YuvrajRaghuvanshiS
Copy link
Owner Author

I'm testing older releases.

@YuvrajRaghuvanshiS
Copy link
Owner Author

@roberts01 you were saying something about different java for termux? A new maintained version.

@ghost
Copy link

ghost commented Feb 23, 2021

I think you need to use a newer Java, try 11 maybe

@ghost
Copy link

ghost commented Feb 23, 2021

@roberts01 you were saying something about different java for termux? A new maintained version.

Oh yeah, from DevX or something. They maintain the Java from HaxUs

@ghost
Copy link

ghost commented Feb 23, 2021

found the problem (it's JDK8)
Screenshot_20210223-134753

@ghost
Copy link

ghost commented Feb 23, 2021

MasterDevX/Termux-Java#44 (comment)

I asked @MasterDevX if he can upgrade his Java-Termux-Port to JDK 11 or higher.

@YuvrajRaghuvanshiS
Copy link
Owner Author

Thank you for this.

@ghost
Copy link

ghost commented Feb 23, 2021

No problem.
Now that we got an (fairly) up to date .jar, I think it makes sense to get an up to date Termux-Java.
Just for documentation, which JAVA JDK version do you use for the Desktop version?
I'm asking because that should maybe be mentioned in the requirements part of the Readme.
Also, you can update the abe.jar that's used for the desktop version with the new release from nelenkov as well I think.

@YuvrajRaghuvanshiS
Copy link
Owner Author

Now that we got an (fairly) up to date .jar, I think it makes sense to get an up to date Termux-Java.

Yes.

Just for documentation, which JAVA JDK version do you use for the Desktop version?

I never really thought about it I just downloaded whatever latest abe.jar was available on sourceforce.net and got it working on first try.

Also, you can update the abe.jar that's used for the desktop version with the new release from nelenkov as well I think.

There is an unsaid rule : If it works don't touch it. I tried with latest version but that unfortunately has very high exception 😂 so I left it as is.

@ghost
Copy link

ghost commented Feb 23, 2021

"I never really thought about it I just downloaded whatever latest abe.jar was available on sourceforce.net and got it working on first try."

Yeah but what JDK of Java do you have on your Desktop that works? I mean you must have Java on there for it to work

@YuvrajRaghuvanshiS
Copy link
Owner Author

java version "1.8.0_271"
Java(TM) SE Runtime Environment (build 1.8.0_271-b09)
Java HotSpot(TM) 64-Bit Server VM (build 25.271-b09, mixed mode)

@ghost
Copy link

ghost commented Feb 23, 2021

isn't version 8 like super old?

@YuvrajRaghuvanshiS
Copy link
Owner Author

It may be but it works just fine.

@ghost
Copy link

ghost commented Feb 24, 2021

https://github.com/nelenkov/android-backup-extractor/releases

Nelenkov just released a version compatibility with 1.8, try that one.

@YuvrajRaghuvanshiS
Copy link
Owner Author

It did see you there.

@YuvrajRaghuvanshiS
Copy link
Owner Author

Working with https://github.com/nelenkov/android-backup-extractor/releases/tag/20210224105130-e30cc24
Only downside is require additional work on user side to make it work with passwords. However leaving password empty while creating backup gets the work done.

@YuvrajRaghuvanshiS YuvrajRaghuvanshiS removed the wontfix This will not be worked on label Feb 24, 2021
@YuvrajRaghuvanshiS
Copy link
Owner Author

Can continue with Termux afterall.

@ghost
Copy link

ghost commented Feb 24, 2021

Yay

@YuvrajRaghuvanshiS
Copy link
Owner Author

You've got some work to do now LoL. I can't work on termux as of now because of university exams.

For Java 8 you will need the unlimited policy jar files too: https://www.oracle.com/java/technologies/javase-jce8-downloads.html

Also for this we can fork masterdevx's project and ship our java with these file by default.

@ghost
Copy link

ghost commented Feb 24, 2021

But I don't know how to do that.... :-(

@ghost
Copy link

ghost commented Feb 24, 2021

But the good part is, we reduce dependencies on outside sources, because our copy of their Termux-Java is then preserved in this project

@YuvrajRaghuvanshiS
Copy link
Owner Author

YuvrajRaghuvanshiS commented Feb 24, 2021

But the good part is, we reduce dependencies on outside sources, because our copy of their Termux-Java is then preserved in this project

Kinda, we still need to modify them I'll check how.

But I don't know how to do that.... :-(

Now that is something you can't create an issue about. Can you?😂

@ghost
Copy link

ghost commented Feb 24, 2021

Now that is something you can't create an issue about. Can you?😂

Is that a challenge? 😉
Well, guess I'll fork the termux Edition and the java-termux and try around

@YuvrajRaghuvanshiS
Copy link
Owner Author

yes you can do that. A quick heads up https://www.oracle.com/java/technologies/javase-jce8-downloads.html this is required in java 8 and needed to put somewhere in system. You have to figure out to automate this.

@ghost
Copy link

ghost commented Feb 24, 2021

maybe I'll just ask the MasterDevX guys

@ghost
Copy link

ghost commented Feb 24, 2021

As this issue is now 'resolved', I thinl we can close this one and create a new issue focused on the fork with policy.

@ghost
Copy link

ghost commented Feb 24, 2021

Also, could you add the credits part from the Termux readme to the main readme?
I think it would just be fair towards @nelenkov and MasterDevX, especially after their help.

@YuvrajRaghuvanshiS
Copy link
Owner Author

maybe I'll just ask the MasterDevX guys

sure. Be sure to mention me so I get notified.

Also, could you add the credits part from the Termux readme to the main readme?
I think it would just be fair towards @nelenkov and MasterDevX, especially after their help.

you already did that.
image

@ghost
Copy link

ghost commented Feb 24, 2021

you already did that.
image

No that's juat on the Termux page, I mean I think it shoulb be on the Master readme as well.

also fyi you still have 2 closed issues pinned...

@ghost
Copy link

ghost commented Feb 24, 2021

OH AND DON'T FORGET TO PUT THE JDK NUMBER (8) IN DEPENDENCIES

@YuvrajRaghuvanshiS
Copy link
Owner Author

also fyi you still have 2 closed issues pinned...

pinning is about quick access to most pain in ass problem.

@YuvrajRaghuvanshiS YuvrajRaghuvanshiS removed the help wanted Extra attention is needed label Feb 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants