Giter Club home page Giter Club logo

Comments (10)

ClaudiuGeorgiu avatar ClaudiuGeorgiu commented on May 28, 2024 1

Hi @esauvisky, there is no particular reason for having an hardcoded keystore (maybe just to keep the configuration minimal for who is using the tool). We hardcoded it when we started the development since the keystore parameters were always the same, but actually it's a good idea to make this configurable via CLI: I think we should add --keystore-file, --keystore-password and --key-alias optional parameters (and fallback to the default keystore if none of these parameters are provided).

from obfuscapk.

ClaudiuGeorgiu avatar ClaudiuGeorgiu commented on May 28, 2024

Have you used the correct password and key alias? Currently this information is hard-coded in the following code, so if you change the keystore you have to also change the password and the key alias.

jarsigner.resign(
self.obfuscated_apk_path,
os.path.join(
os.path.dirname(__file__), "resources", "obfuscation_keystore.jks"
),
"obfuscation_password",
"obfuscation_key",
)

from obfuscapk.

skreenr avatar skreenr commented on May 28, 2024

Looks like it needs a way to pass a new password;
How can I do that?

from obfuscapk.

skreenr avatar skreenr commented on May 28, 2024

I see the part you refer to;
so Which one is the passwd and the alias?

os.path.dirname(file), "resources", "obfuscation_keystore.jks"
),
"obfuscation_password",
"obfuscation_key",

from obfuscapk.

skreenr avatar skreenr commented on May 28, 2024

Looking at this https://docs.oracle.com/javase/tutorial/deployment/jar/signing.html
and this
https://docs.oracle.com/javase/7/docs/technotes/tools/windows/jarsigner.html#CCHFIDAB
I am having trouble reconciling with your syntax:
their examples only have Alias parameter after the .apk file; yours obviously differs
Please explain.

from obfuscapk.

ClaudiuGeorgiu avatar ClaudiuGeorgiu commented on May 28, 2024

Here is the final code that is executed to sign the application (the above code is only a helper method):

sign_cmd: List[str] = [
self.jarsigner_path,
"-tsa",
"http://timestamp.comodoca.com/rfc3161",
"-sigalg",
"SHA1withRSA",
"-digestalg",
"SHA1",
"-keystore",
keystore_file_path,
"-storepass",
keystore_password,
apk_path,
key_alias,
]

from obfuscapk.

skreenr avatar skreenr commented on May 28, 2024

Seems to be working now, thanks!

from obfuscapk.

esauvisky avatar esauvisky commented on May 28, 2024

Sorry for bumping a closed issue, but is there any particular reason for the signing to be hardcoded? For me it'd make more sense if you could specify your own keystore, pass and alias from the CLI for example 🤔

from obfuscapk.

skreenr avatar skreenr commented on May 28, 2024

from obfuscapk.

ClaudiuGeorgiu avatar ClaudiuGeorgiu commented on May 28, 2024

I think we should add --keystore-file, --keystore-password and --key-alias optional parameters (and fallback to the default keystore if none of these parameters are provided).

Implemented with latest commit 7860fc1.

from obfuscapk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.