forked from zsh2401/AutumnBox
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Former-commit-id: cb350b3b41920b9151927df4b710fe4bbedb893e
- Loading branch information
Showing
368 changed files
with
23,203 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
*.htm linguist-language=C# | ||
*html linguist-language=C# |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# [email protected] # | ||
# 2017/12/16 # | ||
# giti file # | ||
|
||
##files | ||
*.log | ||
*.exe | ||
*.exe.config | ||
*.exe.config | ||
*.exp | ||
*.ipch | ||
*.metagen | ||
*.ncb | ||
*.nupkg | ||
*.obj | ||
*.opensdf | ||
*.pdb | ||
*.ReSharper | ||
*.sdf | ||
*.suo | ||
*.swp | ||
*.user | ||
*.xml | ||
*.lastcodeanalysissucceeded | ||
*.zip | ||
*.rar | ||
*.lnk | ||
*.bak | ||
*.suo | ||
*.dll | ||
*.psd | ||
*.txt | ||
fast | ||
gfast.exe | ||
makezip | ||
##dirs | ||
.vs/ | ||
out/ | ||
sdk/ | ||
obj/ | ||
maker/ | ||
HistoryRelease/ | ||
DemoPic/ | ||
packages/ | ||
##donot | ||
!AutumnBox.Basic/google/platform-tools/*.* |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* =============================================================================*\ | ||
* | ||
* Filename: AirForzenActivator | ||
* Description: | ||
* | ||
* Version: 1.0 | ||
* Created: 2017/11/25 23:06:48 (UTC+8:00) | ||
* Compiler: Visual Studio 2017 | ||
* | ||
* Author: zsh2401 | ||
* Company: I am free man | ||
* | ||
\* =============================================================================*/ | ||
|
||
namespace AutumnBox.Basic.Flows | ||
{ | ||
public sealed class AirForzenActivator : DeviceOwnerSetter | ||
{ | ||
public static readonly string AppPackageName = "me.yourbay.airfrozen"; | ||
|
||
protected override string PackageName => AppPackageName; | ||
|
||
protected override string ClassName => ".main.core.mgmt.MDeviceAdminReceiver"; | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
/* =============================================================================*\ | ||
* | ||
* Filename: ApkInstaller | ||
* Description: | ||
* | ||
* Version: 1.0 | ||
* Created: 2017/12/1 0:07:42 (UTC+8:00) | ||
* Compiler: Visual Studio 2017 | ||
* | ||
* Author: zsh2401 | ||
* Company: I am free man | ||
* | ||
\* =============================================================================*/ | ||
using AutumnBox.Basic.FlowFramework; | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using AutumnBox.Basic.Executer; | ||
using AutumnBox.Basic.Util; | ||
using AutumnBox.Support.Log; | ||
|
||
namespace AutumnBox.Basic.Flows | ||
{ | ||
public sealed class ApkInstallerArgs : FlowArgs | ||
{ | ||
public List<FileInfo> Files { get; set; } | ||
} | ||
public sealed class AApkInstalltionCompleteArgs | ||
{ | ||
public FileInfo ApkFileInfo { get; internal set; } | ||
public bool IsSuccess { get; internal set; } = true; | ||
public Output Output { get; internal set; } | ||
} | ||
public sealed class ApkInstallerResult : FlowResult | ||
{ | ||
public int InstallFailedCount { get; internal set; } | ||
} | ||
public delegate bool AApkInstallltionComplete(object sender, AApkInstalltionCompleteArgs e); | ||
public sealed class ApkInstaller : FunctionFlow<ApkInstallerArgs, ApkInstallerResult> | ||
{ | ||
#pragma warning disable CA1009 | ||
public event AApkInstallltionComplete AApkIstanlltionCompleted; | ||
#pragma warning disable CA1009 | ||
private int errorCount = 0; | ||
protected override Output MainMethod(ToolKit<ApkInstallerArgs> toolKit) | ||
{ | ||
Logger.Info(this,$"Install starts....have {toolKit.Args.Files.Count} Apks"); | ||
OutputBuilder result = new OutputBuilder(); | ||
result.Register(toolKit.Executer); | ||
foreach (FileInfo apkFileInfo in toolKit.Args.Files) | ||
{ | ||
Command command = | ||
Command.MakeForCmd( | ||
$"{AdbConstants.FullAdbFileName} {toolKit.Args.Serial.ToFullSerial()} install -r \"{apkFileInfo.FullName}\""); | ||
|
||
var installResult = toolKit.Executer.Execute(command); | ||
bool currentSuccessful = !installResult.Contains("failure"); | ||
if (!currentSuccessful) | ||
{ | ||
errorCount++; | ||
} | ||
var args = new AApkInstalltionCompleteArgs() | ||
{ | ||
ApkFileInfo = apkFileInfo, | ||
IsSuccess = currentSuccessful, | ||
Output = installResult, | ||
}; | ||
if (AApkIstanlltionCompleted?.Invoke(this, args) != true) | ||
{ | ||
break; | ||
} | ||
} | ||
return result.ToOutput() ; | ||
} | ||
protected override void AnalyzeResult(ApkInstallerResult result) | ||
{ | ||
base.AnalyzeResult(result); | ||
result.InstallFailedCount = errorCount; | ||
if (errorCount > 0) { result.ResultType = ResultType.MaybeUnsuccessful; } | ||
} | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> | ||
<PropertyGroup> | ||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | ||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> | ||
<ProjectGuid>{3091ECAE-7FF2-421D-B970-1C76D7CAB0C0}</ProjectGuid> | ||
<OutputType>Library</OutputType> | ||
<AppDesignerFolder>Properties</AppDesignerFolder> | ||
<RootNamespace>AutumnBox.Basic.Flows</RootNamespace> | ||
<AssemblyName>AutumnBox.Basic.Flows</AssemblyName> | ||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion> | ||
<FileAlignment>512</FileAlignment> | ||
<TargetFrameworkProfile /> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> | ||
<DebugSymbols>true</DebugSymbols> | ||
<DebugType>full</DebugType> | ||
<Optimize>false</Optimize> | ||
<OutputPath>bin\Debug\</OutputPath> | ||
<DefineConstants>DEBUG;TRACE</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
<DocumentationFile>bin\Debug\AutumnBox.Basic.Flows.xml</DocumentationFile> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> | ||
<DebugType>pdbonly</DebugType> | ||
<Optimize>true</Optimize> | ||
<OutputPath>bin\Release\</OutputPath> | ||
<DefineConstants>TRACE</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
<DocumentationFile>bin\Release\AutumnBox.Basic.Flows.xml</DocumentationFile> | ||
</PropertyGroup> | ||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'SDK|AnyCPU'"> | ||
<OutputPath>..\sdk\</OutputPath> | ||
<DefineConstants>TRACE</DefineConstants> | ||
<DocumentationFile>bin\Release\AutumnBox.Basic.Flows.xml</DocumentationFile> | ||
<Optimize>true</Optimize> | ||
<DebugType>pdbonly</DebugType> | ||
<PlatformTarget>AnyCPU</PlatformTarget> | ||
<ErrorReport>prompt</ErrorReport> | ||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Reference Include="PresentationCore" /> | ||
<Reference Include="PresentationFramework" /> | ||
<Reference Include="System" /> | ||
<Reference Include="System.Core" /> | ||
<Reference Include="System.Xaml" /> | ||
<Reference Include="System.Xml.Linq" /> | ||
<Reference Include="System.Data.DataSetExtensions" /> | ||
<Reference Include="Microsoft.CSharp" /> | ||
<Reference Include="System.Data" /> | ||
<Reference Include="System.Net.Http" /> | ||
<Reference Include="System.Xml" /> | ||
<Reference Include="WindowsBase" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Compile Include="AirForzenActivator.cs" /> | ||
<Compile Include="ApkInstaller.cs" /> | ||
<Compile Include="BreventServiceActivator.cs" /> | ||
<Compile Include="DcimBackuper.cs" /> | ||
<Compile Include="DeviceImageExtractor.cs" /> | ||
<Compile Include="DeviceImageFlasher.cs" /> | ||
<Compile Include="DeviceOwnerSetter.cs" /> | ||
<Compile Include="DeviceUserDeleter.cs" /> | ||
<Compile Include="DpiChanger.cs" /> | ||
<Compile Include="FilePuller.cs" /> | ||
<Compile Include="FilePusher.cs" /> | ||
<Compile Include="GeekMemoryCleanerActivator.cs" /> | ||
<Compile Include="IceBoxActivator.cs" /> | ||
<Compile Include="IslandActivator.cs" /> | ||
<Compile Include="MiFlash\BatInfo.cs" /> | ||
<Compile Include="MiFlash\LineFlashPackageInfo.cs" /> | ||
<Compile Include="MiFlash\LineFlashPackageParser.cs" /> | ||
<Compile Include="MiFlash\MiFlasher.cs" /> | ||
<Compile Include="NetDebuggingCloser.cs" /> | ||
<Compile Include="NetDebuggingOpener.cs" /> | ||
<Compile Include="NetDeviceConnecter.cs" /> | ||
<Compile Include="NetDeviceDisconnecter.cs" /> | ||
<Compile Include="OemRelocker.cs" /> | ||
<Compile Include="RecoveryFlasher.cs" /> | ||
<Compile Include="Result\AdvanceResult.cs" /> | ||
<Compile Include="Properties\AssemblyInfo.cs" /> | ||
<Compile Include="Result\DeviceOwnerSetterResult.cs" /> | ||
<Compile Include="ScreenLockDeleter.cs" /> | ||
<Compile Include="ScreenShoter.cs" /> | ||
<Compile Include="ShizukuManagerActivator.cs" /> | ||
<Compile Include="ShScriptExecuter.cs" /> | ||
<Compile Include="States\DeviceOwnerSetterErrType.cs" /> | ||
<Compile Include="StopAppActivator.cs" /> | ||
<Compile Include="SystemPartitionUnlocker.cs" /> | ||
<Compile Include="VirtualButtonHider.cs" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ProjectReference Include="..\AutumnBox.Basic\AutumnBox.Basic.csproj"> | ||
<Project>{84044fb2-bd38-4283-8065-b639270ece0f}</Project> | ||
<Name>AutumnBox.Basic</Name> | ||
</ProjectReference> | ||
<ProjectReference Include="..\AutumnBox.Support\AutumnBox.Support.csproj"> | ||
<Project>{851B2EB0-0503-428D-BD87-063555B19451}</Project> | ||
<Name>AutumnBox.Support</Name> | ||
</ProjectReference> | ||
</ItemGroup> | ||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> | ||
<PropertyGroup> | ||
<PostBuildEvent>if $(ConfigurationName) == SDK ( | ||
del /S *.pdb | ||
)</PostBuildEvent> | ||
</PropertyGroup> | ||
</Project> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* =============================================================================*\ | ||
* | ||
* Filename: BreventServiceActivator | ||
* Description: | ||
* | ||
* Version: 1.0 | ||
* Created: 2017/11/24 21:15:11 (UTC+8:00) | ||
* Compiler: Visual Studio 2017 | ||
* | ||
* Author: zsh2401 | ||
* Company: I am free man | ||
* | ||
\* =============================================================================*/ | ||
|
||
namespace AutumnBox.Basic.Flows | ||
{ | ||
public class BreventServiceActivator : ShScriptExecuter | ||
{ | ||
public static readonly string _AppPackageName = "me.piebridge.brevent"; | ||
protected override string ScriptPath => "/data/data/me.piebridge.brevent/brevent.sh"; | ||
protected override string AppActivity => ".ui.BreventActivity"; | ||
protected override string AppPackageName => _AppPackageName; | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/************************************************* | ||
** auth: [email protected] | ||
** date: 2018/1/17 18:51:58 (UTC +8:00) | ||
** desc: ... | ||
*************************************************/ | ||
using AutumnBox.Basic.Executer; | ||
using AutumnBox.Basic.FlowFramework; | ||
using AutumnBox.Support.CstmDebug; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace AutumnBox.Basic.Flows | ||
{ | ||
public class DcimBackuperArgs : FlowArgs | ||
{ | ||
public string TargetPath { get; set; } | ||
} | ||
public class DcimBackuper : FunctionFlow<DcimBackuperArgs> | ||
{ | ||
private AdvanceOutput exeResult; | ||
protected override CheckResult Check(DcimBackuperArgs args) | ||
{ | ||
var result = | ||
(args.DevBasicInfo.State == Device.DeviceState.Poweron || | ||
args.DevBasicInfo.State == Device.DeviceState.Recovery) ? CheckResult.OK : CheckResult.DeviceStateError; | ||
return result; | ||
} | ||
protected override Output MainMethod(ToolKit<DcimBackuperArgs> toolKit) | ||
{ | ||
if (toolKit.Args.DevBasicInfo.State == Device.DeviceState.Poweron) | ||
{ | ||
exeResult = toolKit.Ae($"pull /sdcard/DCIM/. \"{toolKit.Args.TargetPath}\""); | ||
} | ||
else | ||
{ | ||
exeResult = toolKit.Ae($"pull /data/media/0/DCIM/. \"{toolKit.Args.TargetPath}\""); | ||
} | ||
return exeResult; | ||
} | ||
protected override void AnalyzeResult(FlowResult result) | ||
{ | ||
base.AnalyzeResult(result); | ||
result.ResultType = exeResult.IsSuccessful ? ResultType.Successful : ResultType.Unsuccessful; | ||
} | ||
} | ||
} |
Oops, something went wrong.