allow using Dropbox secrets from environment (better suited for Github action builds)
This commit is contained in:
5
.github/workflows/release.yml
vendored
5
.github/workflows/release.yml
vendored
@@ -88,6 +88,11 @@ jobs:
|
|||||||
KeyStore: "${{ github.workspace }}/kp2a.keystore"
|
KeyStore: "${{ github.workspace }}/kp2a.keystore"
|
||||||
MyAndroidSigningStorePass: ${{ secrets.KEY_STORE_PASSWORD }}
|
MyAndroidSigningStorePass: ${{ secrets.KEY_STORE_PASSWORD }}
|
||||||
MyAndroidSigningKeyPass: ${{ secrets.KEY_PASSWORD }}
|
MyAndroidSigningKeyPass: ${{ secrets.KEY_PASSWORD }}
|
||||||
|
DropboxAppKey: ${{ secrets.DROPBOX_APP_KEY }}
|
||||||
|
DropboxAppSecret: ${{ secrets.DROPBOX_APP_SECRET }}
|
||||||
|
DropboxAppFolderAppKey: ${{ secrets.DROPBOX_APP_FOLDER_APP_KEY }}
|
||||||
|
DropboxAppFolderAppSecret: ${{ secrets.DROPBOX_APP_FOLDER_APP_SECRET }}
|
||||||
|
|
||||||
run: |
|
run: |
|
||||||
make Configuration=Release Flavor=Net
|
make Configuration=Release Flavor=Net
|
||||||
|
|
||||||
|
|||||||
2
.gitignore
vendored
2
.gitignore
vendored
@@ -64,7 +64,7 @@ Thumbs.db
|
|||||||
/src/java/android-filechooser/code/projectzip/project.zip
|
/src/java/android-filechooser/code/projectzip/project.zip
|
||||||
/src/java/android-filechooser/code/unused.txt
|
/src/java/android-filechooser/code/unused.txt
|
||||||
|
|
||||||
/src/Kp2aBusinessLogic/Io/DropboxFileStorageKeys.cs
|
/src/Kp2aBusinessLogic/Io/DropboxFileStorage.g.cs
|
||||||
|
|
||||||
/src/java/workspace/DriveTest
|
/src/java/workspace/DriveTest
|
||||||
|
|
||||||
|
|||||||
8
Makefile
8
Makefile
@@ -312,14 +312,8 @@ manifestlink:
|
|||||||
$(CREATE_MANIFEST_LINK)
|
$(CREATE_MANIFEST_LINK)
|
||||||
|
|
||||||
#####
|
#####
|
||||||
src/Kp2aBusinessLogic/Io/DropboxFileStorageKeys.cs:
|
|
||||||
ifeq ($(detected_OS),Windows)
|
|
||||||
$(CP) src\Kp2aBusinessLogic\Io\DropboxFileStorageKeysDummy.cs src\Kp2aBusinessLogic\Io\DropboxFileStorageKeys.cs
|
|
||||||
else
|
|
||||||
$(CP) src/Kp2aBusinessLogic/Io/DropboxFileStorageKeysDummy.cs $@
|
|
||||||
endif
|
|
||||||
|
|
||||||
msbuild: manifestlink native java nuget src/Kp2aBusinessLogic/Io/DropboxFileStorageKeys.cs
|
msbuild: manifestlink native java nuget
|
||||||
$(MSBUILD) src/KeePass.sln -target:keepass2android-app -p:AndroidSdkDirectory="$(ANDROID_SDK_ROOT)" -p:BuildProjectReferences=true $(MSBUILD_PARAM) -p:Platform="Any CPU" -m
|
$(MSBUILD) src/KeePass.sln -target:keepass2android-app -p:AndroidSdkDirectory="$(ANDROID_SDK_ROOT)" -p:BuildProjectReferences=true $(MSBUILD_PARAM) -p:Platform="Any CPU" -m
|
||||||
|
|
||||||
apk: msbuild
|
apk: msbuild
|
||||||
|
|||||||
@@ -1,13 +0,0 @@
|
|||||||
namespace keepass2android.Io
|
|
||||||
{
|
|
||||||
public partial class DropboxFileStorage
|
|
||||||
{
|
|
||||||
private const string AppKey = "dummy";
|
|
||||||
private const string AppSecret = "dummy";
|
|
||||||
}
|
|
||||||
public partial class DropboxAppFolderFileStorage
|
|
||||||
{
|
|
||||||
private const string AppKey = "dummy";
|
|
||||||
private const string AppSecret = "dummy";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
27
src/Kp2aBusinessLogic/Io/GenerateSecrets.targets
Normal file
27
src/Kp2aBusinessLogic/Io/GenerateSecrets.targets
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
<Project>
|
||||||
|
<Target Name="GenerateDropboxSecrets" BeforeTargets="BeforeCompile"
|
||||||
|
Inputs="@(DropboxSecretLines)"
|
||||||
|
Outputs="DropboxFileStorage.g.cs">
|
||||||
|
|
||||||
|
<WriteLinesToFile
|
||||||
|
File="Io/DropboxFileStorage.g.cs"
|
||||||
|
Lines="@(DropboxSecretLines->'%(Text)')"
|
||||||
|
Overwrite="true"
|
||||||
|
/>
|
||||||
|
</Target>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<DropboxSecretLines Include="GeneratedDropboxSecrets">
|
||||||
|
<Text>namespace keepass2android.Io {
|
||||||
|
public partial class DropboxFileStorage {
|
||||||
|
private const string AppKey = "$(DropboxAppKey)";
|
||||||
|
private const string AppSecret = "$(DropboxAppSecret)";
|
||||||
|
}
|
||||||
|
public partial class DropboxAppFolderFileStorage {
|
||||||
|
private const string AppKey = "$(DropboxAppFolderAppKey)";
|
||||||
|
private const string AppSecret = "$(DropboxAppFolderAppSecret)";
|
||||||
|
}
|
||||||
|
}</Text>
|
||||||
|
</DropboxSecretLines>
|
||||||
|
</ItemGroup>
|
||||||
|
</Project>
|
||||||
@@ -26,9 +26,7 @@
|
|||||||
<ProjectReference Include="..\TwofishCipher\TwofishCipher.csproj" />
|
<ProjectReference Include="..\TwofishCipher\TwofishCipher.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Remove="Io/DropboxFileStorageKeysDummy.cs" />
|
|
||||||
<Compile Remove="Io/DropboxFileStorageKeysDummy.cs" />
|
|
||||||
<Content Remove="Io/DropboxFileStorageKeysDummy.cs" />
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup Condition="'$(Flavor)'=='NoNet'">
|
<ItemGroup Condition="'$(Flavor)'=='NoNet'">
|
||||||
<None Remove="Io/OneDrive2FileStorage.cs" />
|
<None Remove="Io/OneDrive2FileStorage.cs" />
|
||||||
@@ -38,5 +36,11 @@
|
|||||||
<Compile Remove="Io/MegaFileStorage.cs" />
|
<Compile Remove="Io/MegaFileStorage.cs" />
|
||||||
<Content Remove="Io/MegaFileStorage.cs" />
|
<Content Remove="Io/MegaFileStorage.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
<Import Project="Io/GenerateSecrets.targets" />
|
||||||
|
<ItemGroup>
|
||||||
|
<Compile Include="Io/DropboxFileStorage.g.cs" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
@@ -20,7 +20,6 @@ git clone --recurse-submodules https://github.com/PhilippC/keepass2android.git
|
|||||||
cd keepass2android/src/build-scripts
|
cd keepass2android/src/build-scripts
|
||||||
./build-java.sh && ./build-native.sh
|
./build-java.sh && ./build-native.sh
|
||||||
cd ..
|
cd ..
|
||||||
cp Kp2aBusinessLogic/Io/DropboxFileStorageKeysDummy.cs Kp2aBusinessLogic/Io/DropboxFileStorageKeys.cs
|
|
||||||
cd keepass2android-app
|
cd keepass2android-app
|
||||||
ln -s Manifests/AndroidManifest_debug.xml AndroidManifest.xml
|
ln -s Manifests/AndroidManifest_debug.xml AndroidManifest.xml
|
||||||
dotnet workload restore
|
dotnet workload restore
|
||||||
|
|||||||
Reference in New Issue
Block a user