Skip to content

Commit 04530e5

Browse files
committed
1.3
+ Premium "Porofessor.gg" Some code refactoring
1 parent 5fcb41e commit 04530e5

File tree

9 files changed

+131
-16
lines changed

9 files changed

+131
-16
lines changed

OverwolfInsiderPatcher/OverwolfInsiderPatcher.csproj

+28
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,21 @@
1515
<TargetFrameworkProfile />
1616
<NuGetPackageImportStamp>
1717
</NuGetPackageImportStamp>
18+
<PublishUrl>publish\</PublishUrl>
19+
<Install>true</Install>
20+
<InstallFrom>Disk</InstallFrom>
21+
<UpdateEnabled>false</UpdateEnabled>
22+
<UpdateMode>Foreground</UpdateMode>
23+
<UpdateInterval>7</UpdateInterval>
24+
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
25+
<UpdatePeriodically>false</UpdatePeriodically>
26+
<UpdateRequired>false</UpdateRequired>
27+
<MapFileExtensions>true</MapFileExtensions>
28+
<ApplicationRevision>0</ApplicationRevision>
29+
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
30+
<IsWebBootstrapper>false</IsWebBootstrapper>
31+
<UseApplicationTrust>false</UseApplicationTrust>
32+
<BootstrapperEnabled>true</BootstrapperEnabled>
1833
</PropertyGroup>
1934
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
2035
<PlatformTarget>AnyCPU</PlatformTarget>
@@ -34,6 +49,7 @@
3449
<DefineConstants>TRACE</DefineConstants>
3550
<ErrorReport>prompt</ErrorReport>
3651
<WarningLevel>4</WarningLevel>
52+
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
3753
</PropertyGroup>
3854
<PropertyGroup>
3955
<ApplicationIcon>IconFileOverwolf_32Bit_16_32_48_256.ico</ApplicationIcon>
@@ -72,5 +88,17 @@
7288
<ItemGroup>
7389
<Content Include="IconFileOverwolf_32Bit_16_32_48_256.ico" />
7490
</ItemGroup>
91+
<ItemGroup>
92+
<BootstrapperPackage Include=".NETFramework,Version=v4.8">
93+
<Visible>False</Visible>
94+
<ProductName>Microsoft .NET Framework 4.8 %28x86 and x64%29</ProductName>
95+
<Install>true</Install>
96+
</BootstrapperPackage>
97+
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
98+
<Visible>False</Visible>
99+
<ProductName>.NET Framework 3.5 SP1</ProductName>
100+
<Install>false</Install>
101+
</BootstrapperPackage>
102+
</ItemGroup>
75103
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
76104
</Project>

OverwolfInsiderPatcher/Program.cs

+95-11
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,34 @@
11
using Microsoft.Win32;
2-
using Mono.Cecil;
3-
using Mono.Cecil.Cil;
42
using System;
53
using System.Diagnostics;
64
using System.IO;
75
using System.Linq;
86
using System.Security.Principal;
7+
using Mono.Cecil;
8+
using Mono.Cecil.Cil;
99

