tapsellorg/TapsellPlusSDK-AndroidSample

Obfuscation causes ad not being shown

Closed this issue · 7 comments

سلام و عرض ادب
بنده در اپ اندرویدی تپسل پلاس را پیاده سازی کردم و در نسخه debug با موفقیت نمایش تبلیغ را میبینم.
ولی وقتی برنامه را برای انتشار در کافه بازار نسخه release آن را میسازم تبلیغ نمایش داده نمیشود.
میدانم مشکل در obfuscate کردن برنامه و فایل proguard_rules.pro هست ولی طبق مستندات پیش رفتم ولی موفق نشدم.
لطفا راهنمایی بفرمایید، باتشکر.

سلام
لطفا خطا یا استک‌تریسی ارسال کنید که بدونیم چه خطایی باعث شده که نتونید تبلیغ رو نشون بدید
با تشکر

سلام، بنده تونستم که با حذف کردن -repackageclasses از فایل proguard-rules.pro مشکل رو برطرف کنم.
ولی حالا کد من خیلی ضعیف obfuscate میشه.
طوری که با کد obfuscate نشده فرق خاصی نداره.

این ایده‌ی خوبی نیست که r8 رو ضعیف‌ترش کنید
باید بدونم کدوم تیکه ارور خورده که بتونم بگم چی رو مشخصا keep کنید
البته consumer-rules خود sdk باید این مورد رو هندل کنه و شما نیاز نیست کاری کنید

نه، من r8 رو ضعیف ترش نکردم. کد من هیچ اروری نداره.
اپلیکیشن من گرافیکی هست و چون کد من پر از View و Button و ... هست به همین خاطر فکر کنم خوب Obfuscate نمیشه.
چون این View ها آیدی هایی دارن و به همین خاطر Obfuscate نمیشن تا reference ها به مشکل برنخوره.
ولی حتی اسم متد ها هم Obfuscate نمیشه.
فکر نکنم بخاطر proguard-rules که شما ارایه دادین این طور شده. ولی باز فایل proguard-rules رو براتون میفرستم.

#Specifies not to ignore non-public library classes.
-dontskipnonpubliclibraryclasses

#Specifies not to ignore package visible library class members
-dontskipnonpubliclibraryclassmembers

-optimizationpasses 5
#Specifies that the access modifiers of classes and class members may have become broad during processing. This can improve the results of the optimization step.
-allowaccessmodification
#Specifies that interfaces may be merged, even if their implementing classes don't implement all interface methods. This can reduce the size of the output by reducing the total number of classes.
-mergeinterfacesaggressively

#Specifies to apply aggressive overloading while obfuscating. Multiple fields and methods can then get the same names, This option can make the processed code even smaller
#-overloadaggressively

#Specifies to repackage all packages that are renamed, by moving them into the single given parent package
-flattenpackagehierarchy

#Specifies to repackage all class files that are renamed, by moving them into the single given package. Without argument or with an empty string (''), the package is removed completely.
#-repackageclasses

#For example, if your code contains a large number of hard-coded strings that refer to classes, and you prefer not to keep their names, you may want to use this option
-adaptclassstrings
#Specifies the resource files to be renamed, all resource files that correspond to class files are renamed
-adaptresourcefilenames

#Specifies the resource files whose contents are to be updated. Any class names mentioned in the resource files are renamed
-adaptresourcefilecontents

#Specifies not to verify the processed class files.
#-dontpreverify

-verbose

#Specifies to print any warnings about unresolved references and other important problems, but to continue processing in any case.
-ignorewarnings

# ADDED
#-dontobfuscate
#-useuniqueclassmembernames

# For enumeration classes, see http://proguard.sourceforge.net/manual/examples.html#enumerations
#-keepclassmembers enum * {
#    public static **[] values();
#    public static ** valueOf(java.lang.String);
#}

-assumenosideeffects class android.util.Log {
    public static boolean isLoggable(java.lang.String, int);
    public static *** d(...);
    public static *** v(...);
    public static *** i(...);
    public static *** w(...);
    public static *** e(...);
}

##---------------Begin: proguard configuration for tapsell  ----------
-keepclassmembers enum * { *; }
-keep class **.R$* { *; }
-keep interface ir.tapsell.sdk.NoProguard
-keep interface ir.tapsell.sdk.NoNameProguard
-keep class * implements ir.tapsell.sdk.NoProguard { *; }
-keep interface * extends ir.tapsell.sdk.NoProguard { *; }
-keep enum * implements ir.tapsell.sdk.NoProguard { *; }
-keepnames class * implements ir.tapsell.sdk.NoNameProguard { *; }
-keepnames class * extends android.app.Activity
-keep class ir.tapsell.plus.model.** { *; }
-keep class ir.tapsell.sdk.models.** { *; }

-keep class ir.tapsell.sdk.nativeads.TapsellNativeVideoAdLoader$Builder {*;}
-keep class ir.tapsell.sdk.nativeads.TapsellNativeBannerAdLoader$Builder {*;}

#-keepclasseswithmembers class * {
#    native <methods>;
#}

#-keepclasseswithmembers class * {
#   public <init>(android.content.Context, android.util.AttributeSet);
#}

-keep interface ir.tapsell.plus.NoProguard
-keep interface * extends ir.tapsell.plus.NoProguard { *; }
-keep class * implements ir.tapsell.plus.NoProguard { *; }
##---------------End: proguard configuration for tapsell  ----------

سلام.
لطفا از اپلیکیشن ریلیزتون مستقیما داخل IDE لاگ بگیرید و لاگ های مربوطه رو موقع درخواست/نمایش تبلیغات ارسال کنید.
همچنین داخل لاگ ها بررسی کنید که کتابخانه تپسل پلاس با موفقیت init میشه یا نه

Please re-open if the problem still occurs

منم این مشکل رو دارم بعد از ریلیز کلا هیچی بالا نمیاد تمام مراحل هم طبق داکیومنت پیش بردم
لاگی که رو حالت ریلیز میده اینه

org.json.JSONException: End of input at character 0 of at org.json.JSONTokener.syntaxError(JSONTokener.java:460) at org.json.JSONTokener.nextValue(JSONTokener.java:101) at org.json.JSONObject.<init>(JSONObject.java:164) at org.json.JSONObject.<init>(JSONObject.java:181) at i6.e.b(SourceFile:10) at g.j.b(SourceFile:11) at f.g$b.run(SourceFile:22) at android.os.Handler.handleCallback(Handler.java:883) at android.os.Handler.dispatchMessage(Handler.java:100) at android.os.Looper.loop(Looper.java:237) at android.app.ActivityThread.main(ActivityThread.java:8167) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:496) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1100)