Created
April 1, 2022 08:29
-
-
Save gamefish/aa7006ba62bebae2291e593e29408c1f to your computer and use it in GitHub Desktop.
[Auto fill android signing password in unity editor] #unity #editor #signing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using UnityEditor; | |
using System.IO; | |
[InitializeOnLoad] | |
public class AutoFillAndroidSignPassword | |
{ | |
static AutoFillAndroidSignPassword () | |
{ | |
if (!File.Exists("BuildConfig.txt")) | |
{ | |
EditorUtility.DisplayDialog | |
( | |
"找不到Build Config", | |
"在工程根目录创建BuildConfig.txt. 写3行: 1. The keystore password, 2.Alias name 3. The key password. 记得在git里面忽略这个文件,不要提交", | |
"OK" | |
); | |
return; | |
} | |
StreamReader configReader = new StreamReader("BuildConfig.txt"); | |
string keystorePass = configReader.ReadLine(); | |
string keyaliasName = configReader.ReadLine(); | |
string keyaliasPass = configReader.ReadLine(); | |
configReader.Close(); | |
PlayerSettings.Android.keystorePass = keystorePass; | |
PlayerSettings.Android.keyaliasName = keyaliasName; | |
PlayerSettings.Android.keyaliasPass = keyaliasPass; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment