BenjaminSoelberg / wilfa-e-way-electric-scooter-hack

E-way Electric Scooter Speed Hack
33 stars 4 forks source link

There was a problem parsing the package #1

Closed kardesken closed 2 years ago

kardesken commented 3 years ago

When trying to install the "EWay_Scooter_v1.0.15_speed.apk" i get the following error: "There was a problem parsing the package"

I'm running Android 11 with June security patch.

--

Is it possible to get more info about the patching? When I try to run the patch_apk.sh i get (in Windows):

bash: keytool: command not found
bash: apktool: command not found
patching file EWay_Scooter_v1.0.15_speed/smali/com/scooter/ewayscooter/Utils/ConstantBle.smali
bash: apktool: command not found
bash: apksigner: command not found

What am I supposed to do here?

BenjaminSoelberg commented 3 years ago

The build system is only tested on Linux. But the direct link to the app should work on android phones. Let me check again with mine if I goofed up. Can you try and install the original (and unpatched version) from my GitHub and report if it gives you the same error ?

https://github.com/BenjaminSoelberg/wilfa-e-way-electric-scooter-hack/blob/65c9633691ca4fad0f7f932e0a921357a3100ff5/Eway_Scooter_v1.0.15_original.apk?raw=true

Mvh / Best regards Benjamin Sølberg

Den 24. jul. 2021 kl. 12.05 skrev kardesken @.***>:

 When trying to install the "EWay_Scooter_v1.0.15_speed.apk" i get the following error: "There was a problem parsing the package"

I'm running Android 11 with June security patch.

--

Is it possible to get more info about the patching? When I try to run the patch_apk.sh i get (in Windows):

bash: keytool: command not found bash: apktool: command not found patching file EWay_Scooter_v1.0.15_speed/smali/com/scooter/ewayscooter/Utils/ConstantBle.smali bash: apktool: command not found bash: apksigner: command not found What am I supposed to do here?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

kardesken commented 3 years ago

I have no problem installing the unpatched version from from your GitHub.

BenjaminSoelberg commented 3 years ago

Ok, it could be because the phone isn’t allowed to install self signed apk’s or that that I did a bad commit. Let me check with my phone. In the mean time try at google how to install self signed apk and see if it helps. Thank you for taking your time to create an issue.

Mvh / Best regards Benjamin Sølberg

Den 24. jul. 2021 kl. 12.21 skrev kardesken @.***>:

 I have no problem installing the unpatched version from from your GitHub.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

BenjaminSoelberg commented 3 years ago

Ok I have tested the app on a Huawei p10 model VTR-L29 running EMUI version 9.1.0 where it works. I’m not really an Android expert but I bet it is a security problem with side loading apps on newer android phones. Please report back if you find a way to run it on yours with android version and phone model.

Mvh / Best regards Benjamin Sølberg

Den 24. jul. 2021 kl. 12.25 skrev Benjamin Sølberg @.***>:

Ok, it could be because the phone isn’t allowed to install self signed apk’s or that that I did a bad commit. Let me check with my phone. In the mean time try at google how to install self signed apk and see if it helps. Thank you for taking your time to create an issue.

Mvh / Best regards Benjamin Sølberg

Den 24. jul. 2021 kl. 12.21 skrev kardesken @.***>:

 I have no problem installing the unpatched version from from your GitHub.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

BenjaminSoelberg commented 3 years ago

Source : https://updato.com/how-to/there-was-a-problem-parsing-the-package-error-fix-it-now/

Can you please try this :

Enable Unknown Sources

Regardless of the Android OS version or the device manufacturer, you will always be able to sideload apps on to your phone. However, you need to grant the device permission to do so, before you can enjoy the freedom of installing apps without the governance of the Google Play Store. To do so, you will need to make sure that specific permission to install apps from unknown sources have been enabled from the Developer Options menu, and here’s how you can do it:

On your Android device, head over to the Settings app.
Head over to Settings – About phone – Build number and tap it 7 times to enable Developer options. 
Now head back to the Settings menu, where you should be able to find the Developer Options menu available for access.
Scroll down within the Developer Options menu and enable the toggle switch for Allow apps from Unknown Sources right next to it.

The system will now allow you to install apps from third-party sources, outside the bounds of the Google Play Store.

kardesken commented 3 years ago

Thanks for trying to help, and for sharing the app.

I'm unfortunately not skilled in any programming and I know little of Android..

I have enabled the option to install programs from unknown sources (I have installed other programs this way before). This does not help. I have also uninstalled the previously app and tried again, also with the same error.

