0

私はConfuserExで難読化しているXamarin.Formsを使用してAndroidアプリケーションを作成しています。私はこのexampleのような宣言的な難読化を使いたいので、それぞれのクラスのObfuscationプロパティを変更することができました。ConfuserExを使用したXamarinフォームの宣言的な難読化

ただし、Xamarin.FormsのSystem.Reflection名前空間は、System.Reflection.ObfuscationAttributeクラスを認識しません。別のNuGetパッケージを使用する必要がありますか、何か不足していますか?

それ以外の場合は、異なるクラスの難読化機能を別の方法で組み込む方法や除外する方法がありますか?

答えて

0

ConfuserExは唯一の属性の名前を見ている:

if (ca.TypeFullName != "System.Reflection.ObfuscationAttribute") 

だから私はちょうどPCL(Xamarin.Forms)プロジェクト自体にSystem.Reflection.ObfuscationAttributeクラスを作成します。

すなわち

using System.Runtime.InteropServices; 

namespace System.Reflection 
{ 
    [AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Interface | AttributeTargets.Parameter | AttributeTargets.Delegate, AllowMultiple = true, Inherited = false), ComVisible(true)] 
    public sealed class ObfuscationAttribute : Attribute 
    { 
     // 
     // Fields 
     // 
     private bool m_strip = true; 

     private bool m_exclude = true; 

     private bool m_applyToMembers = true; 

     private string m_feature = "all"; 

     // 
     // Properties 
     // 
     public bool ApplyToMembers 
     { 
      get 
      { 
       return this.m_applyToMembers; 
      } 
      set 
      { 
       this.m_applyToMembers = value; 
      } 
     } 

     public bool Exclude 
     { 
      get 
      { 
       return this.m_exclude; 
      } 
      set 
      { 
       this.m_exclude = value; 
      } 
     } 

     public string Feature 
     { 
      get 
      { 
       return this.m_feature; 
      } 
      set 
      { 
       this.m_feature = value; 
      } 
     } 

     public bool StripAfterObfuscation 
     { 
      get 
      { 
       return this.m_strip; 
      } 
      set 
      { 
       this.m_strip = value; 
      } 
     } 
    } 
} 

日時:https://github.com/yck1509/ConfuserEx/blob/3c9c29d9daf2f1259edf69054c5693d5d225a980/Confuser.Core/ObfAttrMarker.cs#L138

+0

私は、このメソッドを使用してクラスに名前変更機能を追加しようとしましたが、それは何も変更しませんでした。 ConfuserExが私が宣言的な難読化を使用していることを認識するためには、.crprojファイルに何かを入れる必要がありますか? – cvanbeek

関連する問題