Installation of certificate in Android Studio: הבדלים בין גרסאות בדף

מתוך ויקי נטפרי
קפיצה לניווט קפיצה לחיפוש
מ (ניסוח)
שורה 4: שורה 4:
 
{{Navigation|Security certificate}}
 
{{Navigation|Security certificate}}
  
Download the certificate of your Provider of NetFree from here. http://netfree.link/netfree-ca.crt
+
Download the certificate for your Internet provider from here: http://netfree.link/netfree-ca.crt.
  
 
Open the Settings window in Android Studio:  ''File'' > ''Settings'' > '' Tools'' > ''Server Certificates'',
 
Open the Settings window in Android Studio:  ''File'' > ''Settings'' > '' Tools'' > ''Server Certificates'',
שורה 15: שורה 15:
  
 
If this does not work, try the next step:
 
If this does not work, try the next step:
 +
 
Open the command prompt in Admin mode, and paste the following command (before doing so change the certificate location if it is not in drive C):
 
Open the command prompt in Admin mode, and paste the following command (before doing so change the certificate location if it is not in drive C):
  
 
<pre>
 
<pre>
 
"C:\Program Files\Android\Android Studio\jre\jre\bin\keytool" -noprompt -trustcacerts -keystore "C:\Program Files\Android\Android Studio\jre\jre\lib\security\cacerts" -importcert -alias nf -file "C:\netfree-ca.crt" -storepass changeit
 
"C:\Program Files\Android\Android Studio\jre\jre\bin\keytool" -noprompt -trustcacerts -keystore "C:\Program Files\Android\Android Studio\jre\jre\lib\security\cacerts" -importcert -alias nf -file "C:\netfree-ca.crt" -storepass changeit
</pre>The command for Mac pc is:
+
</pre>The command for macOS is:
 
  sudo keytool -import -trustcacerts -alias netfree-ca -file Downloads/netfree-ca.crt -keystore /Library/Java/JavaVirtualMachines/jdk-11.0.1.jdk/Contents/Home/lib/security/cacerts -storepass changeit
 
  sudo keytool -import -trustcacerts -alias netfree-ca -file Downloads/netfree-ca.crt -keystore /Library/Java/JavaVirtualMachines/jdk-11.0.1.jdk/Contents/Home/lib/security/cacerts -storepass changeit
When in instead of <code>Downloads/netfree-ca.crt</code>Write the path to the NetFreק certificate downloaded from [http://netfree.link/netfree-ca.crt here].
+
Replace <code>Downloads/netfree-ca.crt</code> with the path to the NetFree certificate which may be downloaded from [http://netfree.link/netfree-ca.crt here].
  
 
'''Note:''' This solution will cause an error when trying to install updates to the IDE. This is caused by a change to one of the software's core files. To install software updates to the IDE, we recommend that you back up the cacerts file before running the action. Before installing an update, restore the cacerts file from the backup file. After installing the update you will need to run the above commands again.
 
'''Note:''' This solution will cause an error when trying to install updates to the IDE. This is caused by a change to one of the software's core files. To install software updates to the IDE, we recommend that you back up the cacerts file before running the action. Before installing an update, restore the cacerts file from the backup file. After installing the update you will need to run the above commands again.

גרסה מ־19:10, 28 בנובמבר 2019

לעברית לחצו כאן

To switch from edit view to read view

To search in the Wiki

Home page > Security certificate > Installation of certificate in Android Studio ‎‎


Download the certificate for your Internet provider from here: http://netfree.link/netfree-ca.crt.

Open the Settings window in Android Studio: File > Settings > Tools > Server Certificates,

Click on the green plus and add the certificate from the downloaded file.

android-studio

Note: This solution is probably not useful for the gradle subprocesses that the IDE runs. It turns out you will get gradle errors and need the next solution.

If this does not work, try the next step:

Open the command prompt in Admin mode, and paste the following command (before doing so change the certificate location if it is not in drive C):

"C:\Program Files\Android\Android Studio\jre\jre\bin\keytool" -noprompt -trustcacerts -keystore "C:\Program Files\Android\Android Studio\jre\jre\lib\security\cacerts" -importcert -alias nf -file "C:\netfree-ca.crt" -storepass changeit
The command for macOS is:
sudo keytool -import -trustcacerts -alias netfree-ca -file Downloads/netfree-ca.crt -keystore /Library/Java/JavaVirtualMachines/jdk-11.0.1.jdk/Contents/Home/lib/security/cacerts -storepass changeit

Replace Downloads/netfree-ca.crt with the path to the NetFree certificate which may be downloaded from here.

Note: This solution will cause an error when trying to install updates to the IDE. This is caused by a change to one of the software's core files. To install software updates to the IDE, we recommend that you back up the cacerts file before running the action. Before installing an update, restore the cacerts file from the backup file. After installing the update you will need to run the above commands again.

Another option is to download the full new version and install it instead of upgrading from the software.


Alternate method

If you have on your computer another JDK installed with NetFree's certificate, you can configure Android Studio to use an alternate JDK instead of its embedded JDK.

To do this, press ctrl + shift + a, type the command: "switch boot JDK" and enter.

In the next window you select the replacement JDK.

Note: Doing so can cause unexpected problems and is at the user's sole responsibility.