Skip to content

Instantly share code, notes, and snippets.

View MoshDev's full-sized avatar
🎯
Focusing

Mohammad Ersan MoshDev

🎯
Focusing
View GitHub Profile
/**
*
* @author MErsan
*/
public class ArabicUnicode {
private final static char[] digits = {
'0', '1', '2', '3', '4', '5',
'6', '7', '8', '9', 'a', 'b',
/*
* Copyright (C) 2014 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
package com.mosh.arabicfix;
/**
(Mosh Arabic Shaper) this API should fix Arabic shapes used within Android views, and canvas.
Copyright (C) 2011 Mohammad Mshari Ersan (mosh_java@yahoo.com)
* IF YOU LIKED IT, DONATE BY HIRING ME, OR LET ME MAKE YOUR PROJECT.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
<android.support.design.widget.NavigationView
android:id="@+id/con_home_navigation_view"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
app:headerLayout="@layout/con_home_navigation_view_header"
app:menu="@menu/con_home_navigation_view_menu">
<ImageView
android:layout_width="wrap_content"
@MoshDev
MoshDev / gist:948dd4e37638a4dd55ce
Created February 26, 2016 10:01 — forked from dodyg/gist:5823184
Kotlin Programming Language Cheat Sheet Part 1

#Intro

Kotlin is a new programming language for the JVM. It produces Java bytecode, supports Android and generates JavaScript. The latest version of the language is Kotlin M5.3

Kotlin project website is at kotlin.jetbrains.org.

All the codes here can be copied and run on Kotlin online editor.

Let's get started.

How to inject FlowUp inside your apk

  • Decompile flowup sample app
    • apktool d flowup.apk -o flowup
  • Decompile your apk
    • apktool d original.apk -o injected
  • Copy all the smali files from the flowup library to your decompiled project
    • cp -r flowup/smali injected/smali_classes{N} where N is the next smali_classes group number
  • Open your app AndroidManifest.xml and look for the application tag to get its android:name value
  • Open your app main application .smali file
@MoshDev
MoshDev / installRun.gradle
Last active June 9, 2023 15:41
Install and Run Android App Using Gradle Task
//Place this script inside your application module build.gradle
//It will create a new task(s) based on your application variants within (run) group
//sample: ./gradlew installRunDebug
//sample: ./gradlew installRunStagDebug
project.afterEvaluate {
android.applicationVariants.all { variant ->
task "installRun${variant.name.capitalize()}"(type: Exec, dependsOn: "install${variant.name.capitalize()}", group: "run") {
commandLine = ["adb", "shell", "monkey", "-p", variant.applicationId + " 1"]
doLast {
# install openjdk
sudo apt-get install openjdk-7-jdk
# download android sdk
wget http://dl.google.com/android/android-sdk_r24.2-linux.tgz
tar -xvf android-sdk_r24.2-linux.tgz
cd android-sdk-linux/tools
# install all sdk packages
project.afterEvaluate {
android.applicationVariants.all { variant ->
task "installRun${variant.name.capitalize()}"(type: Exec, dependsOn: "install${variant.name.capitalize()}", group: "run") {
commandLine = ["adb", "shell", "monkey", "-p", variant.applicationId + " 1"]
doLast {
println "Launching ${variant.applicationId}"
}
}
}
}