Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
AigioL committed Aug 3, 2021
1 parent c9ca3e2 commit 27297c4
Show file tree
Hide file tree
Showing 13 changed files with 4,316 additions and 7,075 deletions.
5 changes: 0 additions & 5 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,4 @@
<DelaySign>false</DelaySign>
<AssemblyOriginatorKeyFile>$(MSBuildProjectDirectory)\..\..\Unicorn.pfx</AssemblyOriginatorKeyFile>
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)'=='Release' ">
<DebugType>none</DebugType>
<DebugSymbols>false</DebugSymbols>
</PropertyGroup>
</Project>
1 change: 0 additions & 1 deletion SteamToolsV2+.Linux.slnf
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
"src\\Repositories.sqlite-net-pcl\\Repositories.sqlite-net-pcl.csproj",
"references\\WinAuth\\Authenticator\\Authenticator.csproj",
"references\\AvaloniaGif\\AvaloniaGif\\AvaloniaGif.csproj",
"references\\CefNet\\CefNet.Avalonia\\CefNet.Avalonia.csproj",
"references\\AvaloniaGif\\LibAPNG\\LibAPNG.csproj",
"references\\SteamAchievementManager\\SAM.API\\SAM.API.csproj",
"references\\Steam4NET\\Steam4NET\\Steam4NET.csproj",
Expand Down
1 change: 0 additions & 1 deletion SteamToolsV2+.Mac.slnf
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
"src\\Repositories.sqlite-net-pcl\\Repositories.sqlite-net-pcl.csproj",
"references\\WinAuth\\Authenticator\\Authenticator.csproj",
"references\\AvaloniaGif\\AvaloniaGif\\AvaloniaGif.csproj",
"references\\CefNet\\CefNet.Avalonia\\CefNet.Avalonia.csproj",
"references\\AvaloniaGif\\LibAPNG\\LibAPNG.csproj",
"references\\SteamAchievementManager\\SAM.API\\SAM.API.csproj",
"references\\Steam4NET\\Steam4NET\\Steam4NET.csproj",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Android.Content.PM;
using Android.Content.PM;
using Android.OS;
using Android.Runtime;
using Android.Views;
Expand Down Expand Up @@ -28,12 +28,12 @@ protected override void OnCreate(Bundle? savedInstanceState)
{
// 如果此处抛异常,绑定 xxx BottomNavigationView xx XML,解决方案:清理项目,重新生成
SetContentView(LayoutResource.Value);
var isDarkModeQ = DarkModeUtil.IsDarkModeQ;
if (isDarkModeQ)
{
// 安卓10深色模式,使用全局浅色状态栏
StatusBarUtil.SetWindowLightStatusBar(this, false);
}
//var isDarkModeQ = DarkModeUtil.IsDarkModeQ;
//if (isDarkModeQ)
//{
// // 安卓10深色模式,使用全局浅色状态栏
// StatusBarUtil.SetWindowLightStatusBar(this, false);
//}
ViewBinding();
BindingToolbar();
BindingBtnBack();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Android.OS;
using Android.OS;
using System.Application.Security;
using System.Properties;

Expand Down Expand Up @@ -26,7 +26,7 @@ public abstract class BaseSplashActivity : BaseActivity
protected override void OnCreate(Bundle? savedInstanceState)
{
base.OnCreate(savedInstanceState);
if (EnableUnsupportedDeviceDetection && !DeviceSecurityCheckUtil.IsSupported(EnableEmulator))
if (EnableUnsupportedDeviceDetection /*&& !DeviceSecurityCheckUtil.IsSupported(EnableEmulator)*/)
{
Finish();
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public virtual IList<TViewModel> ViewModels

protected virtual ItemClickEventArgs<TViewModel>? GetItemClickEventArgs(View view, TViewHolder holder, View.LongClickEventArgs? longClickEventArgs = null)
{
var position = holder.BindingAdapterPosition;
var position = holder.AdapterPosition;
if (position < 0 || position >= ViewModels.Count) return null;
var current = ViewModels[position];
return new PlatformItemClickEventArgs<TViewModel>(view, position, current, longClickEventArgs);
Expand Down
28 changes: 14 additions & 14 deletions src/Common.ClientLib.Droid/Application/UI/Fragments/IFragment.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Android.Views;
using Android.Views;
using AndroidX.Fragment.App;
using System.Application.UI.Internals;
using Fragment = AndroidX.Fragment.App.Fragment;
Expand Down Expand Up @@ -43,19 +43,19 @@ public interface IFragment : View.IOnClickListener

protected static void ChangeStatusBar(IFragment f)
{
var isLightStatusBar = f.IsLightStatusBar;
if (isLightStatusBar.HasValue)
{
var activity = f.Activity;
if (activity != null)
{
if (isLightStatusBar.Value && DarkModeUtil.IsDarkModeQ)
{
isLightStatusBar = false;
}
StatusBarUtil.SetWindowLightStatusBar(activity, isLightStatusBar.Value);
}
}
//var isLightStatusBar = f.IsLightStatusBar;
//if (isLightStatusBar.HasValue)
//{
// var activity = f.Activity;
// if (activity != null)
// {
// if (isLightStatusBar.Value && DarkModeUtil.IsDarkModeQ)
// {
// isLightStatusBar = false;
// }
// StatusBarUtil.SetWindowLightStatusBar(activity, isLightStatusBar.Value);
// }
//}
}

protected static View? OnCreateView(IFragment f, LayoutInflater inflater, ViewGroup container)
Expand Down
13 changes: 7 additions & 6 deletions src/Common.ClientLib.Droid/Common.ClientLib.Droid.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,13 @@
<PackageReference Include="Microsoft.AppCenter.Analytics" Version="4.3.0" />
<PackageReference Include="Microsoft.AppCenter.Crashes" Version="4.3.0" />
<PackageReference Include="Plugin.CurrentActivity" Version="2.1.0.4" />
<PackageReference Include="Xamarin.AndroidX.AppCompat" Version="1.3.1.1" />
<PackageReference Include="Xamarin.AndroidX.Emoji.AppCompat" Version="1.1.0.3" />
<PackageReference Include="Xamarin.AndroidX.Navigation.Fragment" Version="2.3.5.1" />
<PackageReference Include="Xamarin.AndroidX.RecyclerView" Version="1.2.1.1" />
<PackageReference Include="Xamarin.AndroidX.ViewPager2" Version="1.0.0.10" />
<PackageReference Include="Xamarin.Google.Android.Material" Version="1.4.0.1" />
<PackageReference Include="Xamarin.AndroidX.AppCompat" Version="1.2.0.7" />
<PackageReference Include="Xamarin.AndroidX.Emoji.AppCompat" Version="1.1.0.2" />
<PackageReference Include="Xamarin.AndroidX.Fragment" Version="1.3.3" />
<PackageReference Include="Xamarin.AndroidX.Navigation.Fragment" Version="2.3.5" />
<PackageReference Include="Xamarin.AndroidX.RecyclerView" Version="1.1.0.8" />
<PackageReference Include="Xamarin.AndroidX.ViewPager2" Version="1.0.0.9" />
<PackageReference Include="Xamarin.Google.Android.Material" Version="1.2.1.1" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,13 @@ public LocalDataProtectionProviderBase(
(var key, var iv) = MachineSecretKey;
// https://github.com/dotnet/runtime/issues/42214#issuecomment-698495584
// AES CFB in Windows 7 catch Internal.Cryptography.CryptoThrowHelper+WindowsCryptographicException: Unknown error (0xc10000bb)
var r = AESUtils.Create(key, iv, CipherMode.CFB, PaddingMode.PKCS7);
// AES CEF in Android catch
var mode = DI.Platform switch
{
Platform.Android => CipherMode.CBC,
_ => CipherMode.CFB,
};
var r = AESUtils.Create(key, iv, mode, PaddingMode.PKCS7);
return r;
});
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
Expand Down Expand Up @@ -36,6 +36,8 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AndroidLinkMode>None</AndroidLinkMode>
<AndroidSupportedAbis>armeabi-v7a;x86_64;arm64-v8a</AndroidSupportedAbis>
<EmbedAssembliesIntoApk>false</EmbedAssembliesIntoApk>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
Expand Down Expand Up @@ -162,4 +164,4 @@
<Target Name="AfterBuild">
</Target>
-->
</Project>
</Project>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:installLocation="auto" package="com.github.aigiol.steamtools.unittest" android:versionCode="1" android:versionName="1.0.0">
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="29" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<application android:label="Steam++(Test)" android:icon="@mipmap/ic_launcher2" android:roundIcon="@mipmap/ic_launcher_round2" android:theme="@style/Theme.AppCompat.Light.NoActionBar"></application>
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="30" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<application android:label="Steam++(Test)" android:roundIcon="@mipmap/ic_launcher_round2" android:theme="@style/Theme.AppCompat.Light.NoActionBar"></application>
</manifest>
Loading

0 comments on commit 27297c4

Please sign in to comment.