Accessing the source of my application after extracting the apk file


#1

Hello,

I recently developed an application based on ionic 3, but after compilation of the app we manage to access the source of the application by extracting the apk file. Would you have a method to recommend me to avoid this problem!


#2

If you build in production mode, minimization/uglification is performed. Naturally, this makes debugging impossible. If you are concerned about people being able to snoop passwords or other secret strings out of your app binary, then you need to not store them in there in the first place, because anything the device can access during operation of the app can be accessed by anybody with a copy of the app binary.


#3

When I start the production mode I have this error

> ionic-app-scripts build --prod
[06:47:25]  ionic-app-scripts 3.2.0 
[06:47:25]  build prod started ... 
[06:47:26]  clean started ... 
[06:47:27]  clean finished in 1.65 s 
[06:47:27]  copy started ... 
[06:47:32]  deeplinks started ... 
[06:47:32]  deeplinks finished in 219 ms 
[06:47:32]  ngc started ... 
[06:48:01]  ngc finished in 29.30 s 
[06:48:01]  preprocess started ... 
[06:48:01]  preprocess finished in less than 1 ms 
[06:48:01]  webpack started ... 
[06:48:12]  copy finished in 44.24 s 

<--- Last few GCs --->

[1675:0x102802a00]   173178 ms: Scavenge 1384.5 (1424.4) -> 1383.9 (1424.9) MB, 3.7 / 0.0 ms  (average mu = 0.107, current mu = 0.030) allocation failure 
[1675:0x102802a00]   174345 ms: Mark-sweep 1384.7 (1424.9) -> 1384.1 (1423.9) MB, 1163.5 / 0.0 ms  (average mu = 0.068, current mu = 0.027) allocation failure scavenge might not succeed
[1675:0x102802a00]   174359 ms: Scavenge 1384.9 (1423.9) -> 1384.3 (1424.9) MB, 9.0 / 0.0 ms  (average mu = 0.068, current mu = 0.027) allocation failure 


<--- JS stacktrace --->

==== JS stack trace =========================================

    0: ExitFrame [pc: 0x3a06166dbe3d]
Security context: 0x33c7be41e6e1 <JSObject>
    1: symbolToParameterDeclaration(aka symbolToParameterDeclaration) [0x33c75f1ba889] [/Users/lkaopremier/Mobile/ivimarket/node_modules/typescript/lib/typescript.js:~26283] [pc=0x3a06172d1325](this=0x33c7b68026f1 <undefined>,parameterSymbol=0x33c7e525eae1 <SymbolObject map = 0x33c7cb61ef51>,context=0x33c7f9184011 <Object map = 0x33c7cb623201>)
    2: signat...

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
 1: 0x10003ae75 node::Abort() [/usr/local/bin/node]
 2: 0x10003b07f node::OnFatalError(char const*, char const*) [/usr/local/bin/node]
 3: 0x1001a7ae5 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [/usr/local/bin/node]
 4: 0x100572ef2 v8::internal::Heap::FatalProcessOutOfMemory(char const*) [/usr/local/bin/node]
 5: 0x1005759c5 v8::internal::Heap::CheckIneffectiveMarkCompact(unsigned long, double) [/usr/local/bin/node]
 6: 0x10057186f v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::GCCallbackFlags) [/usr/local/bin/node]
 7: 0x10056fa44 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/usr/local/bin/node]
 8: 0x10057c2dc v8::internal::Heap::AllocateRawWithLigthRetry(int, v8::internal::AllocationSpace, v8::internal::AllocationAlignment) [/usr/local/bin/node]
 9: 0x10057c35f v8::internal::Heap::AllocateRawWithRetryOrFail(int, v8::internal::AllocationSpace, v8::internal::AllocationAlignment) [/usr/local/bin/node]
10: 0x10054bca4 v8::internal::Factory::NewFillerObject(int, bool, v8::internal::AllocationSpace) [/usr/local/bin/node]
11: 0x1007d3b54 v8::internal::Runtime_AllocateInNewSpace(int, v8::internal::Object**, v8::internal::Isolate*) [/usr/local/bin/node]
12: 0x3a06166dbe3d 
13: 0x3a06172d1325 
14: 0x3a0617dd3ca3 
15: 0x3a0617dcf85a 
16: 0x3a06179f867f 
[ERROR] Non-zero exit from subprocess.

#4

You’re going to have to allow more memory to be available.