Error
The authenticity of host 'github.com (140.82.113.4)' can't be established.
Fix
ssh-keyscan github.com >> ~/.ssh/known_hostsError
The authenticity of host 'github.com (140.82.113.4)' can't be established.
Fix
ssh-keyscan github.com >> ~/.ssh/known_hosts| // Retrofit upload selected image | |
| // https://futurestud.io/tutorials/retrofit-2-how-to-upload-files-to-server | |
| // === Retrofit service === | |
| interface MediaService { | |
| @Multipart | |
| @POST("url") | |
| suspend fun upload( | |
| @Part("description") description: RequestBody, |
| import Foundation | |
| struct AnyError: Error { | |
| let error: Error | |
| init(_ error: Error) { | |
| self.error = error | |
| } | |
| } |
Create new keystore.jks file with comand line (not android studio build menu)
Linux: keytool -genkeypair -alias upload -keyalg RSA -keysize 2048 -validity 9125 -keystore keystore.jks
Windows: "C:\Program Files\Android\Android Studio\jre\bin\keytool.exe" -genkeypair -alias upload -keyalg RSA -keysize 2048 -validity 9125 -keystore "C:\keystore_new.jks"
Generate a .pem file from new keystore
| package dk.im2b | |
| import java.io.OutputStream | |
| import java.net.ServerSocket | |
| import java.net.Socket | |
| import java.nio.charset.Charset | |
| import java.util.* | |
| import kotlin.concurrent.thread | |
| import android.annotation.TargetApi; | |
| import android.content.Context; | |
| import android.graphics.Bitmap; | |
| import android.graphics.Canvas; | |
| import android.graphics.pdf.PdfDocument; | |
| import android.graphics.pdf.PdfRenderer; | |
| import android.os.AsyncTask; | |
| import android.os.Build; | |
| import android.os.ParcelFileDescriptor; | |
| import android.util.Log; |
This means, on your local machine, you haven't made any SSH keys. Not to worry. Here's how to fix:
*nix based command prompt (but not the default Windows Command Prompt!)cd ~/.ssh. This will take you to the root directory for Git (Likely C:\Users\[YOUR-USER-NAME]\.ssh\ on Windows).ssh folder, there should be these two files: id_rsa and id_rsa.pub. These are the files that tell your computer how to communicate with GitHub, BitBucket, or any other Git based service. Type ls to see a directory listing. If those two files don't show up, proceed to the next step. NOTE: Your SSH keys must be named id_rsa and id_rsa.pub in order for Git, GitHub, and BitBucket to recognize them by default.ssh-keygen -t rsa -C "your_email@example.com". Th