Click here to Skip to main content
15,896,063 members
Please Sign up or sign in to vote.
1.57/5 (4 votes)
See more:
I saved some important email correspondence in a folder on my desktop, and when I tried to retrieve it, it is all in code. (.JS) I have NO idea how to convert this to my original text to English, or if it is even possible. I am technically illiterate, so I need some basic help.
Thank you!
Susan

C#
/* JS */ gapi.loaded_3(function(_){var window=this;
var Bk;_.zk=function(a){if(!_.Tc(a))return null;for(var b={},c=0;c<a.length;c++)b[a[c]]=a[c];return b};_.Ak=function(a,b){var c=a.length;if(c!=b.length)return!1;for(var d=0;d<c;++d){var e=a.charCodeAt(d),f=b.charCodeAt(d);65<=e&&90>=e&&(e+=32);65<=f&&90>=f&&(f+=32);if(e!=f)return!1}return!0};Bk=null;
_.Ck=function(a){if(null===Bk){var b=_.F("client/headers/response");b||(b=_.F("googleapis/headers/response"));Bk=_.zk(b)}if(null!=Bk){if(Bk.hasOwnProperty(a))return!0;for(var c in Bk)if(Bk.hasOwnProperty(c)&&_.Ak(c,a))return!0}return!1};
_.Dk=function(a){a=String(a||"").split("\x00").join("");for(var b=[],c=!0,d=0,e=a.length;d<e;++d){var f=a.charAt(d),g=a.charCodeAt(d);if(55296<=g&&56319>=g&&d+1<e){var k=a.charAt(d+1),l=a.charCodeAt(d+1);56320<=l&&57343>=l&&(f+=k,g=65536+(g-55296<<10)+(l-56320),++d)}if(!(0<=g&&1114109>=g)||55296<=g&&57343>=g||64976<=g&&65007>=g||65534==(g&65534))g=65533,f=String.fromCharCode(g);k=!(32<=g&&126>=g)||" "==f||c&&":"==f||"\\"==f;!c||"/"!=f&&"?"!=f||(c=!1);"%"==f&&(d+2>=e?k=!0:(l=16*(0,window.parseInt)(a.charAt(d+
1),16)+(0,window.parseInt)(a.charAt(d+2),16),0<=l&&255>=l?(g=l,f=0==g?"":"%"+(256+l).toString(16).toUpperCase().substr(1),d+=2):k=!0));k&&(f=(0,window.encodeURIComponent)(f),1>=f.length&&(0<=g&&127>=g?f="%"+(256+g).toString(16).toUpperCase().substr(1):(g=65533,f=(0,window.encodeURIComponent)(String.fromCharCode(g)))));b.push(f)}a=b.join("");a=a.split("#")[0];a=a.split("?");b=a[0].split("/");c=[];d=0;for(e=b.length;d<e;++d)f=b[d],g=f.split("%2E").join("."),g=g.split((0,window.encodeURIComponent)("\uff0e")).join("."),


What I have tried:

I've googled "JavaScript conversion", but the I did not understand any of the reponses.
Posted
Updated 28-Mar-16 10:02am
v2
Comments
Patrice T 28-Mar-16 13:41pm    
I fear you have to get someone in front of your screen to get some help.
because mails are not in JS.
ZurdoDev 28-Mar-16 13:42pm    
I agree with previous comment. Either get tech support to look at it or click improve question and post some of the code here.
CHill60 28-Mar-16 13:49pm    
Depending on how you saved it then you are probably trying to view it in Notepad instead of it's native form. How did you save the email?
Member 12421372 28-Mar-16 14:02pm    
file:///Users/administrator/Desktop/Debbie/for%20kelli%20plotz_files/cbgapi.js

does this make sense? I don't remember how I saved it. Maybe 'text edit?'
dragged it from desk top to a folder. I am such a novice!
CHill60 28-Mar-16 14:09pm    
It doesn't make much sense if you thought you were saving an email. Are you sure you are looking at the correct file? You would have had to save or export it from your email agent or at the very least copy&paste the text into a file of some description

What you have shown is obfuscated javascript, and by definition you will have lost human readable/understandable information in the process.

You can not get back the original since that information is lost, the resulting javascript if functionally equivalent to the original with all the names/variables replaced.
 
Share this answer
 
I understand what you want to get, you want the human-readable JavaScript code, which can be modified and updated as per requirements. But the thing (as Mehdi has mentioned above in his answer; Solution 1) is that you cannot convert it back. This has been compressed and most of the "human-readable" content has been removed, because JavaScript interpreter doesn't care about that stuff.

The only stuff JavaScript interpreter cares about is the command of the program. Now, just for the sake of demonstration, the process can be specified like this, the "human-readable" JavaScript would be like:
JavaScript
var name = 'Afzaal Ahmad Zeeshan';

function sayHello() {
    alert('Hello, ' + name + '!');
}

This would be compressed to the following one:
function sayHello(){alert("Hello, "+name+"!")}var name="Afzaal Ahmad Zeeshan";

As Mehdi said, their functionality is similar, but the difference is that the later one would require less kBs to be sent over the network. What I think of this is, that this is similar to the differentiation process in the Calculus. You can differentiate a function, but when you have to bring it back to its original form, you get a constant field; which may be zero, may be any other integer value. Similarly, this code once has been minified, won't be converted back to its original form; the one in which it was written.

Minification (programming) - Wikipedia, the free encyclopedia[^]
 
Share this answer
 
The code can cleaned partially with Online JavaScript beautifier[^]
The result is
JavaScript
/* JS */
gapi.loaded_3(function(_) {
            var window = this;
            var Bk;
            _.zk = function(a) {
                if (!_.Tc(a)) return null;
                for (var b = {}, c = 0; c < a.length; c++) b[a[c]] = a[c];
                return b
            };
            _.Ak = function(a, b) {
                var c = a.length;
                if (c != b.length) return !1;
                for (var d = 0; d < c; ++d) {
                    var e = a.charCodeAt(d),
                        f = b.charCodeAt(d);
                    65 <= e && 90 >= e && (e += 32);
                    65 <= f && 90 >= f && (f += 32);
                    if (e != f) return !1
                }
                return !0
            };
            Bk = null;
            _.Ck = function(a) {
                if (null === Bk) {
                    var b = _.F("client/headers/response");
                    b || (b = _.F("googleapis/headers/response"));
                    Bk = _.zk(b)
                }
                if (null != Bk) {
                    if (Bk.hasOwnProperty(a)) return !0;
                    for (var c in Bk)
                        if (Bk.hasOwnProperty(c) && _.Ak(c, a)) return !0
                }
                return !1
            };
            _.Dk = function(a) {
                    a = String(a || "").split("\x00").join("");
                    for (var b = [], c = !0, d = 0, e = a.length; d < e; ++d) {
                        var f = a.charAt(d),
                            g = a.charCodeAt(d);
                        if (55296 <= g && 56319 >= g && d + 1 < e) {
                            var k = a.charAt(d + 1),
                                l = a.charCodeAt(d + 1);
                            56320 <= l && 57343 >= l && (f += k, g = 65536 + (g - 55296 << 10) + (l - 56320), ++d)
                        }
                        if (!(0 <= g && 1114109 >= g) || 55296 <= g && 57343 >= g || 64976 <= g && 65007 >= g || 65534 == (g & 65534)) g = 65533, f = String.fromCharCode(g);
                        k = !(32 <= g && 126 >= g) || " " == f || c && ":" == f || "\\" == f;
                        !c || "/" != f && "?" != f || (c = !1);
                        "%" == f && (d + 2 >= e ? k = !0 : (l = 16 * (0, window.parseInt)(a.charAt(d +
                            1), 16) + (0, window.parseInt)(a.charAt(d + 2), 16), 0 <= l && 255 >= l ? (g = l, f = 0 == g ? "" : "%" + (256 + l).toString(16).toUpperCase().substr(1), d += 2) : k = !0));
                        k && (f = (0, window.encodeURIComponent)(f), 1 >= f.length && (0 <= g && 127 >= g ? f = "%" + (256 + g).toString(16).toUpperCase().substr(1) : (g = 65533, f = (0, window.encodeURIComponent)(String.fromCharCode(g)))));
                        b.push(f)
                    }
                    a = b.join("");
                    a = a.split("#")[0];
                    a = a.split("?");
                    b = a[0].split("/");
                    c = [];
                    d = 0;
                    for (e = b.length; d < e; ++d) f = b[d], g = f.split("%2E").join("."), g = g.split((0, window.encodeURIComponent)("\uff0e")).join("."),

But this look like a program with no data, no message.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900