diff --git a/.DS_Store b/.DS_Store index d56b917..a7ad47c 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/Nexacro14/.DS_Store b/Nexacro14/.DS_Store index f4899e1..178c352 100644 Binary files a/Nexacro14/.DS_Store and b/Nexacro14/.DS_Store differ diff --git a/Nexacro14/Android/.DS_Store b/Nexacro14/Android/.DS_Store index 6c53b06..55df294 100644 Binary files a/Nexacro14/Android/.DS_Store and b/Nexacro14/Android/.DS_Store differ diff --git a/Nexacro14/Android/nexacro14_android/.idea/.name b/Nexacro14/Android/nexacro14_android/.idea/.name deleted file mode 100644 index 83ebfde..0000000 --- a/Nexacro14/Android/nexacro14_android/.idea/.name +++ /dev/null @@ -1 +0,0 @@ -DroidStudio \ No newline at end of file diff --git a/Nexacro14/Android/nexacro14_android/.idea/compiler.xml b/Nexacro14/Android/nexacro14_android/.idea/compiler.xml index 96cc43e..61a9130 100644 --- a/Nexacro14/Android/nexacro14_android/.idea/compiler.xml +++ b/Nexacro14/Android/nexacro14_android/.idea/compiler.xml @@ -1,22 +1,6 @@ - - - - - - - - - - - - - - - - - + \ No newline at end of file diff --git a/Nexacro14/Android/nexacro14_android/.idea/gradle.xml b/Nexacro14/Android/nexacro14_android/.idea/gradle.xml index 68b204e..3a6d748 100644 --- a/Nexacro14/Android/nexacro14_android/.idea/gradle.xml +++ b/Nexacro14/Android/nexacro14_android/.idea/gradle.xml @@ -1,18 +1,19 @@ + diff --git a/Nexacro14/Android/nexacro14_android/.idea/misc.xml b/Nexacro14/Android/nexacro14_android/.idea/misc.xml index e0d5b93..dbfe688 100644 --- a/Nexacro14/Android/nexacro14_android/.idea/misc.xml +++ b/Nexacro14/Android/nexacro14_android/.idea/misc.xml @@ -5,7 +5,7 @@ - + diff --git a/Nexacro14/Android/nexacro14_android/.idea/modules.xml b/Nexacro14/Android/nexacro14_android/.idea/modules.xml index 2a8e725..e9ee78e 100644 --- a/Nexacro14/Android/nexacro14_android/.idea/modules.xml +++ b/Nexacro14/Android/nexacro14_android/.idea/modules.xml @@ -2,9 +2,11 @@ - - - + + + + + \ No newline at end of file diff --git a/Nexacro14/Android/nexacro14_android/.idea/runConfigurations.xml b/Nexacro14/Android/nexacro14_android/.idea/runConfigurations.xml deleted file mode 100644 index 7f68460..0000000 --- a/Nexacro14/Android/nexacro14_android/.idea/runConfigurations.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/Nexacro14/Android/nexacro14_android/.idea/vcs.xml b/Nexacro14/Android/nexacro14_android/.idea/vcs.xml index 6564d52..c2365ab 100644 --- a/Nexacro14/Android/nexacro14_android/.idea/vcs.xml +++ b/Nexacro14/Android/nexacro14_android/.idea/vcs.xml @@ -1,6 +1,6 @@ - + \ No newline at end of file diff --git a/Nexacro14/Android/nexacro14_android/DroidStudio.iml b/Nexacro14/Android/nexacro14_android/DroidStudio.iml deleted file mode 100644 index 886c753..0000000 --- a/Nexacro14/Android/nexacro14_android/DroidStudio.iml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/Nexacro14/Android/nexacro14_android/app/app.iml b/Nexacro14/Android/nexacro14_android/app/app.iml deleted file mode 100644 index a1ec47f..0000000 --- a/Nexacro14/Android/nexacro14_android/app/app.iml +++ /dev/null @@ -1,161 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Nexacro14/Android/nexacro14_android/app/build.gradle b/Nexacro14/Android/nexacro14_android/app/build.gradle index 49118b6..93dc897 100644 --- a/Nexacro14/Android/nexacro14_android/app/build.gradle +++ b/Nexacro14/Android/nexacro14_android/app/build.gradle @@ -27,7 +27,6 @@ dependencies { implementation 'com.google.android.gms:play-services-location:16.0.0' implementation 'com.google.firebase:firebase-core:16.0.6' implementation 'com.google.firebase:firebase-messaging:17.3.4' - implementation project(':nexacro14') } apply plugin: 'com.google.gms.google-services' \ No newline at end of file diff --git a/Nexacro14/Android/nexacro14_android/app/src/main/assets/icudtl.dat b/Nexacro14/Android/nexacro14_android/app/src/main/assets/icudtl.dat new file mode 100644 index 0000000..7a889dc Binary files /dev/null and b/Nexacro14/Android/nexacro14_android/app/src/main/assets/icudtl.dat differ diff --git a/Nexacro14/Android/nexacro14_android/app/src/main/java/nexacro/launcher/ProjectSelectActivity.java b/Nexacro14/Android/nexacro14_android/app/src/main/java/nexacro/launcher/ProjectSelectActivity.java deleted file mode 100644 index 4015cf3..0000000 --- a/Nexacro14/Android/nexacro14_android/app/src/main/java/nexacro/launcher/ProjectSelectActivity.java +++ /dev/null @@ -1,341 +0,0 @@ -package nexacro.launcher; - -import android.Manifest; -import android.app.Activity; -import android.app.ActivityManager; -import android.app.ActivityManager.RunningTaskInfo; -import android.app.AlertDialog; -import android.content.Context; -import android.content.DialogInterface; -import android.content.Intent; -import android.os.Build; -import android.os.Bundle; -import android.os.Environment; -import android.support.annotation.NonNull; -import android.support.v4.app.ActivityCompat; -import android.support.v4.content.PermissionChecker; -import android.util.Log; -import android.view.Window; -import android.widget.Toast; - -import com.nexacro.NexacroUpdatorActivity; - -import org.xmlpull.v1.XmlPullParser; -import org.xmlpull.v1.XmlPullParserException; -import org.xmlpull.v1.XmlPullParserFactory; - -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.io.InputStreamReader; -import java.util.ArrayList; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map.Entry; - -/** - * 앱을 실행할때 시작 프로젝트를 동적으로 선택할수 있는 디버깅용 액티비티 입니다. - * 사용 방법은 폰의 기본저장소 루트 경로에 n14_devFeature.xml 파일의 존재유무 입니다. - * 파일이 없다면 이 액티비티를 무시한채 기존 NexacroUpdatorActivity.java에 설정된 시작 url로 프로젝트가 시작하게 됩니다. - * - * 이미 시작 프로젝트가 적용된후 다른 프로젝트로 전환하고 싶은 경우에는 "기존 꺼 삭제" 를 클릭하시면 됩니다. - * - * n14_devFeature.xml 파일 예) - * - * - * - * - * - * - * - */ - -public class ProjectSelectActivity extends Activity{ - private static final String LOG_TAG = "ProjectSelectActivity"; - - LinkedHashMap updateUrlList = new LinkedHashMap(); - - private AlertDialog dialog; - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - - boolean darkTheme = false; - - /* dark */ - if (darkTheme) { - if (Build.VERSION.SDK_INT >= 21 /*Build.VERSION_CODES.LOLLIPOP */) { - setTheme(android.R.style.Theme_Material); - } - else if (Build.VERSION.SDK_INT >= 11 /*Build.VERSION_CODES.HONEYCOMB*/) { - setTheme(android.R.style.Theme_Holo); - } - else { - setTheme(android.R.style.Theme_Black); - } - } - /* light */ - else { - if (Build.VERSION.SDK_INT >= 21 /*Build.VERSION_CODES.LOLLIPOP */) { - setTheme(android.R.style.Theme_Material_Light); - } - else if (Build.VERSION.SDK_INT >= 11 /*Build.VERSION_CODES.HONEYCOMB*/) { - setTheme(android.R.style.Theme_Holo_Light); - } - else { - setTheme(android.R.style.Theme_Light); - } - } - - requestWindowFeature(Window.FEATURE_NO_TITLE); - - // Possible work around for market launches. See http://code.google.com/p/android/issues/detail?id=2373 - // for more details. Essentially, the market launches the main activity on top of other activities. - // we never want this to happen. Instead, we check if we are the root and if not, we finish. - if (!isTaskRoot()) { - final Intent intent = getIntent(); - if (intent.hasCategory(Intent.CATEGORY_LAUNCHER) && Intent.ACTION_MAIN.equals(intent.getAction())) { - finish(); - return; - } - } - } - - @Override - public void onResume() { - super.onResume(); - - if (Build.VERSION.SDK_INT >= 23 /*Build.VERSION_CODES.M*/) { - if (!requestPermisions(new String[]{ - Manifest.permission.READ_EXTERNAL_STORAGE, - Manifest.permission.WRITE_EXTERNAL_STORAGE})) { - start(); - } - } - else { - start(); - } - } - - @Override - public void onPause() { - super.onPause(); - if(dialog != null){ - dialog.dismiss(); - } - } - - @Override - public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) { - super.onRequestPermissionsResult(requestCode, permissions, grantResults); - start(); - } - - private void start() { - checkDebugFile(); - - if (updateUrlList.size() > 0) { - showProjectSelector(); - } else { - Intent intent = new Intent(ProjectSelectActivity.this, getStartActivityClass()); - startActivity(intent); - finish(); - } - } - - private static final int REQUEST_PERMISIONS = 100; - - private boolean requestPermisions(final @NonNull String[] permissions) { - - ArrayList grantedPermissions = new ArrayList(); - ArrayList deniedPermissions = new ArrayList(); - ArrayList deniedOpPermissions = new ArrayList(); - - for (String permission : permissions) { - switch (PermissionChecker.checkSelfPermission(this, permission)) { - case PermissionChecker.PERMISSION_GRANTED: { - grantedPermissions.add(permission); - break; - } - case PermissionChecker.PERMISSION_DENIED: { - deniedPermissions.add(permission); - break; - } - case PermissionChecker.PERMISSION_DENIED_APP_OP: { - deniedOpPermissions.add(permission); - break; - } - default: { - deniedPermissions.add(permission); - break; - } - } - } - - ArrayList requestPermissions = new ArrayList(); - ArrayList rationalPermissions = new ArrayList(); - if (deniedPermissions.size() > 0) - requestPermissions.addAll(deniedPermissions); - //if (deniedOpPermissions.size() > 0) - // requestPermissions.addAll(deniedOpPermissions); - - for (String permission : requestPermissions) { - if (ActivityCompat.shouldShowRequestPermissionRationale(this, permission)) { - rationalPermissions.add(permission); - } - } - - if (requestPermissions.size() <= 0) - return false; - - ActivityCompat.requestPermissions(this, requestPermissions.toArray(new String[requestPermissions.size()]), REQUEST_PERMISIONS); - return true; - } - - private void checkDebugFile() { - XmlPullParserFactory factory; - try { - factory = XmlPullParserFactory.newInstance(); - factory.setNamespaceAware(true); - XmlPullParser parser = factory.newPullParser(); - File file = new File(Environment.getExternalStorageDirectory()+ "/n14_devFeature.xml"); - FileInputStream fis = new FileInputStream(file); - parser.setInput(new InputStreamReader(fis)); - - while(parser.getEventType() != XmlPullParser.END_DOCUMENT) { - if(parser.getEventType() == XmlPullParser.START_TAG) { - if(parser.getName().equals("Project")) { - updateUrlList.put(parser.getAttributeValue(0), parser.getAttributeValue(1)); - } - } - parser.next(); - } - } catch (XmlPullParserException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (FileNotFoundException e) { - Log.d(LOG_TAG, "debugging file not exist!"); - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - - private void showProjectSelector() { - List projectItems = new ArrayList(); - - for(Entry e : updateUrlList.entrySet()) { - String key = e.getKey(); - projectItems.add(key); - } - - final CharSequence[] items = projectItems.toArray(new String[projectItems.size()]); - AlertDialog.Builder builder = new AlertDialog.Builder(ProjectSelectActivity.this); - builder.setTitle("시작 프로젝트를 선택해 주세요."); - builder.setCancelable(false); - - builder.setSingleChoiceItems(items, 0, new DialogInterface.OnClickListener() { - public void onClick(DialogInterface dialog, int whichButton) { - Intent intent = new Intent(ProjectSelectActivity.this, getStartActivityClass()); - intent.putExtra("bootstrapURL", getUpdateUrl(items[whichButton].toString())); - intent.putExtra("projectUrl", getProjectUrl(items[whichButton].toString())); - startActivity(intent); - finish(); - } - }).setPositiveButton("하드 코딩 된 값 로드", new DialogInterface.OnClickListener() { - public void onClick(DialogInterface dialog, int whichButton) { - Intent intent = new Intent(ProjectSelectActivity.this, getStartActivityClass()); - startActivity(intent); - finish(); - } - }).setNegativeButton("기존 꺼 삭제", new DialogInterface.OnClickListener() { - public void onClick(DialogInterface dialog, int whichButton) { - clearApplicationData(); - } - }); - - dialog = builder.create(); - dialog.show(); - } - - private String getUpdateUrl(String key) { - return updateUrlList.get(key); - } - - private String getProjectUrl(String key) { - String projectUrl; - projectUrl = updateUrlList.get(key); - projectUrl = projectUrl.substring(0, projectUrl.lastIndexOf("/")+1); - return projectUrl; - } - - public void clearApplicationData() { - File cache = getCacheDir(); - File appDir = new File(cache.getParent()); - if (appDir.exists()) { - String[] children = appDir.list(); - for (String s : children) { - if (!s.equals("lib")) { - deleteDir(new File(appDir, s)); - Log.i("TAG", "**************** File " + appDir.getAbsolutePath() + "/" + s + " DELETED *******************"); - } - } - } - - cache = getExternalCacheDir(); - appDir = new File(cache.getParent()); - if (appDir.exists()) { - String[] children = appDir.list(); - for (String s : children) { - if (!s.equals("lib")) { - deleteDir(new File(appDir, s)); - Log.i("TAG", "**************** File " + appDir.getAbsolutePath() + "/" + s + " DELETED *******************"); - } - } - } - - Toast.makeText(getApplicationContext(), "기존 프로젝트가 삭제 되었습니다.", Toast.LENGTH_SHORT).show(); - - showProjectSelector(); - } - - public static boolean deleteDir(File dir) { - if (dir != null && dir.isDirectory()) { - String[] children = dir.list(); - for (int i = 0; i < children.length; i++) { - boolean success = deleteDir(new File(dir, children[i])); - if (!success) { - return false; - } - } - } - - return dir.delete(); - } - - public Class getStartActivityClass() - { - ActivityManager activitymanager = (ActivityManager)getSystemService(Context.ACTIVITY_SERVICE); - - List runningtaskinfo = activitymanager.getRunningTasks(1); - String currentPackageName = runningtaskinfo.get(0).baseActivity.getPackageName(); - - Class startActivityClass = null; - - if(currentPackageName.equals("com.nexacro")) { - startActivityClass = NexacroUpdatorActivity.class; - } else { - ClassLoader loader = ProjectSelectActivity.class.getClassLoader(); - try { - startActivityClass = (Class) loader.loadClass("nexacro.launcher.MainActivity"); - } catch (ClassNotFoundException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - - return startActivityClass; - } -} diff --git a/Nexacro14/Android/nexacro14_android/app/src/main/java/nexacro/launcher/UserCustomActivity.java b/Nexacro14/Android/nexacro14_android/app/src/main/java/nexacro/launcher/UserCustomActivity.java deleted file mode 100644 index ef2085a..0000000 --- a/Nexacro14/Android/nexacro14_android/app/src/main/java/nexacro/launcher/UserCustomActivity.java +++ /dev/null @@ -1,55 +0,0 @@ -package nexacro.launcher; - -import android.content.Context; -import android.os.Bundle; -import android.support.v4.app.FragmentActivity; -import android.view.View; -import android.widget.Button; -import android.widget.CompoundButton; -import android.widget.Toast; -import android.widget.ToggleButton; - -import com.nexacro.view.NexacroLayout; - -public class UserCustomActivity extends FragmentActivity { - final Context context = this; - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - - setContentView(getResources().getIdentifier("user_custom", "layout", getPackageName())); - - Button btn = (Button)findViewById(R.id.button); - btn.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - Toast.makeText(UserCustomActivity.this, "Android button component click.", Toast.LENGTH_SHORT).show(); - } - }); - - ToggleButton toggleButton = (ToggleButton) findViewById(R.id.toggleButton); - toggleButton.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { - @Override - public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { - NexacroLayout nexacroLayout = (NexacroLayout) findViewById(R.id.nexacro_layout); - if (isChecked) { - nexacroLayout.setVisibility(View.VISIBLE); - } else { - nexacroLayout.setVisibility(View.INVISIBLE); - } - } - }); - - } - - @Override - protected void onResume() { - super.onResume(); - } - - @Override - protected void onDestroy() { - super.onDestroy(); - } -} diff --git a/Nexacro14/Android/nexacro14_android/app/src/main/jniLibs/arm64-v8a/libnexacro14.so b/Nexacro14/Android/nexacro14_android/app/src/main/jniLibs/arm64-v8a/libnexacro14.so new file mode 100755 index 0000000..126cd44 Binary files /dev/null and b/Nexacro14/Android/nexacro14_android/app/src/main/jniLibs/arm64-v8a/libnexacro14.so differ diff --git a/Nexacro14/Android/nexacro14_android/app/src/main/jniLibs/armeabi-v7a/libnexacro14.so b/Nexacro14/Android/nexacro14_android/app/src/main/jniLibs/armeabi-v7a/libnexacro14.so new file mode 100755 index 0000000..9755b89 Binary files /dev/null and b/Nexacro14/Android/nexacro14_android/app/src/main/jniLibs/armeabi-v7a/libnexacro14.so differ diff --git a/Nexacro14/Android/nexacro14_android/app/src/main/jniLibs/x86/libnexacro14.so b/Nexacro14/Android/nexacro14_android/app/src/main/jniLibs/x86/libnexacro14.so new file mode 100755 index 0000000..2658db4 Binary files /dev/null and b/Nexacro14/Android/nexacro14_android/app/src/main/jniLibs/x86/libnexacro14.so differ diff --git a/Nexacro14/Android/nexacro14_android/app/src/main/jniLibs/x86_64/libnexacro14.so b/Nexacro14/Android/nexacro14_android/app/src/main/jniLibs/x86_64/libnexacro14.so new file mode 100755 index 0000000..3836df6 Binary files /dev/null and b/Nexacro14/Android/nexacro14_android/app/src/main/jniLibs/x86_64/libnexacro14.so differ diff --git a/Nexacro14/Android/nexacro14_android/app/src/main/res/layout/user_custom.xml b/Nexacro14/Android/nexacro14_android/app/src/main/res/layout/user_custom.xml deleted file mode 100644 index 7f5e964..0000000 --- a/Nexacro14/Android/nexacro14_android/app/src/main/res/layout/user_custom.xml +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - - -