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

How to change package name without error? #2160

Closed
leopedro95 opened this issue Jul 4, 2021 · 4 comments
Closed

How to change package name without error? #2160

leopedro95 opened this issue Jul 4, 2021 · 4 comments

Comments

@leopedro95
Copy link

Hi, I'm new to android development and I'm editing the termux script for a study. However, when I change the package name "com.termux" to anything else, it doesn't work.

Can anyone tell me what's stopping me? When compiling I don't have any error, the error I get is when I open the app on android, I get the following error: "failed to get context from package "com.termux". This can be because the app package is not installed app or has a different APK signature. Check the installation instructions at: https://github.com/termux/termux-app for more details."

I've done everything in my power, can you give me an idea how to solve it?

@ghost
Copy link

ghost commented Jul 4, 2021

Application package name is not easily changeable. Every .deb file installable inside Termux is bound to application package name, so path

/data/data/com.termux/files/usr

will exist. For same reason Termux doesn't support installations for secondary device accounts.

Also before installing the modified APK you need to completely uninstall the original Termux application and add-ons Termux:API, Termux:Styling, Termux:Boot and others.

@ghost ghost closed this as completed Jul 4, 2021
@agnostic-apollo
Copy link
Member

agnostic-apollo commented Jul 4, 2021

Failed to get package context for the "com.termux" package. This may be because the app package is not installed or it has different APK signature from the current app. Check install instruction at https://github.com/termux/termux-app for more details.

That error would have been thrown when this is called and actually thrown via PackageUtils.

  • Check TermuxConstants javadocs for instructions on what changes to make in the app to change package name.
  • You also need to recompile bootstrap zip for the new package name. Check here and here.

@leopedro95
Copy link
Author

Failed to get package context for the "com.termux" package. This may be because the app package is not installed or it has different APK signature from the current app. Check install instruction at https://github.com/termux/termux-app for more details.

That error would have been thrown when this is called and actually thrown via PackageUtils.

  • Check TermuxConstants javadocs for instructions on what changes to make in the app to change package name.
  • You also need to recompile bootstrap zip for the new package name. Check here and here.

thank you so much! I will try, thank you.

@agnostic-apollo
Copy link
Member

You are welcome.

This issue was closed.
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