@@ -0,0 +1,2141 @@
+package it.saonzo.rmperm;%0A%0Aimport org.junit.After;%0Aimport org.junit.Assert;%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0A%0Aimport java.io.File;%0Aimport java.util.ArrayList;%0Aimport java.util.List;%0A%0A%0Apublic class MainTest %7B%0A    private static final File outputFolder = new File(%22./src/test/resources/output/%22);%0A    private static final File outputFile = new File(outputFolder, %22output.apk%22);%0A    private static final File customDex = new File(%22./src/test/resources/custom.dex%22);%0A    private static final File apk4Test = new File(%22/home/simo/Downloads/merged.apk%22); //TODO%0A%0A%0A    private static String%5B%5D fromListToArray(List%3CString%3E stringList) %7B%0A        String%5B%5D ret = new String%5BstringList.size()%5D;%0A        ret = stringList.toArray(ret);%0A        return ret;%0A    %7D%0A%0A%0A    @Before%0A    public void setUp() throws Exception %7B%0A        if (outputFile.exists())%0A            Assert.assertTrue(outputFile.delete());%0A        Assert.assertTrue(outputFolder.exists());%0A        Assert.assertTrue(customDex.exists());%0A        Assert.assertTrue(apk4Test.exists());%0A    %7D%0A%0A%0A    @After%0A    public void tearDown() throws Exception %7B%0A        Assert.assertTrue(outputFile.delete());%0A    %7D%0A%0A%0A    @Test%0A    public void mainOnlyPermissions() throws Exception %7B%0A        List%3CString%3E args = new ArrayList%3C%3E();%0A        args.add(%22--remove%22);%0A        args.add(%22--input%22);%0A        args.add(apk4Test.toString());%0A        args.add(%22--custom-methods%22);%0A        args.add(customDex.toString());%0A        args.add(%22--permissions%22);%0A        args.add(%22ACCESS_COARSE_LOCATION%22);%0A        args.add(%22--output%22);%0A        args.add(outputFile.toString());%0A        args.add(%22--debug%22);%0A        Main.main(fromListToArray(args));%0A        Assert.assertTrue(outputFile.exists());%0A    %7D%0A%0A%0A    @Test%0A    public void mainOnlyAds() throws Exception %7B%0A        List%3CString%3E args = new ArrayList%3C%3E();%0A        args.add(%22--removeads%22);%0A        args.add(%22--input%22);%0A        args.add(apk4Test.toString());%0A        args.add(%22--output%22);%0A        args.add(outputFile.toString());%0A        args.add(%22--debug%22);%0A        Main.main(fromListToArray(args));%0A        Assert.assertTrue(outputFile.exists());%0A    %7D%0A%0A%7D

test added