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

binding report: Different Sdk version #569

Open
5 tasks done
oldmonk007 opened this issue Jul 26, 2024 · 19 comments
Open
5 tasks done

binding report: Different Sdk version #569

oldmonk007 opened this issue Jul 26, 2024 · 19 comments
Assignees
Labels
Error: Apktool Apktool returned an error

Comments

@oldmonk007
Copy link

Payload Options

  • Activity-method bound payload
  • Boot-method bound payload

binding issue description

When binding to apk requiring android version 8+, error is being reported while binding

Error logs

Error: Command failed: java -jar "C:\Users\oldmo\AppData\Local\Programs\AhMyth\resources\app.asar.unpacked\app\Factory\apktool.jar" b "C:\Users\oldmo\Downloads\Kavach Authentication_4.6.8_APKPure" -o "C:\Users\oldmo\AhMyth\Output\Ahmyth.apk" --use-aapt2 ""
W: C:\Users\oldmo\Downloads\Kavach Authentication_4.6.8_APKPure\res\mipmap-anydpi\ic_launcher.xml: error: <adaptive-icon> elements require a sdk version of at least 26.
W: C:\Users\oldmo\Downloads\Kavach Authentication_4.6.8_APKPure\res\mipmap-anydpi\ic_launcher_round.xml: error: <adaptive-icon> elements require a sdk version of at least 26.
W: error: failed linking file resources.
brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [C:\Users\oldmo\AppData\Local\Temp\brut_util_Jar_165454822531174833214568862362358827033.tmp, link, -o, C:\Users\oldmo\AppData\Local\Temp\APKTOOL2002108191903207765.tmp, --package-id, 127, --min-sdk-version, 19, --target-sdk-version, 22, --version-code, 44, --version-name, 4.6.8, --no-auto-version, --no-version-vectors, --no-version-transitions, --no-resource-deduping, --allow-reserved-package-id, -e, C:\Users\oldmo\AppData\Local\Temp\APKTOOL2987074252193255482.tmp, -0, arsc, -I, C:\Users\oldmo\AppData\Local\apktool\framework\1.apk, --manifest, C:\Users\oldmo\Downloads\Kavach Authentication_4.6.8_APKPure\AndroidManifest.xml, C:\Users\oldmo\Downloads\Kavach Authentication_4.6.8_APKPure\build\resources.zip]

Solution

No response

Additional context

No response

Acknowledgements

  • This issue is not a duplicate of an existing binding report.
  • I have chosen an appropriate title.
  • All requested information has been provided properly.
@Morsmalleo Morsmalleo added the Error: Apktool Apktool returned an error label Jul 26, 2024
@Morsmalleo
Copy link
Owner

Morsmalleo commented Jul 26, 2024

Beautiful binding report, filled out perfectly!

The issue is due to this problem here below 👇

W: C:\Users\oldmo\Downloads\Kavach Authentication_4.6.8_APKPure\res\mipmap-anydpi\ic_launcher.xml: error: <adaptive-icon> elements require a sdk version of at least 26.

W: C:\Users\oldmo\Downloads\Kavach Authentication_4.6.8_APKPure\res\mipmap-anydpi\ic_launcher_round.xml: error: <adaptive-icon> elements require a sdk version of at least 26.

The error states that the elements in the original legit APK's manifest file that use <adaptive-icon> ( in this case <adaptive-icon> refers to both the ic_launcher icon and ic_launcher_round icon for the original legit apk) requires the use of SDK 26 (Android 9 I do believe that is) and above, as mentioned in the error above for both XML icon elements.

<adaptive-icon> elements require a sdk version of at least 26.

This is definitely a new one for me so I'll do some research on this and get back to you, there may be a workaround, there may not be, we'll see. I'll report back here once I have something

@Morsmalleo
Copy link
Owner

Still doing research on this to see if there's a workaround I can implement.

@oldmonk007
Copy link
Author

I was also trying to find some work around and i think following might be of some help: -

  1. apktool.yml file is generated after decompiling and making changes in original apk. This file contains the minimum and target sdk version.
  2. The androidmanifest.xml file is also generated in the decompiled folder.

I tried changing the minimum and target android version in these files and separately compiled with apktool and it was successful. However there was parsing error while installing on android, i think due to signing issues.

I could not find the way how the apktool.yml and AndroidManifest.xml are being created in decompiled folder. If there is a way that AhMyth can change these two files as per original apk, i think the issue would be solved.

@Morsmalleo Morsmalleo self-assigned this Sep 14, 2024
@dr1408
Copy link

dr1408 commented Sep 22, 2024

Im facing the same issue wehn binding instagram lite .. for boot method it build .. but for activity method it dosent build for same launcher icon need sdk26 issue ? How can i fix it

@Morsmalleo
Copy link
Owner

Sorry guys I've got a very big workload ahead of me for the next release, I'll take a look at this as soon as possible.

@dr1408
Copy link

dr1408 commented Sep 22, 2024

Keep it up sir thanks for all efforts .. i hope we see the realese soon .. god bless you

@dr1408
Copy link

