키 스토어를 어떻게 만들 수 있습니까?
일식 환경에서 Android 용 키 저장소를 작성하는 단계는 무엇입니까? 앱에서 Google지도를 사용해야하는데 어떤 단계를 놓쳤는 지 모르겠습니다. 구체적인 세부 단계를 알려주십시오 (가이드에서 이해하지 못했습니다).
제목의 질문에 대답하기 위해 표준 JDK 배포판과 함께 제공되는 Java Keytool 유틸리티를 사용하여 키 저장소를 작성하십시오 %JAVA_HOME%\bin
. Windows에서 이것은 일반적으로 C:\Program Files\Java\jre7\bin
입니다.
따라서 Windows에서 명령 창을 열고 해당 디렉토리로 전환하고 다음과 같은 명령을 입력하십시오.
keytool -genkey -v -keystore my-release-key.keystore -alias alias_name -keyalg RSA -keysize 2048 -validity 10000
Keytool은 키 저장소의 비밀번호를 제공하고 식별 이름 필드를 제공 한 후 키의 비밀번호를 프롬프트합니다. 그런 다음 키 저장소를 사용자가있는 디렉토리에 my-release-key.keystore라는 파일로 생성합니다. 키 저장소와 키는 입력 한 비밀번호로 보호됩니다. 키 저장소에는 단일 키가 있으며 10000 일 동안 유효합니다. 별명은 응용 프로그램에 서명 할 때이 키 저장소를 참조하기 위해 나중에 사용할 이름입니다.
Keytool에 대한 자세한 정보는 다음 문서를 참조하십시오. http://docs.oracle.com/javase/6/docs/technotes/tools/windows/keytool.html
Android 앱 서명에 대한 자세한 내용은 http://developer.android.com/tools/publishing/app-signing.html을 참조하십시오.
Android Studio에서 앱 서명
Android Studio에서 앱을 릴리스 모드로 서명하려면 다음 단계를 따르십시오.
1- 메뉴 표시 줄에서 빌드> 서명 된 APK 생성을 클릭하십시오.
2-Signed APK 생성 마법사 창에서 새로 생성을 클릭하여 새 키 저장소를 생성하십시오. 키 저장소가 이미 있으면 4 단계로 이동하십시오.
3- New Key Store 창에서 그림과 같이 필요한 정보를 제공하십시오. 키는 최소 25 년 동안 유효해야하므로 앱 수명 기간 동안 동일한 키로 앱 업데이트에 서명 할 수 있습니다.
4- 서명 된 APK 생성 마법사 창에서 키 저장소, 개인 키를 선택하고 두 암호를 모두 입력하십시오. 그런 다음 다음을 클릭하십시오.
5- 다음 창에서 서명 된 APK의 대상을 선택하고 완료를 클릭하십시오.
참조
http://developer.android.com/tools/publishing/app-signing.html
셸에서 단일 행 명령을 사용하여 .keystore를 생성하는 방법을 찾고 있었 으므로 다른 응용 프로그램에서 실행할 수 있습니다. 이게 방법이야:
echo y | keytool -genkeypair -dname "cn=Mark Jones, ou=JavaSoft, o=Sun, c=US" -alias business -keypass kpi135 -keystore /working/android.keystore -storepass ab987c -validity 20000
dname 은 .keystore의 응용 프로그램에 대한 고유 식별자입니다.
- cn .keystore를 생성하는 개인 또는 조직의 전체 이름
- ou 프로젝트를 생성하는 조직 구성 단위, 프로젝트를 생성하는 조직의 세분. 전의. android.google.com
- o 전체 프로젝트의 조직 소유자. ou 보다 높은 범위 입니다. 예 : google.com
- c 국가 단축 코드. 예 : 미국의 경우 "US"
.keystore 내부의 단일 엔터티로 앱의 별칭 식별자 (많은 것을 가질 수 있음)
- keypass 해당 별명을 보호하기위한 비밀번호입니다.
- keystore .keystore 파일이 생성 될 경로 (표준 확장자는 실제로
.ks
) - storepass 전체 .keystore 컨텐츠 를 보호하기위한 비밀번호입니다 .
- 유효성 이 .keystore를 사용 하여 앱이 유효한 날짜 수
그것은 나를 위해 정말 잘 작동했으며 콘솔에서 다른 것을 요구하지 않고 파일을 만듭니다. 자세한 내용은 keytool-Key 및 Certificate Management Tool을 참조하십시오 .
명령 행에서 키 저장소 파일을 작성하십시오.
명령 행을여십시오 :
Microsoft Windows [Version 6.1.7601] Copyright (c) 2009 Microsoft Corporation. All rights reserved // (if you want to store keystore file at C:/ open command line with RUN AS ADMINISTRATOR) C:\Windows\system32> keytool -genkey -v -keystore [your keystore file path]{C:/index.keystore} -alias [your_alias_name]{index} -keyalg RSA -keysize 2048 -validity 10000[in days]
입력> 비밀번호를 묻는 메시지가 표시됩니다> 비밀번호를 입력하십시오 (보이지 않음).
Enter keystore password: Re-enter new password:
입력> 세부 사항을 묻습니다.
What is your first and last name? [Unknown]: {AB} // [Your Name / Name of Signer] What is the name of your organizational unit? [Unknown]: {Self} // [Your Unit Name] What is the name of your organization? [Unknown]: {Self} // [Your Organization Name] What is the name of your City or Locality? [Unknown]: {INDORE} // [Your City Name] What is the name of your State or Province? [Unknown]: {MP} //[Your State] What is the two-letter country code for this unit? [Unknown]: 91
입력> Y 입력
Is CN=AB, OU=Self, O=Self, L=INDORE, ST=MP, C=91 correct? [no]: Y
> 비밀번호 입력을 다시 입력하십시오.
Generating 2,048 bit RSA key pair and self-signed certificate (SHA256withRSA) with a validity of 10,000 days for: CN=AB, OU=Self, O=Self, L=INDORE, ST=MP, C=91 Enter key password for <index> (RETURN if same as keystore password): Re-enter new password:
[C : /index.keystore 저장]
- 그리고 너는 끝났어 !!!
Eclipse에서 내보내기 :
작성된 키 저장소 파일을 사용하여 Android 패키지를 .apk로 내보내기
내보낼 패키지를 마우스 오른쪽 버튼으로 클릭하고 내보내기를 선택하십시오.
Android 애플리케이션 내보내기> 다음을 선택하십시오.
다음
Android Studio에서 :
[.keystore/.jks]
스튜디오에서 키 스토어 생성 ...
빌드 (Alt + B) > 서명 된 APK 생성 ...을 클릭 하십시오 .
새로 작성을 클릭 하십시오. (ALT + C)
.jks/keystore
파일 에 대한 세부 사항 작성다음
파일
Enter Studio Master Password (You can RESET if you don't know) > OK
Select *Destination Folder * > Build Type
release : for publish on app store debug : for debugging your application
Click Finish
Done !!!
This tutorial:
http://techdroid.kbeanie.com/2010/02/sign-your-android-applications-for.html
was very helpful for me the first time I had to create a keystore. It is simple but the instructions on developer.android.com are a little too brief.
The part I was unsure about was where to save and what name to give the keystore file.
I seems it doesn't matter where you put it just be sure to keep it safe and keep a number of backups. I just put it in my app directory
Name the file "something.keystore" where something can be whatever you want. I used app_name.keystore, where app_name was the name of my app.
The next part was what to name the alias. Again it doesn't seem to matter so again I just used the app_name again. Keep the passwords the same as you used before. Fill out the rest of the fields and you are done.
I followed this guide to create the debug keystore.
The command is:
keytool -genkeypair -alias androiddebugkey -keypass android -keystore debug.keystore -storepass android -dname "CN=Android Debug,O=Android,C=US" -validity 9999
Use this command to create debug.keystore
keytool -genkey -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android -keyalg RSA -keysize 2048 -validity 10000 -dname "CN=Android Debug,O=Android,C=US"
First thing to know is wether you are in Debug or Release mode. From the developer site "There are two build modes: debug mode and release mode. You use debug mode when you are developing and testing your application. You use release mode when you want to build a release version of your application that you can distribute directly to users or publish on an application marketplace such as Google Play."
If you are in debug mode you do the following ...
A. Open terminal and type:
keytool -exportcert -alias androiddebugkey -keystore path_to_debug_or_production_keystore -list -v
Note: For Eclipse, the debug keystore is typically located at ~/.android/debug.keystore...
B. when prompted for a password simply enter "android" ...
C. If you are in Release mode follow the instructions on...
http://developer.android.com/tools/publishing/app-signing.html <-- this link pretty much explains everything you need to know.
You can create your keystore by exporting a signed APK. When you will try to export/build a signed APK, it will ask for a keystore.
You can choose your existing keystore or you can easily create a new one by clicking create new keystore
Here a link very useful and well-explained of how to create your keystore and generate a signed APK
THis link explained how to do it with Android Studio, but if I remember, it is pretty similar on Eclipse
WATCH OUT
Once you generate your keystore, keep it somewhere safe because you will need it to regenerate a new signed APK.
How do I export a project in the Android studio?
I'd like to suggest automatic way with gradle only
** 마지막 명령에서 키 저장소에 대한 추가 매개 변수를 하나 이상 정의하십시오 (예 : 국가 '-dname', 'c=RU'
**).
apply plugin: 'com.android.application'
// define here sign properties
def sPassword = 'storePassword_here'
def kAlias = 'keyAlias_here'
def kPassword = 'keyPassword_here'
android {
...
signingConfigs {
release {
storeFile file("keystore/release.jks")
storePassword sPassword
keyAlias kAlias
keyPassword kPassword
}
}
buildTypes {
debug {
signingConfig signingConfigs.release
}
release {
shrinkResources true
minifyEnabled true
useProguard true
signingConfig signingConfigs.release
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
...
}
...
task generateKeystore() {
exec {
workingDir projectDir
commandLine 'mkdir', '-p', 'keystore'
}
exec {
workingDir projectDir
commandLine 'rm', '-f', 'keystore/release.jks'
}
exec {
workingDir projectDir
commandLine 'keytool', '-genkey', '-noprompt', '-keystore', 'keystore/release.jks',
'-alias', kAlias, '-storepass', sPassword, '-keypass', kPassword, '-dname', 'c=RU',
'-keyalg', 'RSA', '-keysize', '2048', '-validity', '10000'
}
}
project.afterEvaluate {
preBuild.dependsOn generateKeystore
}
프로젝트 동기화 및 빌드시 키 저장소가 생성됩니다.
> Task :app:generateKeystore UP-TO-DATE
> Task :app:preBuild UP-TO-DATE
Android Studio를 원하지 않거나 사용할 수없는 경우 create-android-keystore NPM 도구를 사용할 수 있습니다.
$ create-android-keystore quick
현재 디렉토리에 새로 생성 된 키 저장소가 생성됩니다.
추가 정보 : https://www.npmjs.com/package/create-android-keystore
참고 URL : https://stackoverflow.com/questions/3997748/how-can-i-create-a-keystore
'Programming' 카테고리의 다른 글
잠금은 정확히 어떻게 작동합니까? (0) | 2020.02.14 |
---|---|
Android 장치에서 로컬 호스트에 어떻게 액세스 할 수 있습니까? (0) | 2020.02.14 |
태그에서 새 브랜치를 만드는 방법은 무엇입니까? (0) | 2020.02.14 |
jQuery를 사용하여 입력이 비어 있는지 확인하십시오. (0) | 2020.02.14 |
Subversion에서 이전 버전의 코드로 돌아가려면 어떻게합니까? (0) | 2020.02.14 |