From 0a6228ff0b2022f7dfab6f6786c629afa5bc866f Mon Sep 17 00:00:00 2001 From: Kurt Date: Tue, 22 Nov 2016 17:04:10 -0800 Subject: [PATCH] Fix past gen qr imports --- PKHeX/Misc/QR.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PKHeX/Misc/QR.cs b/PKHeX/Misc/QR.cs index 9f3ab8038..188c8bdae 100644 --- a/PKHeX/Misc/QR.cs +++ b/PKHeX/Misc/QR.cs @@ -96,7 +96,7 @@ internal static byte[] getQRData() if (data.Contains("could not find")) { Util.Alert("Reader could not find QR data in the image."); return null; } if (data.Contains("filetype not supported")) { Util.Alert("Input URL is not valid. Double check that it is an image (jpg/png).", address); return null; } // Quickly convert the json response to a data string - const string cap = ",\"error\":null}]}]"; + const string cap = "\",\"error\":null}]}]"; const string intro = "[{\"type\":\"qrcode\",\"symbol\":[{\"seq\":0,\"data\":\""; if (!data.StartsWith(intro)) throw new Exception(); @@ -115,7 +115,7 @@ internal static byte[] getQRData() return raw.ToList().Where((c, i) => i % 2 == 0).Skip(0x30).Take(0xE8).ToArray(); } // All except G7 - pkstr = data.Substring(data.IndexOf("#", StringComparison.Ordinal) + 1); // Trim URL + pkstr = pkstr.Substring(pkstr.IndexOf("#", StringComparison.Ordinal) + 1); // Trim URL pkstr = pkstr.Replace("\\", ""); // Rectify response return Convert.FromBase64String(pkstr);