Research Article

Self-Controllable Mobile App Protection Scheme Based on Binary Code Splitting

Algorithm 1

Pseudocode for splitting original app.
Input: target app (original.apk)
Output: remaining target tree and split code tree
(1)Tree targetTree, newTree;
(2)Class splitClass;
(3)Method splitMethod;
(4)
(5) targetTree = makeTree (original.dex);
(6) selectSplittingTarget (targetTree, splitClass, splitMethod);
(7)
(8) ASMDEX.init (newTree);
(9) ASMDEX.makeClassNode (newTree, splitClass);
(10) ASMDEX.makeMethodNode (newTree, splitMethod);
(11)
(12)if splitMethod.Type = = STATIC then
(13)  convertMethodCalleeToStub (targetTree, newTree, splitClass, splitMethod);
(14)else
(15)  convertToAbstract (targetTree, splitClass, splitMethod);
(16)  deleteMethodBody (targetTree, splitMethod);
(17)
(18)  for Class class:targetTree.Classes do
(19)   if findMethodCaller (class, splitMethod) = = true then
(20)    convertToStub (class, newTree, splitMethod);
(21)   end if
(22)  end for
(23)end if