dr1408 commented Sep 27, 2024

Ok so i read more on this subject and i fixed my app .. the folder with apktool error contain adaptive icon in ic_launcher.xml .. i removed that file and grabbed icon form google rename it to ic_launcher.png then i build the apk but didn install cause its built with old sdk i changed sdk to minimum 26 and target can be till latest android .. then it work but only camera feature didn work and pics and videos not present in file explorer only folders .. also the pause app while not active is on by default in app settings .. not like the apps binded by ahmyth but its good start to have fixes.. that was my case .. the weird thing it bind successfully on boot method .. the one i made manually is for activity method and its working with instagram lite apk🙏🏼

@dr1408
Copy link

dr1408 commented Sep 27, 2024

Adaptive icons with .xml require min sdk of 26 while png icons works with old android maybe if you decompile instagram lite for both methods you can capture the differnect that dosent make it build well on activity method

@dr1408
Copy link

dr1408 commented Sep 28, 2024

Ok now i noticed when you dont apply the correct sign version like v2 or v3 the app will not install on old sdk and on newer sdk camera feature so i changed sdk back to min 19 and target 22 and applied correct signing binded app is working fine 👍🏻

@dr1408
Copy link

dr1408 commented Sep 29, 2024

Found easier fix : in decompiled folder after binding failure .. rename folder mipmap-anydpi to mipmap-anydpi-v26 .. then it will build normally

@Morsmalleo
Copy link
Owner

Found easier fix : in decompiled folder after binding failure .. rename folder mipmap-anydpi to mipmap-anydpi-v26 .. then it will build normally

Lovely work my friend! Seems like you've found a workaround, I'll do some more research on this workaround and see if we can apply it multiple APK files, if we can, I'll integrate code responsible for applying this work around automatically during binding On Activity.

@dr1408
Copy link

dr1408 commented Sep 30, 2024

Thanks sir i hope it work for all .. the issue is the sdk version .. aand when we build on newer sdk the permissions page dont show on start we need to enter app settings and give permission manually and camera feature dosent work even if permission on .. i hope there is a way to make permissions hiddenly auto granted and camera fixed on newer sdk that will be fun

@Morsmalleo
Copy link
Owner

aand when we build on newer sdk the permissions page dont show on start we need to enter app settings

This because after Android 5.1, the Android Runtime Permissions Model was officially introduced as part of the Android System when Android 6.0 released. The permissions page you'll see when the SDK versions are set to 16 for minSdkVersion and 22 for targetSdkVersion are Install-Time Permissions , this is the old permissions model that handled permissions before Android 6.0. As of today, modern Android versions still ustilise the old Install-Time Permissions System for compatibility with older apps, if they didn't do this you wouldn't be able to run most older apps on newer android versions, most android devices these days also still allow the uses of deprecated API's as well such as the deprecated camera API over the recommended camera2 API in Java. This however isn't the case for all android versions though, some devices reject older apps. Currently AhMyth leverages a lot of Androids backwards compatibility features.

and give permission manually and camera feature doesn't work even if permission on .. i hope there is a way to make permissions hiddenly auto granted and camera fixed on newer sdk that will be fun

Due to background limitations introduced after android 5.1, features such as the camera and microphone requires the payload to be open.

@Morsmalleo
Copy link
Owner

Morsmalleo commented Oct 1, 2024

As for the icon problem, converting the XML vector drawable icon to PNG just simply won't work, however if we were to take AhMyth's icon and convert this from PNG to SVG, this would allow us to make an XML Vector Drawable equivalent of AhMyth's icon because once the PNG icon has been converted to SVG, it can then be converted to XML Vector Drawable. Doing this may allow AhMyth to utilise a higher SDK version as dirty fix.

I'll look into this more

@mambohuyambo
Copy link

mambohuyambo commented Oct 1, 2024

Hi dear.. I have a problem when i install binded with any apk to any android device (Virtual, Phisical):
image

updated:
this error shows when i install from adb.
when install from "My files" and etc app shows not installed

sorry my english is bad..

i use activity method.

@Morsmalleo
Copy link
Owner

Hi dear.. I have a problem when i install binded with any apk to any android device (Virtual, Phisical): image

updated: this error shows when i install from adb. when install from "My files" and etc app shows not installed

sorry my english is bad..

i use activity method.

Hmm that's a new one, this would also explain why the payload doesn't work on some devices such Xiaomi.

Looks like I'm going to have to speed up development on the modern AhMyth payload I'm building.

Until then I'll do some research to see if I can find a workaround until then

@dr1408
Copy link

dr1408 commented Oct 2, 2024

It worked on my poco x3 nfc with my solution you just change the file name then build

@dr1408
Copy link

dr1408 commented Oct 2, 2024

And you should sign with the correct signature of the original apk or it will not install

@Morsmalleo
Copy link
Owner

And you should sign with the correct signature of the original apk or it will not install

Yes currently AhMyth utilises test keys for signing, it will utilise its own signing keys once the project reaches a stable release, once that happens it will also allow users the option to sign with their own keys as well.

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

No branches or pull requests

4 participants