My phone is a Oneplus Nord running original OS (Oxygen OS 11.1.4.4)

I'll see if I can think of any other ways to try this, and give an update if I happen to find something of use.

BenjaminSoelberg commented 3 years ago

Ok thank you for trying. Let's hope others can help here. But I'm still convinced that this is a sideloading issue of some sorts. Unfortunately I don't have a newer Android phone so I'm unable to test it further. Btw try and download an older king song scooter apk. I have heard that it might do the trick as well.

kardesken commented 3 years ago

So I've tried to install the apk trough Android Studio and then I get this message: "The application could not be installed: INSTALL_PARSE_FAILED_RESOURCES_ARSC_COMPRESSED"

So when I google this I find:

Apps that target Android 11 (API level 30) or higher can't be installed if they contain a compressed resources.arsc file or if this file is not aligned on a 4-byte boundary. This file cannot be memory-mapped by the system if either of these conditions is present. Resources tables that cannot be memory-mapped must be read into a buffer in RAM resulting in unnecessary memory pressure on the system and greatly increased device RAM usage.

https://developer.android.com/about/versions/11/behavior-changes-11

I don't know if this could be the case?

BenjaminSoelberg commented 3 years ago

Hmm let me see if I can align the file by patching null bytes into it. I’ll get back to you. Thank you for keep trying. Your time and help is very valuable.

Mvh / Best regards Benjamin Sølberg

Den 24. jul. 2021 kl. 13.57 skrev kardesken @.***>:

 So I've tried to install the apk trough Android Studio and then I get this message: "The application could not be installed: INSTALL_PARSE_FAILED_RESOURCES_ARSC_COMPRESSED"

So when I google this I find:

Apps that target Android 11 (API level 30) or higher can't be installed if they contain a compressed resources.arsc file or if this file is not aligned on a 4-byte boundary. This file cannot be memory-mapped by the system if either of these conditions is present. Resources tables that cannot be memory-mapped must be read into a buffer in RAM resulting in unnecessary memory pressure on the system and greatly increased device RAM usage.

https://developer.android.com/about/versions/11/behavior-changes-11

I don't know if this could be the case?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

kardesken commented 3 years ago

Some more info: I've tried to install the apk on an emulator (in android studio).

With android 11 (API:30) i get same error as I mentioned before. With android 9 (API:28) everything works.

And I feel the need to mention that I only installed android studio to test this, so I really don't know what I'm doing!

BenjaminSoelberg commented 3 years ago

That was very helpful. I’ll do the same and dig deeper.

Mvh / Best regards Benjamin Sølberg

Den 24. jul. 2021 kl. 14.45 skrev kardesken @.***>:

 Some more info: I've tried to install the apk on an emulator (in android studio).

With android 11 (API:30) i get same error as I mentioned before. With android 9 (API:28) everything works.

And I feel the need to mention that I only installed android studio to test this, so I really don't know what I'm doing!

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

Hrhansen1 commented 3 years ago

I have the same problem as kardesken and i have a samsung galaxy s21 also with the newest version of android.

I will follow in this forum and hope for a solution 😊

kardesken commented 3 years ago

I found a old phone with Android 8 and tried your program with that one.

I had no problem installing the app. But I didn't manage to unlock the speed on my E-Way 350 (FW V1.17).

When going into Settings/ Speed Settings (there is only one option of 20km/h) and press confirm, the app freezes and then it close. On the original app I could choose max speed of 20km/h or 22km/h

When I then try it on my normal phone with the original app from Google Play, I no longer have the option to choose from 20 or 22 km/h. Only option is 20km/h, and if I press confirm, this app now also start to freeze and then close. So something has changed (But not the speed limit).

Do you have an older firmware on your E-Way? And is there any way of bringing my scooter back to "normal" operation again?

Hrhansen1 commented 3 years ago

Again same problem here as kardesken, the program freezes and crash, even in the orginal app i have triede with APK Editor and i can install but it will still crash in speed settings or will not start at all.

BenjaminSoelberg commented 3 years ago

Ok so first a little background: The app will use your gps coordinates to query a web server for the max speed setting. The web server returns the legal options which is speed and a value. The value is between 0-4. 0 means unlimited and 4 means 20 km/h. The other options is 22,23 and 25. The app patch will always send a zero to the scooter no matter what option you are presented and choose. Try uninstalling the app first and reinstalling the original after and try again. See if this helps. If not then I can make a custom apk that sets the value to say 25 km/t and we can try setting the speed to that and then deleting the patched apk and reinstalling the original again to see if that restores it back to factory. Also if you have an iPhone try that as that will restore it to factory as well (mine does). I’m sure we’ll fix this.