1010
namespace OverwolfInsiderPatcher
1111
{
1212
class Program
1313
{
14+
static string Log(string text, int length = 73)
15+
{
16+
text = "|| " + text;
17+
for (int i = 0; text.Length < length; i++)
18+
{
19+
text += " ";
20+
}
21+
text = text + " ||";
22+
Console.WriteLine(text);
23+
return text;
24+
}
25+
1426
static void Main()
1527
{
16-
Console.Title = "Overwolf patcher by Decode 1.2";
28+
Console.Title = "Overwolf patcher by Decode 1.3";
1729

1830
const string outplayedId = "cghphpbjeabdkomiphingnegihoigeggcfphdofo";
31+
const string porofessorId = "pibhbkkgefgheeglaeemkkfjlhidhcedalapdggh";
1932

2033
string overwolfPath = "";
2134
string overwolfDataPath = "";
@@ -240,22 +253,93 @@ static void Main()
240253
Console.WriteLine("|| ||");
241254
string[] outplayedVersionsPath = Directory.GetDirectories(overwolfExtensionsPath + outplayedId);
242255
string outplayedPath = outplayedVersionsPath.LastOrDefault();
243-
if(String.IsNullOrEmpty(outplayedPath) == false)
256+
if (String.IsNullOrEmpty(outplayedPath) == false)
244257
{
245258
string indexScripts = File.ReadAllText(outplayedPath + "\\indexScripts.js");
246-
indexScripts = indexScripts.Replace("null !== (e = null == t ? void 0 : t.includes(this._subscriptionPlan)) && void 0 !== e && e", "true"); // Делает "premium"
247-
indexScripts = indexScripts.Replace("className: \"app-aside\"", "className: \"app-aside1\""); // Удаляет на главной странице пустое место от рекламы
248-
File.WriteAllText(outplayedPath + "\\indexScripts.js", indexScripts);
249-
Console.WriteLine("|| -- [indexScripts.js] Patched successfully ||");
259+
if (indexScripts.Contains("null !== (e = null == t ? void 0 : t.includes(this._subscriptionPlan)) && void 0 !== e && e"))
260+
{
261+
indexScripts = indexScripts.Replace("null !== (e = null == t ? void 0 : t.includes(this._subscriptionPlan)) && void 0 !== e && e", "true"); // Делает "premium"
262+
//indexScripts = indexScripts.Replace("className: \"app-aside\"", "className: \"app-aside1\""); // Удаляет на главной странице пустое место от рекламы // Оказывается там есть переключатель и это лишнее
263+
File.WriteAllText(outplayedPath + "\\indexScripts.js", indexScripts);
264+
Console.WriteLine("|| -- [indexScripts.js] Patched successfully ||");
265+
}
266+
else
267+
{
268+
Console.WriteLine("|| -- [indexScripts.js] Patch failed or already patched ||");
269+
}
250270

251271
string backgroundScripts = File.ReadAllText(outplayedPath + "\\backgroundScripts.js");
252-
backgroundScripts = backgroundScripts.Replace("return 0 !== t.length;", "return true;"); // Делает "premium"
253-
File.WriteAllText(outplayedPath + "\\backgroundScripts.js", backgroundScripts);
254-
Console.WriteLine("|| -- [backgroundScripts.js] Patched successfully ||");
272+
if (backgroundScripts.Contains("return 0 !== t.length;"))
273+
{
274+
backgroundScripts = backgroundScripts.Replace("return 0 !== t.length;", "return true;"); // Делает "premium"
275+
File.WriteAllText(outplayedPath + "\\backgroundScripts.js", backgroundScripts);
276+
Console.WriteLine("|| -- [backgroundScripts.js] Patched successfully ||");
277+
}
278+
else
279+
{
280+
Console.WriteLine("|| -- [backgroundScripts.js] Patch failed or already patched ||");
281+
}
282+
255283
Console.WriteLine("||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||");
256284
}
257285
}
258286

287+
if (Directory.Exists(overwolfExtensionsPath + porofessorId))
288+
{
289+
Console.WriteLine();
290+
Console.WriteLine();
291+
Console.WriteLine("||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||");
292+
Console.WriteLine("|| Porofessor ||");
293+
Console.WriteLine("|| ||");
294+
string[] porofessorVersionsPath = Directory.GetDirectories(overwolfExtensionsPath + porofessorId);
295+
string porofessorPath = porofessorVersionsPath.LastOrDefault();
296+
if (String.IsNullOrEmpty(porofessorPath) == false)
297+
{
298+
string[] windows = Directory.GetFiles(porofessorPath + "\\windows\\");
299+
foreach (string window in windows)
300+
{
301+
string file = File.ReadAllText(window);
302+
const string adContainer = "<div id=\"ad-container\"><div id=\"ad-div\" class=\"ad\"></div></div>";
303+
if (file.Contains("<div id=\"ad-container\">"))
304+
{
305+
file = file.Replace(adContainer, "<!-- Ad Patched -->");
306+
307+
if (!file.Contains("<!-- Ad Patched -->"))
308+
{
309+
string adBegin = "<div id=\"ad-container\">";
310+
string adEnd = " </div>";
311+
312+
int adBeginIndex = file.IndexOf(adBegin);
313+
if (adBeginIndex > 0)
314+
{
315+
int adEndIndex = file.Substring(adBeginIndex).IndexOf(adEnd);
316+
317+
string firstPart = file.Substring(0, adBeginIndex);
318+
string secondPart = file.Substring(adBeginIndex + adEndIndex + adEnd.Length);
319+
file = firstPart + secondPart;
320+
}
321+
322+
}
323+
324+
File.WriteAllText(window, file);
325+
Log("-- [" + Path.GetFileName(window) + "] Patched successfuly");
326+
}
327+
else
328+
{
329+
if (file.Contains("<!-- Ad Patched -->"))
330+
{
331+
Log("-- [" + Path.GetFileName(window) + "] Already patched");
332+
}
333+
else
334+
{
335+
Log("-- [" + Path.GetFileName(window) + "] Not patched");
336+
}
337+
}
338+
}
339+
}
340+
Console.WriteLine("||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||");
341+
}
342+
259343

260344

261345

OverwolfInsiderPatcher/Properties/AssemblyInfo.cs

+7-5
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
1-
using System.Reflection;
1+
using System.Resources;
2+
using System.Reflection;
23
using System.Runtime.InteropServices;
34

45
// General Information about an assembly is controlled through the following
56
// set of attributes. Change these attribute values to modify the information
67
// associated with an assembly.
7-
[assembly: AssemblyTitle("OverwolfInsiderPatcher")]
8+
[assembly: AssemblyTitle("Overwolf patcher by Decode")]
89
[assembly: AssemblyDescription("")]
910
[assembly: AssemblyConfiguration("")]
1011
[assembly: AssemblyCompany("")]
11-
[assembly: AssemblyProduct("OverwolfInsiderPatcher")]
12+
[assembly: AssemblyProduct("Overwolf patcher")]
1213
[assembly: AssemblyCopyright("Copyright © 2021")]
1314
[assembly: AssemblyTrademark("")]
1415
[assembly: AssemblyCulture("")]
@@ -31,5 +32,6 @@
3132
// You can specify all the values or you can default the Build and Revision Numbers
3233
// by using the '*' as shown below:
3334
// [assembly: AssemblyVersion("1.0.*")]
34-
[assembly: AssemblyVersion("1.0.0.0")]
35-
[assembly: AssemblyFileVersion("1.0.0.0")]
35+
[assembly: AssemblyVersion("1.2.0.0")]
36+
[assembly: AssemblyFileVersion("1.2.0.0")]
37+
[assembly: NeutralResourcesLanguage("en")]

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
Patch Overwolf app to work on Windows Insider version and unlock new features
44

5+
Premium "Porofessor.gg"
56
Premium "Outplayed" (Need Overwolf account logged)
67
DevTools in any window (Overwolf windows and apps)
78

packages/ILMerge.3.0.29.deleteme

Whitespace-only changes.
-66.9 KB
Binary file not shown.
Binary file not shown.

packages/MSBuild.ILMerge.Task.1.1.3.deleteme

Whitespace-only changes.
Binary file not shown.

0 commit comments

Comments
 (0)