Dexguard does not encrypt classes and makes problems with manifest











up vote
0
down vote

favorite












I use DexGuard, build project in release mode with this:



proguardFile getDefaultDexGuardFile('dexguard-library-release-aggressive.pro')


Everything was fine, but now I need to keep another class from encrypting, I added lines to do not encrypt my ExampleBuilder:



-verbose

# do not encrypt API package
-keep public class com.justexample.api** {
public protected private *;
}

#these 3 lines below I added
-keep public class com.justexample.ExampleBuilder.** {
public protected private static *;
}

-repackageclasses com.justexample


And now when I try to use library i get error:



error: attribute 'android:name' in <service> tag must be a valid Java class name.
Message{kind=ERROR, text=error: attribute 'android:name' in <service> tag must be a valid Java class name.


Generated manifest (from AAR which on dexguard influences) from which is this error, fragment where is error:



<service
android:name="com.justexample.services.゚"
android:exported="false" />









share|improve this question




























    up vote
    0
    down vote

    favorite












    I use DexGuard, build project in release mode with this:



    proguardFile getDefaultDexGuardFile('dexguard-library-release-aggressive.pro')


    Everything was fine, but now I need to keep another class from encrypting, I added lines to do not encrypt my ExampleBuilder:



    -verbose

    # do not encrypt API package
    -keep public class com.justexample.api** {
    public protected private *;
    }

    #these 3 lines below I added
    -keep public class com.justexample.ExampleBuilder.** {
    public protected private static *;
    }

    -repackageclasses com.justexample


    And now when I try to use library i get error:



    error: attribute 'android:name' in <service> tag must be a valid Java class name.
    Message{kind=ERROR, text=error: attribute 'android:name' in <service> tag must be a valid Java class name.


    Generated manifest (from AAR which on dexguard influences) from which is this error, fragment where is error:



    <service
    android:name="com.justexample.services.゚"
    android:exported="false" />









    share|improve this question


























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I use DexGuard, build project in release mode with this:



      proguardFile getDefaultDexGuardFile('dexguard-library-release-aggressive.pro')


      Everything was fine, but now I need to keep another class from encrypting, I added lines to do not encrypt my ExampleBuilder:



      -verbose

      # do not encrypt API package
      -keep public class com.justexample.api** {
      public protected private *;
      }

      #these 3 lines below I added
      -keep public class com.justexample.ExampleBuilder.** {
      public protected private static *;
      }

      -repackageclasses com.justexample


      And now when I try to use library i get error:



      error: attribute 'android:name' in <service> tag must be a valid Java class name.
      Message{kind=ERROR, text=error: attribute 'android:name' in <service> tag must be a valid Java class name.


      Generated manifest (from AAR which on dexguard influences) from which is this error, fragment where is error:



      <service
      android:name="com.justexample.services.゚"
      android:exported="false" />









      share|improve this question















      I use DexGuard, build project in release mode with this:



      proguardFile getDefaultDexGuardFile('dexguard-library-release-aggressive.pro')


      Everything was fine, but now I need to keep another class from encrypting, I added lines to do not encrypt my ExampleBuilder:



      -verbose

      # do not encrypt API package
      -keep public class com.justexample.api** {
      public protected private *;
      }

      #these 3 lines below I added
      -keep public class com.justexample.ExampleBuilder.** {
      public protected private static *;
      }

      -repackageclasses com.justexample


      And now when I try to use library i get error:



      error: attribute 'android:name' in <service> tag must be a valid Java class name.
      Message{kind=ERROR, text=error: attribute 'android:name' in <service> tag must be a valid Java class name.


      Generated manifest (from AAR which on dexguard influences) from which is this error, fragment where is error:



      <service
      android:name="com.justexample.services.゚"
      android:exported="false" />






      android dexguard






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 20 at 9:19

























      asked Nov 20 at 8:38









      user2209414

      521212




      521212
























          1 Answer
          1






          active

          oldest

          votes

















          up vote
          0
          down vote













          android:name is supposed to have reference of your class path which represents the activity. It must not contain any special characters or spaces.



          I believe in your manifest under android:name tag u kept an additional Space and Full stop (.)



          try to remove it and check



          <service
          android:name="com.justexample.services"
          android:exported="false" />


          If you have a specific name for your service class mention it completely and check like below



            <service
          android:name="com.justexample.services.SampleIntentService"
          android:exported="false" />


          Update: From your comments,



          Remove this line from Dexgaurd and check



          -repackageclasses com.justexample





          share|improve this answer























          • But unfortunately this Manifest comes from Android Library (AAR) which I develop and use Dexguard. I build my AAR with dexguard and later I use this AAR in my android test application and I get error that Manifest from AAR is invalid. In source code AAR my manifest is correct. Dexguard encrypts classes and also changes AAR manifest. But this is werid, because everythings was fine until I added lines to keep another one class from encryption - Builder. When there was not lines to keep Builder from encryptiong the generated manifest was OK and no errors.
            – user2209414
            Nov 20 at 9:09










          • @user2209414 please check my updated answer
            – King of Masses
            Nov 20 at 9:24










          • In test application I do not use Dexguard. And second - If you look on my 2nd section with dexguard-project config, when I delete 3 lines (under comment there) from that config I can use correctly my dexguarded AAR in test application. Only when I try to exclude one class from encryption, the result is, that I open test application project and get error that Manifest from AAR is incorrect. It's not correlated in my opinion and this is weird. When I do not exclude one class from encryption, there is no error that android:name in service is incorrect.
            – user2209414
            Nov 20 at 9:29






          • 1




            remove this line and check -repackageclasses com.justexample
            – King of Masses
            Nov 20 at 9:41











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53389074%2fdexguard-does-not-encrypt-classes-and-makes-problems-with-manifest%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          0
          down vote













          android:name is supposed to have reference of your class path which represents the activity. It must not contain any special characters or spaces.



          I believe in your manifest under android:name tag u kept an additional Space and Full stop (.)



          try to remove it and check



          <service
          android:name="com.justexample.services"
          android:exported="false" />


          If you have a specific name for your service class mention it completely and check like below



            <service
          android:name="com.justexample.services.SampleIntentService"
          android:exported="false" />


          Update: From your comments,



          Remove this line from Dexgaurd and check



          -repackageclasses com.justexample





          share|improve this answer























          • But unfortunately this Manifest comes from Android Library (AAR) which I develop and use Dexguard. I build my AAR with dexguard and later I use this AAR in my android test application and I get error that Manifest from AAR is invalid. In source code AAR my manifest is correct. Dexguard encrypts classes and also changes AAR manifest. But this is werid, because everythings was fine until I added lines to keep another one class from encryption - Builder. When there was not lines to keep Builder from encryptiong the generated manifest was OK and no errors.
            – user2209414
            Nov 20 at 9:09










          • @user2209414 please check my updated answer
            – King of Masses
            Nov 20 at 9:24










          • In test application I do not use Dexguard. And second - If you look on my 2nd section with dexguard-project config, when I delete 3 lines (under comment there) from that config I can use correctly my dexguarded AAR in test application. Only when I try to exclude one class from encryption, the result is, that I open test application project and get error that Manifest from AAR is incorrect. It's not correlated in my opinion and this is weird. When I do not exclude one class from encryption, there is no error that android:name in service is incorrect.
            – user2209414
            Nov 20 at 9:29






          • 1




            remove this line and check -repackageclasses com.justexample
            – King of Masses
            Nov 20 at 9:41















          up vote
          0
          down vote













          android:name is supposed to have reference of your class path which represents the activity. It must not contain any special characters or spaces.



          I believe in your manifest under android:name tag u kept an additional Space and Full stop (.)



          try to remove it and check



          <service
          android:name="com.justexample.services"
          android:exported="false" />


          If you have a specific name for your service class mention it completely and check like below



            <service
          android:name="com.justexample.services.SampleIntentService"
          android:exported="false" />


          Update: From your comments,



          Remove this line from Dexgaurd and check



          -repackageclasses com.justexample





          share|improve this answer























          • But unfortunately this Manifest comes from Android Library (AAR) which I develop and use Dexguard. I build my AAR with dexguard and later I use this AAR in my android test application and I get error that Manifest from AAR is invalid. In source code AAR my manifest is correct. Dexguard encrypts classes and also changes AAR manifest. But this is werid, because everythings was fine until I added lines to keep another one class from encryption - Builder. When there was not lines to keep Builder from encryptiong the generated manifest was OK and no errors.
            – user2209414
            Nov 20 at 9:09










          • @user2209414 please check my updated answer
            – King of Masses
            Nov 20 at 9:24










          • In test application I do not use Dexguard. And second - If you look on my 2nd section with dexguard-project config, when I delete 3 lines (under comment there) from that config I can use correctly my dexguarded AAR in test application. Only when I try to exclude one class from encryption, the result is, that I open test application project and get error that Manifest from AAR is incorrect. It's not correlated in my opinion and this is weird. When I do not exclude one class from encryption, there is no error that android:name in service is incorrect.
            – user2209414
            Nov 20 at 9:29






          • 1




            remove this line and check -repackageclasses com.justexample
            – King of Masses
            Nov 20 at 9:41













          up vote
          0
          down vote










          up vote
          0
          down vote









          android:name is supposed to have reference of your class path which represents the activity. It must not contain any special characters or spaces.



          I believe in your manifest under android:name tag u kept an additional Space and Full stop (.)



          try to remove it and check



          <service
          android:name="com.justexample.services"
          android:exported="false" />


          If you have a specific name for your service class mention it completely and check like below



            <service
          android:name="com.justexample.services.SampleIntentService"
          android:exported="false" />


          Update: From your comments,



          Remove this line from Dexgaurd and check



          -repackageclasses com.justexample





          share|improve this answer














          android:name is supposed to have reference of your class path which represents the activity. It must not contain any special characters or spaces.



          I believe in your manifest under android:name tag u kept an additional Space and Full stop (.)



          try to remove it and check



          <service
          android:name="com.justexample.services"
          android:exported="false" />


          If you have a specific name for your service class mention it completely and check like below



            <service
          android:name="com.justexample.services.SampleIntentService"
          android:exported="false" />


          Update: From your comments,



          Remove this line from Dexgaurd and check



          -repackageclasses com.justexample






          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Nov 20 at 9:42

























          answered Nov 20 at 8:55









          King of Masses

          11.8k44764




          11.8k44764












          • But unfortunately this Manifest comes from Android Library (AAR) which I develop and use Dexguard. I build my AAR with dexguard and later I use this AAR in my android test application and I get error that Manifest from AAR is invalid. In source code AAR my manifest is correct. Dexguard encrypts classes and also changes AAR manifest. But this is werid, because everythings was fine until I added lines to keep another one class from encryption - Builder. When there was not lines to keep Builder from encryptiong the generated manifest was OK and no errors.
            – user2209414
            Nov 20 at 9:09










          • @user2209414 please check my updated answer
            – King of Masses
            Nov 20 at 9:24










          • In test application I do not use Dexguard. And second - If you look on my 2nd section with dexguard-project config, when I delete 3 lines (under comment there) from that config I can use correctly my dexguarded AAR in test application. Only when I try to exclude one class from encryption, the result is, that I open test application project and get error that Manifest from AAR is incorrect. It's not correlated in my opinion and this is weird. When I do not exclude one class from encryption, there is no error that android:name in service is incorrect.
            – user2209414
            Nov 20 at 9:29






          • 1




            remove this line and check -repackageclasses com.justexample
            – King of Masses
            Nov 20 at 9:41


















          • But unfortunately this Manifest comes from Android Library (AAR) which I develop and use Dexguard. I build my AAR with dexguard and later I use this AAR in my android test application and I get error that Manifest from AAR is invalid. In source code AAR my manifest is correct. Dexguard encrypts classes and also changes AAR manifest. But this is werid, because everythings was fine until I added lines to keep another one class from encryption - Builder. When there was not lines to keep Builder from encryptiong the generated manifest was OK and no errors.
            – user2209414
            Nov 20 at 9:09










          • @user2209414 please check my updated answer
            – King of Masses
            Nov 20 at 9:24










          • In test application I do not use Dexguard. And second - If you look on my 2nd section with dexguard-project config, when I delete 3 lines (under comment there) from that config I can use correctly my dexguarded AAR in test application. Only when I try to exclude one class from encryption, the result is, that I open test application project and get error that Manifest from AAR is incorrect. It's not correlated in my opinion and this is weird. When I do not exclude one class from encryption, there is no error that android:name in service is incorrect.
            – user2209414
            Nov 20 at 9:29






          • 1




            remove this line and check -repackageclasses com.justexample
            – King of Masses
            Nov 20 at 9:41
















          But unfortunately this Manifest comes from Android Library (AAR) which I develop and use Dexguard. I build my AAR with dexguard and later I use this AAR in my android test application and I get error that Manifest from AAR is invalid. In source code AAR my manifest is correct. Dexguard encrypts classes and also changes AAR manifest. But this is werid, because everythings was fine until I added lines to keep another one class from encryption - Builder. When there was not lines to keep Builder from encryptiong the generated manifest was OK and no errors.
          – user2209414
          Nov 20 at 9:09




          But unfortunately this Manifest comes from Android Library (AAR) which I develop and use Dexguard. I build my AAR with dexguard and later I use this AAR in my android test application and I get error that Manifest from AAR is invalid. In source code AAR my manifest is correct. Dexguard encrypts classes and also changes AAR manifest. But this is werid, because everythings was fine until I added lines to keep another one class from encryption - Builder. When there was not lines to keep Builder from encryptiong the generated manifest was OK and no errors.
          – user2209414
          Nov 20 at 9:09












          @user2209414 please check my updated answer
          – King of Masses
          Nov 20 at 9:24




          @user2209414 please check my updated answer
          – King of Masses
          Nov 20 at 9:24












          In test application I do not use Dexguard. And second - If you look on my 2nd section with dexguard-project config, when I delete 3 lines (under comment there) from that config I can use correctly my dexguarded AAR in test application. Only when I try to exclude one class from encryption, the result is, that I open test application project and get error that Manifest from AAR is incorrect. It's not correlated in my opinion and this is weird. When I do not exclude one class from encryption, there is no error that android:name in service is incorrect.
          – user2209414
          Nov 20 at 9:29




          In test application I do not use Dexguard. And second - If you look on my 2nd section with dexguard-project config, when I delete 3 lines (under comment there) from that config I can use correctly my dexguarded AAR in test application. Only when I try to exclude one class from encryption, the result is, that I open test application project and get error that Manifest from AAR is incorrect. It's not correlated in my opinion and this is weird. When I do not exclude one class from encryption, there is no error that android:name in service is incorrect.
          – user2209414
          Nov 20 at 9:29




          1




          1




          remove this line and check -repackageclasses com.justexample
          – King of Masses
          Nov 20 at 9:41




          remove this line and check -repackageclasses com.justexample
          – King of Masses
          Nov 20 at 9:41


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.





          Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


          Please pay close attention to the following guidance:


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53389074%2fdexguard-does-not-encrypt-classes-and-makes-problems-with-manifest%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Wiesbaden

          Marschland

          Dieringhausen