Mvh / Best regards Benjamin Sølberg

Den 24. jul. 2021 kl. 19.23 skrev kardesken @.***>:

 I found a old phone with Android 8 and tried your program it with that one.

I had no problem installing the app. But I didn't manage to unlock the speed on my E-Way 350 (FW V1.17).

When going into Settings/ Speed Settings (there is only one option of 20km/h) and press confirm, the app freezes and then it close. On the original app I could choose max speed of 20km/h or 22km/h

When I then try it on my normal phone with the original app from Google Play, I no longer have the option to choose from 20 or 22 km/h. Only option is 20km/h, and if I press confirm, this app now also start to freeze and then close. So something has changed (But not the speed limit).

Do you have an older firmware on your E-Way? And is there any way of bringing my scooter back to "normal" operation again?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

Hrhansen1 commented 3 years ago

Do you have Discord or something?

BenjaminSoelberg commented 3 years ago

I do. Bugsy#2873

BenjaminSoelberg commented 3 years ago

So I have a hack working that will set your speed to max again!

The current problem might be with the King Song server returning bad data but I'm working on a fix that will bypass that.

kardesken commented 3 years ago

Try uninstalling the app first and reinstalling the original after and try again. See if this helps.

This does not help I'm afraid. Original app freezes and stops when i confirm speed setting in settings.

If not then I can make a custom apk that sets the value to say 25 km/t and we can try setting the speed to that and then deleting the patched apk and reinstalling the original again to see if that restores it back to factory

I don't mind trying

Also if you have an iPhone try that as that will restore it to factory as well (mine does).

Sorry, I don't have that. But good to know. I'm sure I have some friends with an iPhone that can help me out if needed.

So I have a hack working that will set your speed to max again! The current problem might be with the King Song server returning bad data but I'm working on a fix that will bypass that.

If you're working on something, then I'll just sit back and wait :)

Thank you for keep trying. Your time and help is very valuable

And I thank you for trying to find a solution to this.

BenjaminSoelberg commented 3 years ago

Try the latest APK!

kardesken commented 3 years ago

Tested.

It still want install on Android 11 (but I guess that this is not important now).

Installed it on my old phone with Android 8.

At first I had problems to connect to my scooter. The app says it has connected, but there is no info available in the app. Everything is blank. I also believe that I had this issue a couple of times with the original app. So this could be because the original app sucks..

After a couple of restarts on my phone and the scooter, it finally connected, and it works. I can now choose all the different max speed settings 22, ... 25 and unlimited.

Nice work.

BenjaminSoelberg commented 3 years ago

That is good news. I can attest that the original app is not very well done. But it kinda works and that's what matters for the manufacturer.

I'll keep this issue open as it was originally about an installation problem on android 11 which still persists. I have moved the app crash into issue #2 which is now fixed and closed.

Mortenton commented 3 years ago

