question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] Split Strings Broke Code

See original GitHub issue

Info

I use webpack and webpack plugin for obfuscate. Maybe this obfuscator broke webpack code… but I didn’t sure on 100%…

Actualy, need more test. Maybe this trouble is not new and this is a duplicate…

Description

Today, I was write some code. I found what my code, after obfuscation, didn’t work. I would think what this is trouble in properties rename (how I found in readme) I will try change settings, disable all, enable and and etc.

After all tests, I found something…

If I setup ONLY property renamer - all is work fine. If I setup ONLY split strings - all is … fine? But, if I setup settings:

      renameGlobals: true,
      renameProperties: true,
      splitStrings: true,
      splitStringsChunkLength: 1, // Actualy, I test 1 and 3 values. This both call error. If this value 5 or greater all is good

I get error (check stack trace) and my code is BROKEN now.

Expected Behavior

Not broke code with too many symbols in splitStringsChunkLength

Current Behavior

If splitStringsChunkLength < 5 (tested only on 3 and 1 values) I get broken code after obfuscation.

PS: Actually I didn’t know what code really broke after that… maybe webpack, maybe code what I was write…

Steps to Reproduce

I was setup settings in tosplitStrings: true,

  1. Setup settings (look in description block)
  2. Obfuscate code
  3. Try start code
  4. Maybe you get the same error like me

I think this trouble verry … hard repeatfull. I think without code (what I can’t share currently) this trouble can be hard to repeat.

Stack trace

VM2399:formatted:287 Uncaught TypeError: _0x1368a0[("b" + "q" + "C" + "a" + "s")] is not a function
    at <anonymous>:1:10081
    at <anonymous>:1:12128
    at <anonymous>:1:46619

Minimal working example that will help to reproduce issue

I can’t share with code from current project (maybe later … if I would can do that) Now, I can give only this line with error:

        if (_0x1368a0['b' + 'q' + 'C' + 'a' + 's'](_0x1368a0['P' + 'I' + 'n' + 'z' + 'c'], _0x1368a0['P' + 'I' + 'n' + 'z' + 'c'])) {

PS: Sorry if I give too low info about all. Call and ask me if you want more info.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:37 (37 by maintainers)

github_iconTop GitHub Comments

2reactions
sanex3339commented, Sep 2, 2020

This was introduced in 1.12.0 and will be fixed in 2.0.0 soon. Right now you can use javascript-obfuscator and webpack-obfuscator@1.11.0. Thank you for your help!

PS: this bug is a result of the invalid test that didn’t fail when I changed the order of the transformers.

1reaction
sanex3339commented, Sep 3, 2020

I’ve just released both javascript-obfuscator@1.12.1 and webpack-obfuscator@1.12.1

Read more comments on GitHub >

github_iconTop Results From Across the Web

String.split() method bug in GWT 2.0.3 - Stack Overflow
A possible workaround is to write a JSNI method that wraps around the standard JavaScript split function, something like this (note: code ...
Read more >
Divides a string into substrings at each Unicode whitespace ...
Possible bug in String.split/1's handling of Unicode whitespace? ... I traced the code for String.split/1 to break() here: elixir/unicode.ex ...
Read more >
How to Split Strings in Python With the split() Method - YouTube
You'll learn how to split strings in Python using the . split () method. . split () has optional parameters that allow you...
Read more >
JavaScript Split – How to Split a String into an Array in JS
You can split a string by each character using an empty string('') as the splitter. In the example below, we split the same...
Read more >
String.Split Method (System) - Microsoft Learn
If you don't want to extract all of the substrings of a delimited string, or if you want to parse a string based...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found