This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static boolean needToCheckCTA() { | |
boolean result = false; | |
Class<?> mClassType = null; | |
Method mGetIntMethod = null; | |
try { | |
mClassType = Class.forName("android.os.SystemProperties"); | |
mGetIntMethod = mClassType.getDeclaredMethod("getInt", String.class, int.class); | |
Integer v; | |
try { | |
v = (Integer) mGetIntMethod.invoke(mClassType, "persist.sys.cta.security", 0); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.asus.push.service; | |
import android.app.IntentService; | |
import android.content.Intent; | |
import android.os.Bundle; | |
import android.text.TextUtils; | |
import android.util.Log; | |
import com.asus.push.analytics.zAnalytics; | |
import com.asus.push.receiver.zParsePushBroadcastReceiver; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.asus.push.receiver; | |
import android.app.AlarmManager; | |
import android.app.Notification; | |
import android.app.NotificationManager; | |
import android.app.PendingIntent; | |
import android.content.Context; | |
import android.content.Intent; | |
import android.content.pm.ApplicationInfo; | |
import android.content.pm.PackageInfo; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# For Refactoring SDK #################################################################### | |
-keepattributes Signature | |
-keepattributes Exceptions | |
-keep class com.google.** { *; } | |
-dontwarn com.google.** | |
-keep class com.uservoice.** { *; } | |
-dontwarn com.uservoice.uservoicesdk.** | |
-keep class retrofit.** { *; } | |
-dontwarn retrofit.** | |
-dontwarn android.google.support.** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apply plugin: 'com.android.application' | |
android { | |
compileSdkVersion 23 | |
buildToolsVersion "23" | |
defaultConfig { | |
applicationId "xxxxxxxxxxx" | |
minSdkVersion 16 | |
targetSdkVersion 22 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private int getScreenInches(Context context) { | |
WindowManager wm = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE); | |
Display display = wm.getDefaultDisplay(); | |
DisplayMetrics displayMetrics = new DisplayMetrics(); | |
display.getMetrics(displayMetrics); | |
int widthPixels = displayMetrics.widthPixels; | |
int heightPixels = displayMetrics.heightPixels; | |
float widthDpi = displayMetrics.xdpi; | |
float heightDpi = displayMetrics.ydpi; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void setupWindowTranslucentStatus(Activity activity) { | |
if (activity.getResources().getIdentifier("windowTranslucentStatus", "attr", "android") != 0) { | |
Window w = activity.getWindow(); // in Activity's onCreate() for | |
// instance | |
w.setFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS, | |
WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
View view = findViewById(R.id.tv_hello); | |
RotateAnimation rotateAnimation = new RotateAnimation(-5, 5, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f); | |
rotateAnimation.setDuration(1000); | |
rotateAnimation.setRepeatMode(Animation.REVERSE); | |
rotateAnimation.setRepeatCount(Animation.INFINITE); | |
view.startAnimation(rotateAnimation); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
new Thread(new Runnable() { | |
@Override | |
public void run() { | |
try { | |
InstanceID instanceID = InstanceID.getInstance(getApplicationContext()); | |
final String token = instanceID.getToken(getApplicationContext().getString(com.asus.robotrtcsdk.R.string.gcm_defaultSenderId), | |
GoogleCloudMessaging.INSTANCE_ID_SCOPE, null); | |
runOnUiThread(new Runnable() { | |
@Override | |
public void run() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
publishing { | |
publications { | |
aar(MavenPublication) { | |
groupId packageName | |
version = libraryVersion | |
artifactId "robotrtcsdk" | |
artifact("$buildDir/outputs/aar/${project.getName()}-release.aar") | |
pom.withXml { | |
def dependencies = asNode().appendNode('dependencies') |