Working great on a e-way e-500 with latest app from Benjamin. I use a huawei p40 pro with latest emui 11 on it. Thank for good job👍👍 Is it something for the stayclassy classywalk s200n also?😊 Vennlig hilsen Morten Tonheim-------- Opprinnelig melding --------Fra: Benjamin Sølberg @.>Dato: søn. 25. jul. 2021, 14:00Til: BenjaminSoelberg/wilfa-e-way-electric-scooter-hack @.>Kopi: Subscribed @.***>Emne: Re: [BenjaminSoelberg/wilfa-e-way-electric-scooter-hack] There was a problem parsing the package (#1) That is good news. I can attest that the original app is not very well done. But it kinda works and that's what matters for the manufacturer. I'll keep this issue open as it was originally about an installation problem on android 11 which still persists. I have moved the app crash into issue #2 which is now fixed and closed.

—You are receiving this because you are subscribed to this thread.Reply to this email directly, view it on GitHub, or unsubscribe.

BenjaminSoelberg commented 3 years ago

Good to hear. What is the maximum speed on the e500 ?

Mortenton commented 3 years ago

35 kmt on max 👍👍😊Vennlig hilsen Morten Tonheim-------- Opprinnelig melding --------Fra: Benjamin Sølberg @.>Dato: søn. 25. jul. 2021, 21:01Til: BenjaminSoelberg/wilfa-e-way-electric-scooter-hack @.>Kopi: Mortenton @.>, Comment @.>Emne: Re: [BenjaminSoelberg/wilfa-e-way-electric-scooter-hack] There was a problem parsing the package (#1) Good to hear. What is the maximum speed on the e500 ?

—You are receiving this because you commented.Reply to this email directly, view it on GitHub, or unsubscribe.

maruudn commented 3 years ago

I'm having the same issue as the OP, on Sony Xperia 1 ii (XQ-AT51) running Android 11, July security patch. I tried to install the app with adb, getting the following error: image

Edit: I had no problem installing the unpatched version from your GitHub (via adb).

maruudn commented 3 years ago

I was able to install the app with no problems on my older HTC U11 running Android 9. Tested with my E-600 MAX and reached 42 KM/h (!). Pretty scary, to be honest! If I had a longer stretch of road I think I could have gone even faster, but I'll probably stick to 25 KM/h.

maruudn commented 3 years ago

@BenjaminSoelberg any progress on this issue? I'd really like to be able to use the app on my main phone. Sucks not being able to use the app on my main phone to lock the scooter etc.

ataz commented 3 years ago

Don't have an older Android so would also be happy with progress on this issue :)

ataz commented 3 years ago

Also would like to add for anyone else who wants to just unlock 25 km/h, there is another solution, which is to install a VPN and set the location to Helsinki Finland (which is a market which allows 25 km/h). Then also install a GPS spoofing app and set the location to Helsinki. When using the original app from E-way, you will then be able to unlock the scooter to 25. Note that you will either always need to have the VPN on when using their app, or simply delete it after unlocking 25.

BenjaminSoelberg commented 3 years ago

So I have tried to fix this issue by upgrading apktool as well as extracting/repacking resources. Hopefully this now generates a valid resource bundle. Since I don't have a newer Android phone it will be up to you guys to test it.

maruudn commented 3 years ago

it will be up to you guys to test it.

@BenjaminSoelberg Unfortunately I'm still having the same issue.

maruudn commented 2 years ago

@BenjaminSoelberg just wondering if this is still being worked on?

sjm42 commented 2 years ago

Well, I can confirm this error message on Android 11 and 12 after trying with two different phones from Cat and Samsung. Rebuilding the apk on my Linux machine did not help. There must be something wrong with the apk metadata or something like that.

But on a huawei tablet with Android 8 the pre-built apk installs ok and works.

Lindoffx commented 2 years ago

I Recompiled and Zipaligned .apk now it installs on Android 12 no issues. Hack works great, Cheers. PS.. Tested on E-way E-2540. Stock speed 20km/h. Waiting for fully charge but 25km/h on low battery with unlocked speed.

Download

johbec commented 2 years ago

I Recompiled and Zipaligned .apk now it installs on Android 12 no issues. Hack works great, Cheers. PS.. Tested on E-way E-2540. Stock speed 20km/h. Waiting for fully charge but 25km/h on low battery with unlocked speed.

Download

You sir, are a hero <3

I can confirm that it works on the following hardware and Android version bundle:

DEVICE | VERSION OF ANDROID OS

Sony Xperia XZ1Compact : (rooted with custom rom built on) Android 10 Samsung Galaxy S10 : Android 11 Samsung Galaxy S21+5G : Android 12

Thank you! :D

BenjaminSoelberg commented 2 years ago

Fantastic. Can you tell me how to realign the apk ?

Mvh / Best regards Benjamin Sølberg

Den 6. aug. 2022 kl. 11.51 skrev johbec @.***>:

 I Recompiled and Zipaligned .apk now it installs on Android 12 no issues. Hack works great, Cheers. PS.. Tested on E-way E-2540. Stock speed 20km/h. Waiting for fully charge but 25km/h on low battery with unlocked speed.

Download

You sir, are a hero <3

I can confirm that it works on the following hardware and Android version bundle:

DEVICE | VERSION OF ANDROID OS

Sony Xperia XZ1Compact : (rooted with custom rom built on) Android 10 Samsung Galaxy S10 : Android 11 Samsung Galaxy S21+5G : Android 12

Thank you! :D

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.

johbec commented 2 years ago

I Recompiled and Zipaligned .apk now it installs on Android 12 no issues. Hack works great, Cheers. PS.. Tested on E-way E-2540. Stock speed 20km/h. Waiting for fully charge but 25km/h on low battery with unlocked speed.

Download

Yeah, could you give us the steps to zipalign and/if you compiled with and non default parameters or flags? Thanks